1
votes

I'm doing the following cypher query in Neo4j:

START a = node(4107) 
MATCH a-[:AttractionFor]->b-[r:Brother]-c-[:AttractionFor]->d 
WHERE (r.distance? <= 25)
RETURN distinct d

This return the value of a also, which I don't need. I tried a<>d and a.name <> b.name but I get the same result. Also in webadmin it returns nothing (I'm using Everyman's PHP library for neo4j).

1
Can you explain your graph a bit more, or maybe post something on console.neo4j.org -- I'm not sure what you mean by "this returns the value of a also", because there's no a being returned. Do you mean there's a cycle?Eve Freeman
he means the query returns the value of A as well. the path cycles itself into the starting point.ulkas

1 Answers

0
votes

as far as i know, cypher will not go into an already traversed vertex. this means, that if you have stated in the match section

a-[:AttractionFor]->b-[r:Brother]-c-[:AttractionFor]->d

than the D will never be the A. do you have maybe vertices with the same names/values? could you provide us with the graph data/design?