Expecting to see relationship
Gregory King
Merged in a post:
Where are my relationships?!
ian.baker@eigen.co
I used to use a query like "MATCH (n:MyNodes) RETURN n" and I would see my nodes and the relationships between them. Now I just get the nodes... how do I show th relationships?
I've spent I long time looking for a setting somewhere (like there used to be), but I can't find anything.
Very, very frustrating!
jon.giffard@neo4j.com
Could you confirm If this is with the new UPX console?
If so, please can you try MATCH (n:MyNodes)-[r]-() RETURN * and let us know what the result is?
thank you
ian.baker@eigen.co
jon.giffard@neo4j.com
Hi Jon,
Yes, it's the new UPX console. Your suggested query works, but it seems a definite step backwards to have to add "-[r]-()" to the query! :)
Frank L
Gregory King
Frank L: Hi Frank, thanks for the question, hopefully I can help clear things up.
The query UI will only return graph elements that you explicitly name in the match pattern (and in your example return with the *). So
match (s:Student {first:'Alia'})--(c:Country) Return *
will only return the nodes s
and c
.If however you explicitly name your relationship with a variable:
match (s:Student {first:'Alia'})-[r]-(c:Country) Return *
or return the whole path
match pth=(s:Student {first:'Alia'})--(c:Country) Return *
you will see the relationship returned. If you just want to show the relationships that exist between nodes on screen at any time, you can also right click to see all relationships.
The default behaviour for Browser (for those still using Browser) is that all relationships between nodes are returned, and it is an optional setting that can be disabled. While it can be useful for new users to have nodes automatically connected for them, as you get more comfortable writing cypher, it can be really confusing to return relationships that you didn't explicitly request. We found this often led to people being advised to turn that default setting off to avoid that confusion. In Query we've instead opted to give you the option to return relationships via UI on demand, when you need them.
Hope that helps!
Frank L
Gregory King: Thanks Gregory