Using the apoc.graph.fromDocument procedure

The apoc.graph.* are a set of procedures that allow transforming custom data formats into Graphs. The last procedure that we created is apoc.graph.fromDocument that allows creating graphs from maps, JSON objects and JSON strings. In this article, we’ll talk about, why you should use it and what are the benefits of using this procedure while you’re dealing with JSON-like formats.

From JSON to Graph?

A JSON is basically a tree-graph

Image for post
Image for post

So the following JSON:

Can be turned into a graph like…


Leveraging Neo4j Streams — Part 3

This article is the third part of the Leveraging Neo4j Streams series (Part 1 is here, Part 2 is here). In it, I’ll show you how to bring Neo4j into your Apache Kafka flow by using the streams procedures available with Neo4j Streams.

In order to show how to integrate them, simplify the integration, and let you test the whole project by hand, I’ll use Apache Zeppelin, a notebook runner that simply allows you to natively interact with Neo4j.

What is a Neo4j Stored Procedure?

Starting from Neo4j 3.x, the concept of user-defined procedures and functions was introduced. …


Image for post
Image for post

Fast Export/Import Operations with apoc.export.cypher and cypher-shell

The idea is to allow a user to export all data, an subgraph, the result of a query or a collections of paths into to an importable cypher-script, which you could import again by piping it to cypher-shell on the command-line. Very similar to using SQL based import scripts.

Please note that for maximum performance you need to use cypher-shell version 1.1.9 or later, which got client-side parameter parsing, instead of sending the parameter to the server to be evaluated. …


This article is the second part of the Leveraging Neo4j Streams series (Part 1 is here). I’ll show how to bring Neo4j into your Apache Kafka flow by using the Sink module of the Neo4j Streams project in combination with Apache Spark’s Structured Streaming Apis.

Image for post
Image for post
Photo by Hendrik Cornelissen on Unsplash

In order to show how to integrate them, simplify the integration, and let you test the whole project yourself, I’ll use Apache Zeppelin — a notebook runner that simply allows you to natively interact with Neo4j.


Image for post
Image for post
Photo by Vanessa Ochotorena on Unsplash

In this article, we’ll show how to create a Just-In-Time Data Warehouse by using Neo4j and the Neo4j Streams module with Apache Spark’s Structured Streaming Apis and Apache Kafka.

In order to show how to integrate them, simplify the integration, and let you test the whole project by hand, I’ll use Apache Zeppelin a notebook runner that simply allows to natively interact with Neo4j.


Adding Network Support to Zeppelin

Interactive notebooks are very popular today. Whether you use them in data engineering (data processing) or for data science projects (data analytics/ML) they are a “de facto” standard, and are replacing slideshow presentations in many organizations. Besides Jupyter Notebooks, Apache Zeppelin is also widely used, especially because it integrates well with Apache Spark and other Big Data systems.

Starting from my experiences of using Zeppelin and Neo4j in different contexts I developed the Zeppelin Interpreter that connects to Neo4j in order to query and display the graph data directly in the notebook (both in graph and tabular formats). This interpreter is now part of Zepplin 0.8


(Neo4j)-[:LOVES]-(Zeppelin)

“A web-based notebook that enables interactive data analytics.
You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and
more.”
(taken from Apache Zeppelin official website)

Image for post
Image for post
The result of the experiment

I felt in love with Apache Zeppelin for it’s native support for Apache Spark, it allows to create powerful (big) data analytics dashboard really fast.
After some weeks spent using it with Apache Spark that “more” intrigued me, so i have tried to integrate Zeppelin with Neo4j, a graph database that i have used in an epidemiology related project.

The full notebook of this experiment is here:

To achive my goal i have used only pure javascript language directly on Zeppeling Notebook, using just one (at most two)…

About

Andrea Santurbano

CTO @AgileLARUS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store