Building a Relationship Map Using Oracle APEX no-code platform and Oracle Database 23 ai
I am active on social media platforms like X, LinkedIn, and Threads. I like understanding how influencer relationships can provide valuable insights into my networks and trends. With Oracle APEX and the power of Oracle Database 23ai, I have created a robust influencer map to visualize these relationships. This blog post will guide you through building a similar relationship map using Oracle APEX and open-source data or your own dataset. I will go over the brief steps and then follow up with the detailed ones.
Step 1: Set Up Your Oracle APEX Environment
Before creating the relationship map, ensure you have a working Oracle APEX environment.
Create an Oracle APEX Workspace:
- Visit the Oracle APEX workspace creation page and follow the instructions to create a workspace.
- Log in to your newly created APEX workspace.
Step 2: Load Open-Source Data
For this example, we will use a Twitter dataset available on Kaggle.
Download the Dataset:
Go to Kaggle’s Twitter Data and download the dataset.
Create Tables to Store Data:
In Oracle APEX, navigate to SQL Workshop > SQL Commands and create tables for storing influencer and relationship data.
CREATE TABLE influencers (
id NUMBER PRIMARY KEY,
name VARCHAR2(100),
followers NUMBER,
following NUMBER,
tweets NUMBER
);
CREATE TABLE relationships (
id NUMBER PRIMARY KEY,
source NUMBER REFERENCES influencers(id),
destination NUMBER REFERENCES influencers(id)
);
Load Data into Tables:
Go to SQL Workshop > Utilities > Data Workshop and import your CSV files into the influencers
and relationships
tables.
Step 3: Create an APEX Application
Create a New Application:
Go to App Builder > Create > New Application.
Name your application (e.g., “Influencer Map”).
Add Pages to the Application:
Add a Dashboard page to display key metrics.
Add an Interactive Report page for the influencers
table.
Add an Interactive Report page for the relationships
table.
Add a Graph Visualization page to visualize the influencer network.
Step 4: Configure the Network Diagram
Let’s set up the Oracle JET Network Diagram to visualize the relationships.
Create a New Page for the Network Diagram:
Go to App Builder and add a new “Chart” > “Other” > “Network Diagram” page.
Name the page (e.g., “Influencer Network”) and finish the setup.
Configure the Data Sources for the Network Diagram:
Open the Network Diagram page.
Nodes Section:
Source Type: SQL Query
SQL Query:
SELECT
'n' || id AS id,
name AS label,
followers AS size,
NULL AS group_id
FROM influencers;
ID Column: id
Label Column: label
Size Column: size
Group Column: group_id
Links Section:
Source Type: SQL Query
SQL Query:
SELECT
'n' || source AS source,
'n' || destination AS destination,
NULL AS link_id
FROM relationships;
Source Column: source
Destination Column: destination
Link ID Column: link_id
Customize Node and Link Properties:
Node Styling:
Size: Based on followers count (size column)
Tooltip: Name: {label}, Followers: {size}
Link Styling:
Source Type: SQL Query
SQL Query:
SELECT
'n' || source AS source,
'n' || destination AS destination,
NULL AS link_id
FROM relationships;
Source Column: source
Destination Column: destination
Link ID Column: link_id
Customize Node and Link Properties:
Node Styling:
Size: Based on followers count (size column)
Tooltip: Name: {label}, Followers: {size}
Link Styling:
Uniform styling
Tooltip: Source: {source}, Destination: {destination}
Step 5: Deploy and Test Your Application
Save Your Changes:
Click on “Save” to apply all the configurations.
Run the Application:
Click on the “Run” button to deploy your application.
Test the network diagram to ensure that nodes and links are displayed correctly.
Following these steps, you’ve successfully created an influencer map using Oracle APEX and open-source Twitter data. This powerful visualization can help you understand the relationships and dynamics within social networks.
Oracle APEX’s integration with Oracle JET provides a robust platform for creating interactive and insightful visualizations, making it an excellent choice for analyzing complex data relationships.
Stay tuned for more posts on leveraging Oracle technologies to build innovative applications and visualizations!
Detailed Steps
This precess involves several steps, including setting up your Oracle APEX environment, loading the data into your database, and then creating and configuring the application. Here is a step-by-step guide to achieve this:
Step 1: Set Up Oracle APEX Environment
STEP1
Create an Oracle APEX Workspace:
— Go to the Oracle APEX workspace creation page: [Oracle APEX Workspace](https://apex.oracle.com/)
— Follow the instructions to create a workspace.
Log in to APEX:
— Use the credentials provided during the workspace creation to log in to your APEX instance.
STEP2
Load Open-Source Data
Choose Open-Source Data:
— For this example, let’s use the Twitter dataset available on Kaggle: [Twitter Data](https://www.kaggle.com/datasets).
— Download the dataset and prepare it for import (usually CSV format).
Create Tables to Store Data:
— In Oracle APEX, go to SQL Workshop > SQL Commands and create tables to store the data.
CREATE TABLE influencers (
id NUMBER PRIMARY KEY,
name VARCHAR2(100),
followers NUMBER,
following NUMBER,
tweets NUMBER
);
CREATE TABLE relationships (
id NUMBER PRIMARY KEY,
source NUMBER REFERENCES influencers(id),
destination NUMBER REFERENCES influencers(id)
);
Load Data into Tables:
— Go to SQL Workshop > Utilities > Data Workshop and import your CSV files into the `influencers` and `relationships` tables.
STEP3
Create an APEX Application
Create a New Application:
— Go to App Builder > Create > New Application.
— Name your application (e.g., “Influencer Map”).
Add Pages to the Application:
— Add a Dashboard page to display key metrics.
— Add an Interactive Report page for the `influencers` table.
— Add an Interactive Report page for the `relationships` table.
— Add a Graph Visualization page to visualize the influencer network.
STEP4
Configure Dashboard Page
Add Cards to Display Metrics:
— Go to your Dashboard page, click on Add > Chart > KPI.
— Add cards to display metrics like total influencers, total followers, and total tweets.
SELECT COUNT(*) AS total_influencers FROM influencers
SELECT SUM(followers) AS total_followers FROM influencers
SELECT SUM(tweets) AS total_tweets FROM influencers
STEP5
Configure Interactive Reports
Interactive Report for Influencers:
— Go to the `influencers` report page and configure the report to display columns such as name, followers, following, and tweets.
Interactive Report for Relationships:
— Go to the `relationships` report page and configure the report to display the source and destination influencers.
STEP6
Create Graph Visualization
Install Oracle JET for Visualization:
— Oracle APEX supports Oracle JET for creating advanced visualizations. Go to Shared Components > Plug-ins and install the Oracle JET plugin if it’s not already installed.
Create a Network Graph:
— Go to your Graph Visualization page, add a new region, and select Oracle JET Network Diagram.
— Configure the network diagram to use data from the `relationships` table for edges and the `influencers` table for nodes.
SELECT
'n' || id AS id,
name AS label
FROM influencers
SELECT
'n' || source AS source,
'n' || destination AS destination,
NULL AS label
FROM relationships
STEP7
Deploy and Test
Run the Application:
— Click on the Run button to deploy your application.
— Test the application to ensure all pages and reports are working correctly.
Adjust and Customize:
— Customize the look and feel of your application as needed.
— Add any additional functionalities or pages that may enhance the user experience.
Example Visualizations and Queries
Sample Query for Influencer Metrics:
SELECT name, followers, following, tweets
FROM influencers
WHERE followers > 10000
ORDER BY followers DESC
Sample Visualization of Influencer Network:
— Configure the Oracle JET Network Diagram to visualize relationships between influencers.
— Use the imported data to show connections between high-profile influencers and their followers.
Comments
Post a Comment