19 About the Graph Visualization Application

The Graph Visualization application is a single-page web application that works with the graph server (PGX).

The graph server can be deployed in embedded mode or in Apache Tomcat or Oracle WebLogic Server. Graph Visualization application takes PGQL queries as an input and renders the result visually. A rich set of client-side exploration and visualization features can reveal new insights into your graph data.

Graph Visualization application works with the graph server (PGX). It can visualize graphs that are have been loaded into the graph server (PGX), either preloaded when the graph server is started, or loaded at run-time by a client application and made available through the graph.publish() API.

19.1 How does the Graph Visualization Application Work

The Graph Visualization application exposes its own web interface and REST endpoint and can execute PGQL queries against the graph server (PGX) or the Oracle Database (PGQL on RDBMS).

By default, it uses PGX and therefore requires a running PGX server to function. Alternatively, you can configure Graph Visualization application to directly talk to the database via PGQL on RDBMS. Graph Visualization application does not have any UI to create graphs, it can only visualize graphs which are already loaded into PGX or Oracle Database. See REST Endpoints for the Graph Server for more information on the graph visualization REST endpoints.

See Running the Graph Visualization Application in Standalone Mode for more information on starting the Graph Visualization application.

19.2 Kerberos Enabled Authentication for the Graph Visualization Application

The Graph Visualization application can authenticate users with Kerberos authentication enabled.

Graph Visualization provides two different drivers to log in:

  • Graph Server (PGX) Driver: To send your credentials (Kerberos ticket) to Graph Server.
  • Database Driver: To send your credentials (Kerberos ticket) directly to the database.

19.2.1 Prerequisite Requirements for Kerberos Authentication

The system requirements for the respective PGQL drivers are as follows:

  • Graph Server (PGX) Driver: See Prerequisite Requirements for enabling Kerberos authentication on the graph server (PGX).
  • Database Driver:
    • The database must have Kerberos authentication enabled. See Configuring Kerberos Authentication for more information.
    • Both the database and the Kerberos Authentication Server need to be reachable from the host where the Graph Visualization application is running.
    • The database must be prepared for graph server authentication. That is, relevant graph roles have been granted to users who will log into the Graph Visualization application.

19.2.2 Preparing the Graph Visualization Application for Kerberos Authentication

In order to use Kerberos authentication, you must enter your Active Directory credentials in the Graph Visualization application login page.

To enable Kerberos authentication for the Graph Visualization application, follow the steps shown:

  1. Locate the web.xml file for your installation.
    You can locate the WEB-INF/web.xml inside the Graph Visualization WAR file for your installation as shown in the following table:

    Table 19-1 Location of WEB-INF/web.xml file

    Type of Installation WAR file Location
    Standalone installation (RPM) graphviz-<version>-pgviz<graphviz-version>.war /opt/oracle/graph/graphviz
    Apache Tomcat Deployment: graphviz-<version>-pgviz<graphviz-version>-tomcat.war

    <version> denotes the downloaded Oracle Graph Server and Client version.

    1. Download oracle-graph-webapps-<version>.zip from Oracle Software Delivery Cloud
    2. Unzip the file into a directory of your choice.
    3. Locate the .war file for deploying the Graph Visualization application to Tomcat. It follows the naming pattern: graphviz-<version>-pgviz<graphviz-version>-tomcat.war
    Oracle WebLogic Server Deployment graphviz-<version>-pgviz<graphviz-version>-wls.war

    <version> denotes the downloaded Oracle Graph Server and Client version.

    1. Download oracle-graph-webapps-<version>.zip from Oracle Software Delivery Cloud
    2. Unzip the file into a directory of your choice.
    3. Locate the .war file for deploying the Graph Visualization application to Oracle WebLogic Server. It follows the naming pattern: graphviz-<version>-pgviz<graphviz-version>-wls.war
  2. Extract the appropriate WAR file to a directory of your choice by executing the following command:
    unzip graphviz-*.war -d <war-file-extraction-path>
  3. Locate and open the WEB-INF/web.xml file for update using any file editor of your choice. For example:
    cd <war-file-extraction-path>
    vi WEB-INF/web.xml
  4. Enable the graphviz.driver.auth.kerberos parameter as shown:
    <context-param>
            <param-name>graphviz.driver.auth.kerberos</param-name>
            <param-value>true</param-value>
    </context-param>
    
    Setting this flag true initiates the Graph Visualization application to install its own okinit package.
  5. Optionally. set the cache directory that will be used by the Graph Visualization application to temporarily store Kerberos tickets given by clients as shown
    <context-param>
            <param-name>graphviz.driver.auth.kerberos.cache_dir</param-name>
            <param-value>/dev/shm/graph_cache</param-value>
    </context-param>
    The default value is /dev/shm/graph_cache. If the directory does not exist, it will be automatically created upon server startup.
  6. Optionally, set the maximum amount of concurrent Kerberos active sessions in the Graph Visualization application.
    <context-param>
            <param-name>graphviz.driver.auth.kerberos.max_cache_size</param-name>
            <param-value>64</param-value>
    </context-param>
  7. Optionally, modify the directory where okinit package will be installed, by updating the following parameter:
    <context-param>
        <param-name>graphviz.driver.auth.kerberos.okinit-directory</param-name>
        <param-value>/tmp</param-value>
    </context-param>

    Note:

    The default value is /tmp and you must have executable permission for the directory.
  8. Optionally, set the following parameter if there is a location for an existing okinit package on your machine. In this case, the GraphVisualization application will not install its own okinit package.
    <context-param>
            <param-name>graphviz.driver.auth.kerberos.graphviz.driver.auth.okinit-location</param-name>
            <param-value></param-value>
    </context-param>

    Note:

    The GraphVisualization application must have executable permission for the directory location.
  9. Finally, after all the preceding updates, repackage the WAR file by executing the following commands:
    cd <war-file-extraction-path>
    jar -cvf <war-file-name> *
  10. Redeploy the WAR file to the appropriate directory for your installation.
    Kerberos authentication is enabled for the Graph Visualization Application.

19.3 Embedding the Graph Visualization Library in a Web Application

You can integrate the graph visualization component in a web application to visualize graph data.

The Oracle Graph Server and Client deployment contains a JavaScript library for the Graph Visualization component in the oracle-graph-visualization-library-23.2.0.zip file.

The Graph Visualization interface in the library supports:

  • Custom vertex and edge styling based on its properties
  • Interactive actions for graph exploration
  • Tooltip with vertex and edge details
  • Automatic legend
  • Multiple graph layouts

See the Graph JavaScript API Reference for Property Graph Visualization for more information.

You can download the oracle-graph-visualization-library-23.2.0.zip file from Oracle Software Delivery Cloud and integrate the library in you web application.

See the demo application on GitHub for an example.