Neo4j Commmunity edition 4.3.3, Ubuntu 20.04
I have a question: in my head, the following queries should returns the same value, but they don't:
CALL {
MATCH (recipe:Recipe {uuid: "ee35d995-bcac-46f9-aeda-2bffc7a29dfa"})<-[:CAN_BE_SUGGESTED_FOR]-(mention:Mention)
RETURN mention, recipe
UNION
MATCH (recipe:Recipe {uuid: "ee35d995-bcac-46f9-aeda-2bffc7a29dfa"})-[:HAS_TRADITIONAL_WINE]->(mention:Mention)
RETURN mention, recipe
}
WITH recipe, mention
RETURN recipe, mention
CALL {
MATCH (recipe:Recipe {uuid: "ee35d995-bcac-46f9-aeda-2bffc7a29dfa"})<-[:CAN_BE_SUGGESTED_FOR]-(mention:Mention)
RETURN mention, recipe
UNION
MATCH (recipe)-[:HAS_TRADITIONAL_WINE]->(mention:Mention)
RETURN mention, recipe
}
WITH recipe, mention
RETURN recipe, mention
The only difference is that in the second query I removed the explicit uuid
because I want to reuse the previously matched recipe
. But the first query returns 94 mention
, while the 2nd returns 96.
It looks like the second query attach any recipe with -[d:HAS_TRADITIONAL_WINE]->(mention:Mention)
while I expected it to reuse the exact recipe
node from the previous MATCH
.
Where is my fault? Can anyone help to understand the problem?