Where's the issue?

cypher

(Gabriel Toma) #1

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

Regards,
Gabriel


(Stefan Armbruster) #2

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.


(Gabriel Toma) #3

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


(Stefan Armbruster) #4

That's why we have the community portal ;-)