I am learning Neo4J, and while reading the book "Graph Databases" by O'Reilly, I came across a graph pattern which describes three friends, represented as nodes and the relationship direction between them signifying who is whose friend.
From the diagram, I can understand that - b knows a, c knows a and c knows b
But the Cypher query pattern isn't clear to me -
(a)-[:KNOWS]->(b)-[:KNOWS]->(c), (a)-[:KNOWS]->(c)
On the next section, where they describe the syntax, they mention -
Using ASCII characters to represent nodes and relationships, we draw the data we're interested in. We use parantheses to draw nodes, and pairs of dashes and greater-than and less-than sign to draw relationships(- -> and <- -). The < and > signs indicate relationship direction.
If this is the case, (a)-[:KNOWS]->(b)-[:KNOWS]->(c)
signifies that a KNOWS b
and b KNOWS c
, and (a)-[:KNOWS]->(c)
signifies that a KNOWS c
. Isn't this the opposite of what the arrows in the diagram depict?