neo4j - Cypher Query fail while defining the relationship count -


neo4j version: 3.0.4

objective of below query eliminate duplicate bus service , bustop in path, work fine if didn't provide relationship count -[r:connectswith]-> if relationship count defined -[r:connectswith*..3]-> ,then throwing

key not found: r

working:

optional match p=(o:port{name:"busstop1"})-[r:connectswith]->(d:port{name:"busstop2"}) all(r1 in rels(p)           1 = size(filter(r2 in rels(p) (r1.service = r2.service)))) , all(n in nodes(p) 1 = size(filter(m in nodes(p) id(m) = id(n)))) return p limit 10 

not working:

optional match p=(o:port{name:"busstop1"})-[r:connectswith*..3]->(d:port{name:"busstop2"}) all(r1 in rels(p)           1 = size(filter(r2 in rels(p) (r1.service = r2.service)))) , all(n in nodes(p) 1 = size(filter(m in nodes(p) id(m) = id(n)))) return p limit 10 

work around solution:

optional match p=(o:port{name:"busstop1"})-[r:connectswith*..3]->(d:port{name:"busstop2"}) all(r1 in rels(p)           1 = size(filter(r2 in rels(p) (r1.service = r2.service)))) =       all(n in nodes(p) 1 = size(filter(m in nodes(p) id(m) = id(n)))) , all(r1 in rels(p)         1 = size(filter(r2 in rels(p) (r1.service = r2.service)))) return p limit 10 

aside: feels neo4j bug. if encountering latest neo4j version, may want submit neo4j issue.

as possible workaround, since query not use r identifier, try removing query.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -