cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Results discrepancies!

I am having difficulty making sense of an issue with a graph.
here is the issue:
traversing a path from A to Z yields a count of zero but traversing the path from A to B gives a result of 1 and from B to Z gives the result of one. How is that even possible? Is this a bug with the graph or a code issue?
This only happens for certain nodes, and the issue is not seen for most of them.
here are the codes:
I used multiple procedures, and the result is the same.

match (n:Concept{cui:"Cxxxxxxx"}), (m:Concept{cui:"Cyyyyyyyy"})
with n,m
match path=(n)-[r:causes_f3plus*1..5]->(m)
WHERE all (a in relationships(path) where a.freq>4)
return count(DISTINCT(path))

match (n:invt{cui:"Cxxxxxxx"}), (m:dsyn{cui:"Cyyyyyyy"})
Using Index n:invt(cui)
Using index m:dsyn(cui)
with n, collect(m) as terminatorNodes
CALL apoc.path.expandConfig(n, {
relationshipFilter:"
causes_f3plus>",
minLevel: 1,
maxLevel: 5,
terminatorNodes:terminatorNodes,
uniqueness: "NODE_PATH"
})
yield path
return count(path), length(path)

2 REPLIES 2

match (n:invt{cui:"Cxxxxxxx"}), (m:dsyn{cui:"Cyyyyyyy"})
Using Index n:invt(cui)
Using index m:dsyn(cui)
with n, collect(m) as terminatorNodes
CALL apoc.path.expandConfig(n, {
relationshipFilter:"
causes_f3plus>",
minLevel: 1,
maxLevel: 5,
terminatorNodes:terminatorNodes,
uniqueness: "NODE_PATH"
})
yield path
return count(path), length(path)

match (n:Concept{cui:"Cxxxxxxx"}), (m:Concept{cui:"Cyyyyyyyy"})
with n,m
match path=(n)-[r:causes_f3plus*1..5]->(m)
return count(DISTINCT(path))

//The where clause was a error in the previous comment but the issue still stands.

Hello,

You need to provide more context here. We don't know which of the two queries you provided is giving the "wrong" results, and you've only showed us two approaches connecting two nodes (I'm assuming your A to Z in your example), you haven't shown us the queries showing A to B and B to Z. Please add more context to what you've provided, especially the results associated with each query.