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.

Where's the issue?

Hello,
Can someone point the issue in below queries? the only change is the addition of named "n" node....

Regards,
Gabriel

1 ACCEPTED SOLUTION

Be aware that if you use a label you always have to prefix it with a :.
In your 2nd query you're using ...(StyledElement)-[:StyledElement]-(StyledElement).... This does not refer to two nodes, each carrying StyledElement label. Instead it's referring to a node given the alias StyledElement - thus the start and end node needs to be the very same node. This is only true if your graph has self-relationships - I guess that's not the case.

Another tip: always use directions > or < when specifying relationships.

View solution in original post

3 REPLIES 3

Be aware that if you use a label you always have to prefix it with a :.
In your 2nd query you're using ...(StyledElement)-[:StyledElement]-(StyledElement).... This does not refer to two nodes, each carrying StyledElement label. Instead it's referring to a node given the alias StyledElement - thus the start and end node needs to be the very same node. This is only true if your graph has self-relationships - I guess that's not the case.

Another tip: always use directions > or < when specifying relationships.

You're totally right...thanks!
I just can't believe how rusty I've became after two months of not using Cypher...

That's why we have the community portal 😉