Network Graph With Neo4j

Convicted child molester Jeffrey Epstein’s relationships are many and complex.  A network graph can present the information in a clear and succinct way that no amount of words ever could.  This post will show how easy it is to produce a network graph of even the most complex web of relationships using  Neo4j.

But first a tiny example of a Neo4j network graph. The creators of Neo4j probably never thought someone would take all of their hard work to map out travel plans but Neo4j is so easy to use and renders such clear information that one finds oneself using it to graph all sorts of things.

Here is how I looked at my travel itinerary before:

 

DateWhoDepartureDestination
Sept 1Nina & JoeNYCAmsterdam
Nina & JoeAmsterdamGenoa
Dylan & DanielAmsterdamGenoa
Sept 8Nina & JoeGenoaNYC
Dylan & DanielGenoaAmsterdam

 

This is what we are accustomed to.  But we are not really so much reading it as we are interpreting it.  How much clearer the Neo4j network graph is.

It would be a small thing to add flight numbers and hotels.  The code is this simple:

Create

(amsterdam:Netherlands{name: “Amsterdam”}),

(amsterdam_netherlands:Netherlands{name: “Ams Neth”}),

(genoa_itlay:Italy{name:”Genoa Italy”}),

(genoa:Italy{name:”Genoa”}),

(nice_france:France{name:”Nice, France”}),

(nyc:US{name:’NYC’});

 

This chunk CREATES the cities.

The word(s) before the full colon are the unique names of the node.

After the colon comes the category.

Inside the brackets come the features.  Here we only have a single feature Name , but more could be easily added.

Here is the chunk to create the people:

Create

(nina_joe:US{name:”Nina & Joe”}),

(joe_nina:US{name:”Joe & Nina”}),

(dylan_daniel:Amsterdam{name:”Dylan & Daniel”}),

(Four_of_us:All{name:”All of Us”});

//(the_four_of_us:All{name:”The Four of Us”});

//(daniel_dylan:Amsterdam{name:”Daniel & Dylan”});

 

Here are the  lines connecting  the nodes :

Match(s:US{name:’Nina & Joe’}),(d:Netherlands{name:’Ams Neth’}) CREATE (s)-[r:Fly_To] ->(d)

Match(s:All{name:’All of Us’}),(d:Italy{name:’Genoa Italy’}) CREATE (s)-[r:Fly_To] ->(d)

Match(s:Italy{name:’Genoa Italy’}),(d:France{name:’Nice, France’}) CREATE (s)-[r:Drive_to] ->(d)

Match(s:France{name:’Nice, France’}),(d:Italy{name:’Genoa’}) CREATE (s)-[r:Drive_to] ->(d)

Match(s:US{name:’Joe & Nina’}),(d:US{name:’NYC’}) CREATE (s)-[r:Fly_To] ->(d)

Match(s:Amsterdam{name:’Dylan & Daniel’}),(d:Netherlands{name:’Amsterdam’}) CREATE (s)-[r:Fly_To] ->(d)

We will deconstruct this last match statement

( First half)

Match(s:Amsterdam{name:’Dylan & Daniel‘}),(d:Netherlands{name:’Amsterdam’}) 

(Second half)

CREATE (s)-[r:Fly_To] ->(d)

Each connecting statement has two parts . 

The Match where we state what is to be connected  and the CREATE statement where we say ‘Now go find those nodes and show this  connection.

 

The Match statement begins with labeling the the two parts  s or d.

Then comes the category , next is the unique name.

The CREATE statement draws upon the s and d labels that were just applied , asks  one to describe the connection between the nodes ,Fly_To , in this case.

 

But of course Neo4j can do more interesting graphs as well.

This one depicts child molester Jeffrey Epstein’s legal and political relationships.

 

Why Neo4j is great is that one does not need to develop an entire database with every character and every relationship in advance.  In a developing story like Epstein’s where each day brings some sordid revelation one does not need to start over, instead just CREATE a new node and/or create  a new Match statement.