layout: page title: “Neo4j Interpreter for Apache Zeppelin” description: “Neo4j is a native graph database, designed to store and process graphs from bottom to top.” group: interpreter

{% include JB/setup %}

Neo4j Interpreter for Apache Zeppelin

Overview

Neo4j is a native graph database, designed to store and process graphs from bottom to top.

Supported Version

The Neo4j Interpreter supports all Neo4j versions since v3 via the official Neo4j Java Driver

Neo4j - Interpreter - Video

Configuration

Enabling the Neo4j Interpreter

In a notebook, to enable the Neo4j interpreter, click the Gear icon and select Neo4j.

Using the Neo4j Interpreter

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.

Write your Cypher queries and navigate your graph

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_ Neo4j - Graph - Result

Apply Zeppelin Dynamic Forms

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: Neo4j - Zeppelin - Dynamic Forms