Visualize Property Graph with Cytoscape - Spatial and Graph part 4

March 27, 2020 | 4 minute read
Text Size 100%:

Articles in this series:

https://www.ateam-oracle.com/rdf-view-from-relational-spatial-and-graph-part-1
https://www.ateam-oracle.com/rdf-model-from-rdf-view-spatial-and-graph-part-2
https://www.ateam-oracle.com/property-graph-from-relational-spatial-and-graph-part-3
https://www.ateam-oracle.com/visualize-property-graph-with-cytoscape-spatial-and-graph-part-4
https://www.ateam-oracle.com/oracle-20c-pgx-and-graphviz-spatial-and-graph-part-5

Introduction

This article will cover setting up Cytoscape and visualizing a graph.

Prerequisites

This document describes steps with Oracle Enterprise Edition 18.3.0.0.0 on Oracle Linux 7.7

If you are using any other version of the DB, the steps may be different. It is assumed you have already followed the prerequisites and steps in other articles in this series.

Required software

Download and install Cytoscape 3.2.1. That specific version is required for following the steps in this series of articles.  Java is required to run Cytoscape.

https://cytoscape.org/download_old_versions.html

 

Download and install the Oracle Cytoscape plugin. Instructions are in the archive you download.

https://www.oracle.com/database/technologies/semantic-technologies-downloads.html You want the May 2018 version.

Start PGX server

Oracle 18c comes with pgx 2.5.1 embedded. If can be patched to newer versions, but we are using 2.5.1 for this article. To start the PGX server, as the user that owns the Oracle Database installation: edit server.conf in $ORACLE_HOME/md/property_graph/pgx/conf
set enable_tls to false

Note this disables PGX security and is only meant for dev/demo purposes.

Make sure $ORACLE_HOME/md/property_graph/pgx/bin/start-server is executable.

Execute:

$ORACLE_HOME/md/property_graph/pgx/bin/start-server

Launch Cytoscape

Launch cytoscape with startCytoscape.sh. If you followed the install instructions for the Oracle Cytoscape plugin, you should have this executable.
If you have the Welcome to Cytoscape screen at launch, click close. Go to File->Load->Property Graph->Connect to Oracle Database.
If you are following the previous articles in this series, you would enter the following connect information:

  1. Fill in JDBC url with jdbc:oracle:thin:@localhost:1521/nwpdb
  2. Enter username nwuser and password nwuser
  3. Click the search icon next to graph, and select NWPG
  4. Go to section 3 (Start with known vertices with id's) and enter 108
  5. Click load graph next to where you entered 108

You should now see a circle with 108 in it. This is the vertex with id 108, which is a category we loaded in previous articles.

Expand a vertex

Right click on 108, select apps, select expand vertex. Zoom out if necessary to see the entire screen. This is all the products that belong to that category.

Add more meaningful labels

By default, you are seeing the ID's. We can change what label is used to make things more meaningful.

On the icon bar at the top, click the 2nd icon from the left - Define Visual Mapping Rules.

Select the second tab, called "Node label and size" In the first section, called "Vertices label", select the property label bubble and select categoryName in the dropdown. Click apply changes.

You should now see the bubble that was 108 labeled as Seafood. Repeat the same steps, but select productName in the dropdown on the Vertices label section. Your screen should now look like this:

Now we can expand a product and see who the supplier is. Right click on the product Spegesild. Select apps, select expand vertex. You should now see 321 linked to the product. This is the supplier. Select bubble 321. Go to Vertices labels again, select the property label bubble and select companyName. 321 should now change to the company that supplies to product, Lyngbysild. 

Michael Shanley


Previous Post

Property Graph from Relational - Spatial and Graph part 3

Michael Shanley | 8 min read

Next Post


Oracle 20c PGX and GraphViz - Spatial and Graph part 5

Michael Shanley | 3 min read