Where's the issue?

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


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 ;-)

1 Like