Oracle Big Data Spatial and Graph Setup

  • Post author:
  • Post category:BDSG

In this post I will be describing basic installation and setup of oracle BDSG (Big Data Spatial and Graph) in a lab server. Please, note that:

Setting up Java

You may skip this step if java is already configured.
Java Development Kit (JDK) can be downloaded from the link:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Here are the steps to configure java in lab server:
First, copy downloaded java rpm to server. In this example, it is myserver1 [192.168.99.102]

Login to server and install oracle java

Install Oracle Big Data Spatial and Graph

BDSG software can be downloaded from oracle software delivery site with a oracle registered user. The user does not necessary to have a CSI (customer support identifier).
https://edelivery.oracle.com/osdc/faces/SoftwareDelivery

oracle-spatial-graph-3.0-0.x86_64.rpm will be extracted from the downloaded package. I use RedHat based CentOS 7 as OS in my lab so I can install rpm.

First, copy the rpm to the lab server:

Install rpm with yum:

Initial Configuration

When rpm is installed with root, tmp_data is created by default with privileges “rwxr-xr-x” so only root can create temp files. I will be using another user “myuser” to execute PGX client so I set “rwxrwxrwx” permission on this folder (other case following error occurs with non-root user:
java.util.concurrent.ExecutionException: java.nio.file.AccessDeniedException: /opt/oracle/oracle-spatial-graph/property_graph/pgx/tmp_data/PGX_ENGINE_6889263240413654713):

BGSG 3.0 is by default configured not to allow loading file from local file-system. In our test, we will be using path /opt/oracle/oracle-spatial-graph/data to create graph files and load them to database. To allow loading files from this folder, I set following parameters:

 /opt/oracle/oracle-spatial-graph/property_graph/pgx/conf/pgx.conf

Testing

I will create 2 basic files to test standalone PGX.

/opt/oracle/oracle-spatial-graph/data/vertices.csv

:VID(string),:LABEL,Name:string,Height:double
1,Person,Anna,5.5
2,Person,Maria,5.8
3,Person,John,6.4
4,Person,Peter,6.1
5,City,Prague,
6,City,Zurich,

/opt/oracle/oracle-spatial-graph/data/edges.csv

:EID,:SRC,:DST,:LABEL,Strength:string
101,1,2,Relationship,friends
102,2,3,Relationshaip,friends
103,1,4,Relationship,acquitance
110,1,5,LivesIn,
111,2,5,LivesIn,
112,3,6,LivesIn,
113,4,6,LivesIn,

Now, we are ready to test. Here are the steps:

cd /opt/oracle/oracle-spatial-graph/property_graph/
bin/opg
loadedGraph = session.readGraphFiles("/opt/oracle/oracle-spatial-graph/data/vertices.csv","/opt/oracle/oracle-spatial-graph/data/edges.csv","LoadedGraphName")
loadedGraph.queryPgql("SELECT * MATCH (n) -[e]- (m)").print(10).close()

Testing in Server Mode

BDSG server mode is by default configured with TLS and client authentication is enabled. We need to configure client/server certificates in order to work with these default security configuration. I will not cover this in this blog. So I will be disabling TLS and client authentication before testing server mode:

 /opt/oracle/oracle-spatial-graph/property_graph/pgx/conf/server.conf

Now, let’s start the server:

cd /opt/oracle/oracle-spatial-graph/property_graph
./pgx/bin/start-server

While server is running in this session, we can open another client session to test server side execution:

cd /opt/oracle/oracle-spatial-graph/property_graph/
bin/opg --base_url=http://localhost:7007

loadedGraph = session.readGraphFiles("/opt/oracle/oracle-spatial-graph/data/vertices.csv","/opt/oracle/oracle-spatial-graph/data/edges.csv","LoadedGraphName")
loadedGraph.queryPgql("SELECT * MATCH (n) -[e]- (m)").print(10).close()