neo4j - Nodes with same relation to a third node in a graph database -
I was following the Neo4J online tutorial and I came to a question while trying this question with the query query :
Match (A: person) - [: ACTED_IN |: guided] - & gt; () & Lt; - [: ACTED_IN |: guided] - (b: person) back a, b; I was hoping to return the same person to both identifiers, but it was not so. Can anyone explain me? Does a match segment differentiate repetitious elements in different identifiers?
Update: This question came on "3 - Linking Relationships with Cypher", from the Neo4J online tutorial, where I presented the query mentioned above. I have made the following question better, so that I can focus my question more directly:
MATCH (A: person {name: "canu reeves"}) - [: ACTED_IN] - & gt; ; () And lieutenant; - [: ACTED_IN] - (B) Returns A, B; Result:
| --------------- | --------- ----------- | | One | B | --------------- | -------------------- | | Kenu Reeves | Carrie-Anne Moss | | Kenu Reeves | Lawrence Fishburn | | Kenu Reeves | Hugo Bunning | | Kenu Reeves | Brooke Langton | | Kenu Reeves | Gene Hackman | | Kenu Reeves | Orlando Jones | | ------------------------------------ | So, why there is no line with Keanu Reeves in another b? Should not both of them be reconciled: ACTED_IN?
The behavior you have viewed has been done by the design.
To bid:
When matching patterns, the cipher ensures that those matches should not be included where the same graph relationships multiply in the same pattern See you. In most use cases, this is a sensible thing.
Comments
Post a Comment