Skip to Content

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

FunctionDescriptionExample
ID()Get the Internal ID of a node/edgeReturn (a) Return ID(a)
LABEL()Get the label of a node/edgeMatch (a) Return LABEL(a)

Edge Function

In addition to ID and LABEL functions, there are the following edge-based function operations:

FunctionDescriptionExample
START_NODE()Returns the starting node of edge dataMatch ()-[b]->() Return START_NODE(b);
END_NODE()Returns the ending node of edge dataMatch ()-[b]->() Return END_NODE(b);

Repeated Path Function

FunctionDescriptionExample
NODESReturns all nodes from a pathMatch (a)-[b*2..3]->() Return NODES(b);
RELSReturns all edges from a pathMatch (a)-[b*2..3]->() Return RELS(b);
PROPERTIESReturns given property from nodes/edgesMatch (a)-[b*2..3]->() Return PROPERTIES(nodes(b), ‘name’), PROPERTIES(rels(b), ‘weight’);
IS_TRAILChecks if path contains repeated edges (true if no)Match (a)-[b*2..3]->() Return IS_TRAIL(b);
IS_ACYCLICChecks if path contains repeated nodes (true if no)Match (a)-[b*2..3]->() Return IS_ACYCLIC(b);
LENGTHReturns the length of a pathMatch (a)-[b*2..3]->() Return LENGTH(b);