cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Schema visualization different from initialized graph structure

JaHo
Node Clone

Hello everyone,

I have a graph which includes a hierarchy of nuts regions, among others.
This is the cypher which was used to create the hierarchical relationships between the different levels of regions:

MATCH (n3:Nuts3)
MATCH (n2:Nuts2 {code: left(n3.code, 4)})
MERGE (n3)-[:PART_OF]->(n2);

MATCH (n2:Nuts2)
MATCH (n1:Nuts1 {code: left(n2.code, 3)})
MERGE (n2)-[:PART_OF]->(n1);

MATCH (n1:Nuts1)
MATCH (c:Country {code: left(n1.code, 2)})
MERGE (n1)-[:PART_OF]->(c);

So basically, every NUTS 3 region (the lowest level) is a part of a NUTS 2 region which is in turn part of a NUTS 1 region.
However, when I CALL db.schema.visualization, I get the following:

2X_f_f993c2e0cc85a38a284b883d674e0a070f6ab308.png

Can someone explain to me where the self-ties and the reciprocal ties between Nuts1 and Nuts2 come from? Is the creation of the ties a bad way to do it? Or did I misunderstand something about the schema visualization?

Best
Jakob

1 ACCEPTED SOLUTION

Agree, the output doesn't look correct.
Try this and compare

call apoc.meta.graph()

View solution in original post

4 REPLIES 4

Agree, the output doesn't look correct.
Try this and compare

call apoc.meta.graph()

Thanks, That does indeed give the correct graph. Any idea why the Schema visualization doesn’t?

a bug... I suspect.

I see, I might open an issue then. Thanks again