Skip to content

Experimenttal project using rdf and graph dbs to tracker changes to organizational hierarchies overtime

Notifications You must be signed in to change notification settings

brownjasonj/organizational-change-tracker

Repository files navigation

Overview

The objective of this project is to explore the use of knowledge graph for tracking the evolution (over time) of corporations internal organizational structure. It leverages open standards such as RDF (turtle dialect) and SPARQL for the data representation and querying, existing ontologies for the semantic encoding and typescript/javascript popular libraries (e.g., n3) for manipulating the semantic triples.

Trying to stick to standards as much as possible is a key tenat of the project. I have been experimenting with Neo4j, Blazegraph and OntoText GraphDB.

GraphDB (OnToText)

So far this has been the most standard version of an RDF triple store that I have experimented with.

Blazegraph

Download the latest version of blazegraph here. There are are several command line arguments, port setting is perhaps one you might need:

java -server -Xmx64g -jar blazegraph.jar java -server -Xmx64g -Djetty.port=19999 -jar blazegraph.jar

Blazegraph doesn't appear to support xsd:dateTimeStamp which is the replacement for xsd:dateTime (which is being depricated). The RDF mapper in this project is using the latter in order that it will work on both blazegraph and Ontotext GraphDB.

AWS Neptune

AWS are offering a blazegraph serverless solution called Neptune. I haven't yet tried this, but am eager to see if the aforementioned problems i'm having with Blazegraph have been solved. I assume so, but need to check.

Once I get around to it I'll push terraform code to create Neptune store so that you can run the same example against that triple store.

NEO4J

We have experimented extensively with Neo4j which is popular, however have found that the neosemantic module isn't mature enough, particularly in the handling of namespaces. Furthetmore, there is no current support for SPARQL as the company has it's own query language (Cypher). However, this project does containt examples of Cypher, but it is more complex than using SPARQL queries (compare the sample-cypher.cql and sample sample-sparql.rq files to see what we mean).

Graph DB Installations

You can find all necessary instructions on installing the various triple stores, but just in case here is a simple index into them.

OnToText GraphDB

Go to OnToText for the desktop version of their triple store. Unfortuantely you'll have to leave you details and email address to get the download, but after that it is free to use for your experiments.

Blazegraph Setup

For set up got to Blazegraph Quickstart.

NEO4J Setup

  1. Install Neo4j Desktop (Neo4j Installation)

  2. Start Neo4j

  3. Install the Neosemantics (n10s) plug-in. a. from the Neo4j application click on 'Open' next to you database. this will open a browser. b. on the right you should see 3 tabs: Details, Plugins, Upgrade c. Click on Plugins tab. You should see a list of plugins, one of which is the neosemantics plugin d. click install. probably this restarts your database

  4. open the neo4j browser again and you should see a prompt where you can run db commands

  5. Initialize the neosemantic plugin by running the folloing command:

    call n10s.graphconfig.init(); CREATE CONSTRAINT n10s_unique_uri ON (r:Resource) ASSERT r.uri IS UNIQUE;
  6. Loaded a turtle example file from the 'rdf-examples' directory as follows:

    CALL n10s.rdf.import.fetch("file:{path to project}/rdf-examples/simple.ttl","Turtle");
  7. Display the graph by running the following:

    match (n) return n;

Namespaces in Neo4j You need to added the namespaces that you will be using otherwise neo4j will just prefix ids with ns{n} for each new namespace which makes it harder to find items. To add a namespace you need to use the command:

CALL n10s.nsprefixes.add("neo", "http://neo4j.org/vocab/sw#"); CALL n10s.nsprefixes.add(":", "http://example.org/id#"); CALL n10s.nsprefixes.add("foaf:", "http://xmlns.com/foaf/0.1#"); CALL n10s.nsprefixes.add("org:", "http://www.w3.org/ns/org#"); CALL n10s.nsprefixes.add("time:", "http://www.w3.org/2006/time#"); CALL n10s.nsprefixes.add("pid:", "http://example.org/pid#"); call n10s.graphconfig.set( { handleRDFTypes: "LABELS_AND_NODES", handleMultival: "OVERWRITE", handleVocabUris: "KEEP" });

and to list which namespaces neo4j has, run this:

call n10s.nsprefixes.list();

This project was initally created with the basic set up for a typescript node project using the instructions from (https://khalilstemmler.com/blogs/typescript/node-starter-project/)

HTTPS Certificate Set-up

To enable support for HTTPS you'll need to set up server certificates and then point to them from the index.ts file. openssl genrsa -out key.pem openssl req -new -key key.pem -out csr.pem openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem

About

Experimenttal project using rdf and graph dbs to tracker changes to organizational hierarchies overtime

Resources

Stars

Watchers

Forks

Packages

No packages published