Get Started with the APEX Graph Visualization Plug-in (Oracle AI Database 26ai)
Get started with the APEX Graph Visualization plug-in in your APEX application on your Autonomous AI Database instance using Oracle AI Database 26ai.
- Download the Graph Visualization (Preview) plug-in
(
region_type_plugin_graphviz.sql) from the Oracle APEX GitHub repository. - Sign in to your APEX workspace in your Autonomous AI Database instance.
- Create the
DBMS_GVTpackage in your APEX workspace.- Download the
required-for-26ai/gvt_sqlgraph_to_json.sqlfile from the Oracle APEX GitHub repository. - Upload and run the
gvt_sqlgraph_to_json.sqlscript in your APEX workspace (see Uploading a SQL Script). - Download the
required-for-26ai/required_helper_functions.sqlfile from the Oracle APEX GitHub repository and run the script in your APEX workspace.
- Download the
- Import the downloaded plug-in script
(
region_type_plugin_graphviz.sql) file into your target APEX application (see Importing Plug-ins). - Implement the plug-in in an application page to perform various graph
visualizations.
The following basic example describes the steps to visualize a graph existing in your database using the Graph Visualization plug-in.
- Open the application page in Page Designer.
- Select the Rendering tab on the left pane of the Page Designer.
- Right-click an existing component and add a new region component.
- Select the new region and configure the following attributes
in the Region tab of the Property
Editor on the right pane of the Page Designer:
- Enter the Identification Title.
- Select Graph Visualization (Preview) as Identification Type.
- Select the source Location as Local Database.
- Select the Type value.
You can choose either SQL Query or PropertyGraph as the Type value.
- Embed the SQL graph query to retrieve the graph
data.
Depending on the type selected in the previous step, you can provide the query as shown in the following examples:
- SQL Query: Enter the
SQL graph query input as
shown:
SELECT * FROM GRAPH_TABLE ( BANK_SQL_PG MATCH (a IS accounts) -[e IS transfers]-> (b IS accounts) WHERE a.id = 816 COLUMNS(vertex_id(a) AS id_a, edge_id(e) AS id_e, vertex_id(b) AS id_b) ) - PropertyGraph :
Provide the SQL graph query as shown:
- Graph Name: Select the SQL property graph name.
- Match
Clause: Enter the
MATCHclause of the graph query. For example:(a IS accounts) -[e IS transfers]-> (b IS accounts) - Columns
Clause: Enter the
COLUMNSclause of the graph query. For example:(vertex_id(a) AS id_a, edge_id(e) AS id_e, vertex_id(b) AS id_b) - Where Clause:
Optionally, enter the
WHEREclause of the query. For example,a.id = 816.
- SQL Query: Enter the
SQL graph query input as
shown:
- Run the application page to visualize the graph rendered by
the plugin.

Description of the illustration apex_gviz_basic_graph.pngNote:
The APEX Graph Visualization plug-in on Oracle AI Database 26ai does not support graphs that use vertex or edge keys withDATEorTIMESTAMPdata types. Visualizing graph query results on graphs withDATEorTIMESTAMPkeys may result in only a subset of graph data being shown.
- Optionally, you can control the display size of the graph by dynamically
changing the number of elements to be displayed in the graph.If the Show Display Size Control is switched ON in the Appearance panel, then the graph display size is rendered at the bottom of the graph visualization as shown:
In the preceding figure:
- 54 of many vertices: This indicates 54 vertices are
displayed and
manyindicates the total number of vertices in the graph. - 46 of many edges: This indicates 46 edges are
displayed and
manyindicates the total number of edges in the graph. - 100 of many elements: This indicates 100 elements are
displayed and
manyindicates the total number of graph elements. The initial value depends on the Display Size configuration in the Settings panel.
- 54 of many vertices: This indicates 54 vertices are
displayed and
- Optionally, you can import and run the Sample Graph Visualizations
application from Oracle APEX GitHub
repository.
- Import the
sample-apps/sample-graph-visualizations/sample-graph-visualizations_26ai.sqlinto your APEX instance and install the application by following the steps in Importing an Application.When installing the sample application, ensure that you have theCREATE VIEWprivilege for installing the supporting objects.You can directly run the sample application once it is installed.

Description of the illustration apex_sample_graph_viz.pngAlso, note that the sample application requires a secure
HTTPSconnection. If you want to disable secure connection, then perform the following steps:Caution:
It is not recommended to disable secure connections in production deployment.- Navigate to the sample application home page in App Builder.
- Click Shared Components.
- Click Authentication Schemes under Security.
- Click the Current authentication scheme.
- Click the Session Sharing tab and turn off the Secure switch.
- Click Apply Changes and then run the application.
- Import the
