Home Ask Login Register

Developers Planet

Your answer is one click away!

f7n February 2016

Neo4j - is it possible to visualise a simple overview of my database?

I've got my graph database, populated with nodes, relationships, properties etc. I'd like to see an overview of how the whole database is connected, each relationship to each node, properties of a node etc.

I don't mean view each individual node, but rather something like an ERD from a relational database, something like this, with the node labels. Is this possible?

enter image description here


Martin Preusse February 2016

As far as I know, there is no straight-forward way to get a nicely pictured diagram of a neo4j database structure.

There is a pre-defined query in the neo4j browser which finds all node types and their relationships. However, it traverses the complete graph and may fail due to memory errors if you have to much data.

enter image description here

Also, there is neoprofiler. It's a tool which claims to so what you ask. I never tried and it didn't get too many updates lately. Still worth a try: https://github.com/moxious/neoprofiler

manonthemat February 2016

Even though this is not a graphical representation, this query will give you an idea on what type of nodes are connected to other nodes with what type of relationship.

OPTIONAL MATCH (n)-[r]->(x)
WITH DISTINCT {l1: labels(n), r: type(r), l2: labels(x)}
AS `first degree connection`
RETURN `first degree connection`;

You could use this query to then unwind the labels to write that next cypher query dynamically (via a scripting language and using the REST API) and then paste that query back into the neo4j browser to get an example set of the data.

But this should be good enough to get an overview of your graph. Expand from here.

Post Status

Asked in February 2016
Viewed 3,160 times
Voted 14
Answered 2 times


Leave an answer

Quote of the day: live life