Expecting to see relationship
Frank L
https://github.com/LinkedInLearning/learning-neo4j-2483130
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