Graph Pattern Function
In addition to the various relational data-based function operations introduced earlier, NeuG also specifically supports a set of functions for operating on node, edge, and path data generated by graph patterns.
Node Function
| Function | Description | Example |
|---|---|---|
| ID() | Get the Internal ID of a node/edge | MATCH (a) RETURN ID(a) |
| LABEL()/LABELS() | Get the label of a node/edge | MATCH (a) RETURN LABEL(a) |
Edge Function
In addition to ID and LABEL functions, there are the following edge-based function operations:
| Function | Description | Example |
|---|---|---|
| START_NODE() | Returns the starting node of edge data | MATCH ()-[b]->() RETURN START_NODE(b); |
| END_NODE() | Returns the ending node of edge data | MATCH ()-[b]->() RETURN END_NODE(b); |
Repeated Path Function
| Function | Description | Example |
|---|---|---|
| NODES | Returns all nodes from a path | MATCH (a)-[b*2..3]->() RETURN NODES(b); |
| RELS | Returns all edges from a path | MATCH (a)-[b*2..3]->() RETURN RELS(b); |
| PROPERTIES | Returns given property from nodes/edges | MATCH (a)-[b*2..3]->() RETURN PROPERTIES(nodes(b), ‘name’), PROPERTIES(rels(b), ‘weight’); |
| IS_TRAIL | Checks if path contains repeated edges (true if no) | MATCH (a)-[b*2..3]->() RETURN IS_TRAIL(b); |
| IS_ACYCLIC | Checks if path contains repeated nodes (true if no) | MATCH (a)-[b*2..3]->() RETURN IS_ACYCLIC(b); |
| LENGTH | Returns the length of a path | MATCH (a)-[b*2..3]->() RETURN LENGTH(b); |
Last updated on