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/edgeMATCH (a) RETURN ID(a)
LABEL()/LABELS()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);
Last updated on