Using the relationships syntax
In Cypher, a relationship can be represented using -->
, which resembles an arrow on a diagram. Here are some example usages in Cypher:
(p)-[:LIVES_AT]->(a)
– This represents that the node identified byp
is connected to another node, a, with aLIVES_AT
relationship type. The direction of the relationship is fromp
toa
.(p)-[r]->(a)
– This represents that the node identified byp
is connected to another node, a, with the direction of the relationship going fromp
toa
. They can be connected via any relationship type. The relationship is assigned to ther
variable/alias.(p)<-[r]-(a)
– This represents that the node identified byp
is connected to another node, a, with the direction of the relationship going froma
top
. The nodes can be connected via any relationship type and the relationship is assigned to ther
variable/alias.(p)-[r]-(a)
– This represents that the node identified byp
is connected...