Example Graph
The following examples run against this graph:

all_different()
Determines whether all graph elements bound to a list of element variables are pairwise different from one another.
Syntax | all_different(<elemVar_1>, <elemVar_2>,...) |
||
Arguments | Name | Type | Description |
<elemVar_N> |
NODE or EDGE |
Node or edge variable reference | |
Return Type | UINT |
MATCH (n1 {_id:"P1"})
MATCH ({_id:"P1"})-(n2)
MATCH ({_id:"P3"})-(n3)
RETURN table(n1._id, n2._id, n3._id, all_different(n1, n2, n3))
Result:
n1._id | n2._id | n3._id | all_different(n1, n2, n3) |
---|---|---|---|
P1 | P2 | P2 | 0 |
property_exists()
Determines if a referenced graph element has a property.
Syntax | property_exists(<elemVar>, <propName>) |
||
Arguments | Name | Type | Description |
<propName> |
NODE or EDGE |
Node or edge variable reference | |
<elemVar> |
STRING |
Property name | |
Return Type | UINT |
MATCH (n:Paper) LIMIT 1
RETURN PROPERTY_EXISTS(n, "name")
Result:
PROPERTY_EXISTS(n, "name") |
---|
0 |
same()
Determines whether all element variables bind to the same graph element.
Syntax | same(<elemVar_1>, <elemVar_2>,...) |
||
Arguments | Name | Type | Description |
<elemVar_N> |
NODE or EDGE |
Node or edge variable reference | |
Return Type | UINT |
MATCH ({_id:"P1"})-(n1)
MATCH ({_id:"P3"})-(n2)
RETURN table(n1._id, n2._id, same(n1, n2))
Result:
n1._id | n2._id | same(n1, n2) |
---|---|---|
P2 | P2 | 1 |