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

19.6k Views Asked by At

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

5

There are 5 best solutions below

0
On

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.

MATCH (n)
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.

1
On

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

2
On

You can use the metadata by running the command call db.schema().

0
On

In Neo4j v4 call db.schema() is deprecated, you can now use call db.schema.visualization()

0
On
  1. CALL db.schema.visualization()
    works but I couldnt find a way to get the properties of nodes or relationships.

  2. CALL apoc.meta.schema()
    gives everything - nodes, relationships, their properties(with their types, etc) in tabular/json form. You need to install plugin APOC for the database to use it, which is not that much hassle.