Example Graph
The following examples run against this graph:

cardinality()
Returns the cardinality of a path, a list, or a record.
| Syntax | cardinality(<expr>) |
||
| Arguments | Name | Type | Description |
<expr> |
PATH, LIST, RECORD |
The input expression | |
| Return Type | UINT |
||
MATCH p = ()->{1,3}()
RETURN p, cardinality(p)
Result:
| p | cardinality(p) |
|---|---|
![]() |
5 |
![]() |
3 |
![]() |
3 |
LET myList = [1, 2, null, 3]
RETURN cardinality(myList)
Result:
| cardinality(myList) |
|---|
| 4 |
LET rec = RECORD{no: 1, value: "tennis"}
RETURN cardinality(rec)
Result:
| cardinality(rec) |
|---|
| 2 |
cast()
Specifies a data conversion.
| Syntax | cast(<value> AS <type>) |
||
| Arguments | Name | Type | Description |
<value> |
/ | Value expression | |
<type> |
/ | A material value type | |
| Return Type | As specified by <type> |
||
RETURN cast(1 AS String)
Result:
| cast(1 AS String) |
|---|
| 1 |
element_id()
Gets the unique identifier _uuid of a graph element.
| Syntax | element_id(<elemVar>) |
||
| Arguments | Name | Type | Description |
<elemVar> |
NODE, EDGE |
Element variable reference | |
| Return Type | UINT64 |
||
MATCH (n)-[e]->()
RETURN element_id(n), element_id(e)
Result:
| element_id(n) | element_id(e) |
|---|---|
| 8718971077612535810 | 1 |
| 8791028671650463745 | 2 |
labels()
Gets the label of a graph element.
| Syntax | labels(<elemVar>) |
||
| Arguments | Name | Type | Description |
<elemVar> |
NODE, EDGE |
Element variable reference | |
| Return Type | STRING |
||
MATCH (n)-[e]->()
RETURN labels(n), labels(e)
Result:
| labels(n) | labels(e) |
|---|---|
| Paper | Cites |
| Paper | Cites |


