MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _QueryGraphAddNode

Function _QueryGraphAddNode

src/graph/query_graph.c:37–55  ·  view source on GitHub ↗

adds node to query graph

Source from the content-addressed store, hash-verified

35
36// adds node to query graph
37static void _QueryGraphAddNode
38(
39 QueryGraph *qg,
40 const cypher_astnode_t *ast_entity
41) {
42 const char *alias = AST_ToString(ast_entity);
43
44 // look up this alias in the QueryGraph
45 // this node may already exist
46 // if it appears multiple times in query patterns
47 QGNode *n = QueryGraph_GetNodeByAlias(qg, alias);
48 if(n == NULL) {
49 // node has not been mapped; create it
50 n = QGNode_New(alias);
51 QueryGraph_AddNode(qg, n);
52 }
53
54 _QueryGraphSetNodeLabel(n, ast_entity);
55}
56
57// adds edge to query graph
58static void _QueryGraphAddEdge

Callers 2

_QueryGraph_ExtractNodeFunction · 0.85
QueryGraph_AddPathFunction · 0.85

Calls 5

AST_ToStringFunction · 0.85
QGNode_NewFunction · 0.85
QueryGraph_AddNodeFunction · 0.85
_QueryGraphSetNodeLabelFunction · 0.85

Tested by

no test coverage detected