I'm trying to query nodes via Cypher with a specific relationship type.
So there are two nodes A (ID 1) and B (ID 2). I'm using the Cypher Console within the Administration GUI.
If I do this: rel:1
I get a result of two relationships (IDs 10 and 11) two the same node (ID 3) (I know that is bad but that's the data). If I look into the relationships there is shown: Node 1 SimilarTo Node 3 Node 1 SimilarTo Node 3
If I try this:
START n=node(*) MATCH n-[:SimilarTo]->b WHERE n.Name='A'
I get an empty result!?
So my question is, why do I get that empty result, although there exist two relationships which have the right start node and the right end nodes?
I do not understand it.
If you have any suggestions please let me know ;)
OK I make another example..
I do following query:
START artist=node:artists('artistMbid:*')
MATCH artist-[:SimilarTo]->x-[:SimilarTo]->sim
WHERE artist.artistName! = 'Shining Fury'
RETURN artist.artistName, x.artistName, sim.artistName
And get this result (is correct):
artist.artistName x.artistName sim.artistName
"Shining Fury" "Dragonsfire" "Holy Cross"
"Shining Fury" "Dragonsfire" "Holy Cross"
"Shining Fury" "Dragonsfire" "Lorenguard"
"Shining Fury" "Dragonsfire" "Lorenguard"
"Shining Fury" "Dragonsfire" "Shining Fury"
"Shining Fury" "Dragonsfire" "Shining Fury"
If I do that:
START artist=node:artists('artistMbid:*')
MATCH artist-[:SimilarTo]->x-[:SimilarTo]->y-[:SimilarTo]->sim
WHERE artist.artistName! = 'Shining Fury'
RETURN artist.artistName, x.artistName, y.artistName, sim.artistName
I get this (incorrect):
artist.artistName x.artistName y.artistName sim.artistName
"Shining Fury" "Dragonsfire" "Holy Cross" "Dragonsfire"
"Shining Fury" "Dragonsfire" "Holy Cross" "Ruffians"
"Shining Fury" "Dragonsfire" "Holy Cross" "Dragonsfire"
"Shining Fury" "Dragonsfire" "Holy Cross" "Ruffians"
"Shining Fury" "Dragonsfire" "Lorenguard" "Holy Cross"
"Shining Fury" "Dragonsfire" "Lorenguard" "Nightqueen"
"Shining Fury" "Dragonsfire" "Lorenguard" "Dragonsfire"
"Shining Fury" "Dragonsfire" "Lorenguard" "Holy Cross"
"Shining Fury" "Dragonsfire" "Lorenguard" "Nightqueen"
"Shining Fury" "Dragonsfire" "Lorenguard" "Dragonsfire"
It is incorrect because I'm missing The artist "Shining Fury" under y.artistName, like I got it in the step before. I can't find my mistake!
Another edit..
Query 1
START artist=node:artists('artistMbid:*')
MATCH artist-[:SimilarTo]->x-[:SimilarTo]->sim
WHERE artist.artistName! = 'Shining Fury'
RETURN ID(artist), ID(x), ID(sim)
result:
ID(artist) ID(x) ID(sim)
210292 209410 228580
210292 209410 228580
210292 209410 212568
210292 209410 212568
210292 209410 210292
210292 209410 210292
Query2:
START artist=node:artists('artistMbid:*')
MATCH artist-[:SimilarTo]->x-[:SimilarTo]->y-[:SimilarTo]->sim
WHERE artist.artistName! = 'Shining Fury'
RETURN ID(artist), ID(x), ID(y), ID(sim)
result:
ID(artist) ID(x) ID(y) ID(sim)
210292 209410 228580 209410
210292 209410 228580 202357
210292 209410 228580 209410
210292 209410 228580 202357
210292 209410 212568 228580
210292 209410 212568 202279
210292 209410 212568 209410
210292 209410 212568 228580
210292 209410 212568 202279
210292 209410 212568 209410