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 | Return (a) Return ID(a) |
| LABEL() | 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); |