Deploying Third-Party Visualization Tools

A variety of graph visualization applications can be used to access data in AnzoGraph via the SPARQL endpoint (see Connecting to the AnzoGraph SPARQL Endpoint for information). For demonstrations, Cambridge Semantics utilizes two third-party applications:

  • Apache Zeppelin: Cambridge Semantics offers an Apache Zeppelin Docker image for download. The Zeppelin image includes a custom SPARQL interpreter for securely connecting to AnzoGraph.
  • Graphileon: Cambridge Semantics partners with Graphileon to offer an extremely lightweight application that provides graph visualization as well as simple forms for data updates and management.

This topic provides information about integrating Zeppelin and Graphileon with AnzoGraph. It also provides instructions for accessing AnzoGraph from your existing Jupyter installation.

Zeppelin Notebook Integration

This section provides instructions for deploying the Cambridge Semantics Apache Zeppelin image with Docker CE, connecting to AnzoGraph, and downloading and running the tutorial notebook. The Zeppelin deployment includes an integrated SPARQL interpreter that enables users to make a secure, authenticated connection to AnzoGraph using gRPC protocol.

RHEL/CentOS Tarball Deployments: Zepellin uses gRPC protocol to connect to AnzoGraph, which requires a username and password for authentication. RHEL/CentOS deployments are not pre-configured with a gRPC user. Before deploying Zeppelin, create a username and password to use for the connection. How do I generate a gRPC username and password for RHEL/CentOS tarball deployments?

For information about installing Docker, see Docker Installation and Configuration Requirements.

  1. Deploying Zeppelin
  2. Connecting to AnzoGraph
  3. Downloading the AnzoGraph Tutorial Notebook

Deploying Zeppelin

Note: If you use Linux for your Docker client, you might want to follow the steps in Post-installation steps for Linux to make sure that a non-root user can run Docker commands and you do not need to include "sudo" in the commands below.

  1. Navigate to a convenient directory that you have write access to and run the following command to create a logs directory in the current directory:
    [ -d $PWD/logs ] ||  mkdir -p  $PWD/logs
  2. Run the following command to create a notebook directory:
    [ -d $PWD/notebook ] || mkdir -p  $PWD/notebook
  3. Run the following command to download and run the Zeppelin image on port 8080:
    sudo docker run -p 8080:8080 --name=zeppelin -v $PWD/logs:/logs -v $PWD/notebook:/notebook \
      -e ZEPPELIN_NOTEBOOK_DIR='/notebook' \
      -e ZEPPELIN_LOG_DIR='/logs' \
      -e ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE=10240000 \
      -d  cambridgesemantics/contrib-zeppelin:latest \
      /zeppelin/bin/zeppelin.sh
  4. When the deployment is complete, open Zeppelin by going to the following URL in your browser:
    http://host_ip_address:8080

    The Welcome to Zeppelin page opens. For example:

Connecting to AnzoGraph

  1. At the top of the Zeppelin Welcome screen, click the anonymous drop-down list and select Interpreter. The Interpreters screen opens.
  2. In the Search interpreters field at the top of the screen, type "sparql" and find the SPARQL interpreter. For example:

  3. Click the edit button and modify the interpreter to enter your AnzoGraph deployment details and make a secure connection to the database. The list below describes each interpreter setting:
    • anzo.graph.host: The IP address of the AnzoGraph host. If AnzoGraph is running in a Docker container, you can run the following command to return the container IP address:
      sudo docker container inspect container_name | grep IP

      For example:

      sudo docker container inspect anzograph | grep IP
    • anzo.graph.password: The password for the user in the anzo.graph.user field. On Docker deployments, specify Passw0rd1.

      RHEL/CentOS Tarball Deployments: Zepellin uses gRPC protocol to connect to AnzoGraph, which requires a username and password for authentication. RHEL/CentOS deployments are not pre-configured with a gRPC user. Before deploying Zeppelin, create a username and password to use for the connection. How do I generate a gRPC username and password for RHEL/CentOS tarball deployments?

    • anzo.graph.port: The gRPC port for AnzoGraph. The default value is 5700. Do not change this value.
    • anzo.graph.trust.all: Instructs Zeppelin to trust the AnzoGraph SSL certificates. Accept the default value of true.
    • anzo.graph.user: The username to use to log in to AnzoGraph. On Docker deployments, specify admin.
  4. When you finish adding the connection details, click Save at the bottom of the screen. Zeppelin displays a dialog box that asks if you want to restart the interpreter with the new settings. Click OK to configure the connection.
  5. When the interpreter restart is complete, click the Zeppelin logo at the top of the screen to return to the Welcome screen.

Downloading the AnzoGraph Tutorial Notebook

Click the link below to download the AnzoGraph Tutorial Notebook to your computer. Then follow the instructions in this section to import the notebook and run the tutorial in Zeppelin.

Download the AnzoGraph Tutorial Zeppelin Notebook
  1. Extract the downloaded notebook ZIP file on your computer. The ZIP file contains AnzoGraph-Zeppelin-Tutorial.json.
  2. On the Zeppelin Welcome screen, click Import note. Zeppelin displays the Import New Note screen.

  3. On the import screen, click Select JSON File, and then select the AnzoGraph-Zeppelin-Tutorial.json file to import. Zeppelin imports the note and lists the new file under the filter text box on the home page. For example:

    Click the link to open the notebook. It might take some time to load all of the contents. To run a query in the file, click the run () button for the paragraph. For more information about using Zeppelin, see the Zeppelin Documentation.

Graphileon Integration

This section provides instructions for deploying a demonstration version of Graphileon that is available as a Docker image. The demo analyzes a small subset of flight data from the Department of Transportation. You can load the flight data into AnzoGraph and explore the graph with Graphileon by running the predefined views or creating your own views.

Requirements

  • Graphileon is a lightweight application that typically uses less than 1 GB of RAM. As long as the AnzoGraph host meets the minimum RAM requirements of 16 GB, it is fine to install Graphileon on the same server as AnzoGraph.
  • To work with the Graphileon demonstration, the Cambridge Semantics Airline demo data must be loaded to AnzoGraph. To load the data, click here to view the INSERT query. Copy or download the query and run it from the AnzoGraph command line interface (CLI) or the Query Console. See Quick Start – The First Five Minutes for more information about using the CLI or Query Console.

Tip: The quickest way to configure AnzoGraph and Graphileon to work together is to deploy the AnzoGraph and Graphileon containers in the same Docker CE instance.

  1. Download the Graphileon tarball provided by Cambridge Semantics to the host server.
  2. Run the following command to load the Graphileon tarball with Docker:
    sudo docker load -i /path-to-tarball/graphileon-2.4.6-anzograph-docker.tar.gz

    Docker loads the image and reports the progress.

  3. Run the following command to start the Graphileon container on port 3000:
    sudo docker run -dt -p 3000:3000 graphileon
  4. Open a browser and go to the following URL:
    http://graphileon-server-IP:3000

    Where graphileon-server-IP is the IP address of the Graphileon host server. Graphileon displays the Settings page where you configure the AnzoGraph data store and create an admin user.

  5. On the Data stores tab, select the I allow Graphileon to create nodes… checkbox.
  6. Click the Type drop-down list and select AnzoGraph. The application automatically populates the Protocol, Host, Port, and Path settings for AnzoGraph. Do not change the Protocol, Port, or Path values.
  7. Configure the Host according to one of the following options:
    • If you deployed AnzoGraph and Graphileon on your local machine, accept localhost as the value for Host.
    • If you deployed AnzoGraph and/or Graphileon on a server, edit the Host field to specify the routable IP address for AnzoGraph.
  8. Leave the User and Password fields blank. The image below shows an example of the completed screen. In this case, AnzoGraph and Graphileon are deployed in the same Docker instance on a Linux server:

  9. Click Test Connection to make sure that Graphileon can connect to AnzoGraph, and then click Save. Graphileon saves the data store settings.

  10. Click the Users tab to set up the admin user credentials. Graphileon displays the user settings screen.

  11. Type a password for the admin user in the Password and Confirm password fields. Then click Save.
  12. At the bottom of the screen, click the Apply Settings button. Graphileon applies the settings and then prompts you to log in as the admin user. Click Login to open the application.
  13. Once the Graphileon Web Application has started, click the drop down in the top left corner and select AnzoGraph Demo. You will see a pre-built dashboard with grey, red, and green buttons. The grey buttons will execute pre-selected queries and show the results in grid (table) output. Top 10 average departure delays also produces a bar chart in addition tabular results to show that you can easily produce charts as well.
  14. Click the green Flight Airport Visualization to see the graph visualization tool appear where you can select nodes and edges, see their properties, and drill down through the incoming and outgoing relations.

For more information about using Graphileon, see the Graphileon Documentation.

Jupyter Notebook Integration

This section provides information about accessing AnzoGraph with your existing Jupyter Notebook or JupyterLab installation. If you do not have Jupyter Notebook or JupyterLab installed, follow the instructions in Installing Jupyter on the Jupyter website to install Jupyter Notebook and its prerequisites.

Accessing AnzoGraph from a Jupyter Notebook

  1. Since AnzoGraph runs SPARQL queries, make sure that the Jupyter SPARQL kernel is installed. To install the kernel, run the following commands:
    pip install sparqlkernel
    jupyter sparqlkernel install --user
  2. Connect to the AnzoGraph SPARQL endpoint by adding the following text to a cell in the notebook and then running the cell.
    %endpoint http://hostname/sparql
    %auth basic admin Passw0rd1

    Where hostname is the IP address of the AnzoGraph instance. If AnzoGraph is running in a Docker container, you can run the following command to return the container IP address:

    docker container inspect container_name | grep IP

    For example:

    docker container inspect anzograph | grep IP

Once the notebook is connected to the AnzoGraph endpoint, you can run SPARQL queries against AnzoGraph.

Related Topics