{% include JB/setup %}
Neo4j is a native graph database, designed to store and process graphs from bottom to top.
The Neo4j Interpreter supports all Neo4j versions since v3 via the official Neo4j Java Driver
In a notebook, to enable the Neo4j interpreter, click the Gear icon and select Neo4j.
In a paragraph, use %neo4j
to select the Neo4j interpreter and then input the Cypher commands. For list of Cypher commands please refer to the official Cyper Refcard
%neo4j //Sample the TrumpWorld dataset WITH 'https://docs.google.com/spreadsheets/u/1/d/1Z5Vo5pbvxKJ5XpfALZXvCzW26Cl4we3OaN73K9Ae5Ss/export?format=csv&gid=1996904412' AS url LOAD CSV WITH HEADERS FROM url AS row RETURN row.`Entity A`, row.`Entity A Type`, row.`Entity B`, row.`Entity B Type`, row.Connection, row.`Source(s)` LIMIT 10
The Neo4j interpreter leverages the Network display system allowing to visualize the them directly from the paragraph.
This query:
%neo4j MATCH (vp:Person {name:"VLADIMIR PUTIN"}), (dt:Person {name:"DONALD J. TRUMP"}) MATCH path = allShortestPaths( (vp)-[*]-(dt) ) RETURN path
produces the following result_
You can leverage Zeppelin Dynamic Form inside your queries. This query:
%neo4j MATCH (o:Organization)-[r]-() RETURN o.name, count(*), collect(distinct type(r)) AS types ORDER BY count(*) DESC LIMIT ${Show top=10}
produces the following result: