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

Function QueryGraph_ExtractPaths

src/graph/query_graph.c:317–338  ·  view source on GitHub ↗

clones path from 'qg' into 'graph'

Source from the content-addressed store, hash-verified

315
316// clones path from 'qg' into 'graph'
317QueryGraph *QueryGraph_ExtractPaths
318(
319 const QueryGraph *qg,
320 const cypher_astnode_t **paths,
321 uint n
322) {
323 // validate input
324 ASSERT(qg != NULL && paths != NULL);
325
326 // create an empty query graph
327 uint node_count = QueryGraph_NodeCount(qg);
328 uint edge_count = QueryGraph_EdgeCount(qg);
329 QueryGraph *graph = QueryGraph_New(node_count, edge_count);
330 ASSERT(graph != NULL);
331
332 for(int i = 0; i < n; i++) {
333 const cypher_astnode_t *path = paths[i];
334 _QueryGraph_ExtractPath(qg, graph, path);
335 }
336
337 return graph;
338}
339
340// clones patterns from 'qg' into 'graph'
341QueryGraph *QueryGraph_ExtractPatterns

Callers 1

AST_PreparePathCreationFunction · 0.85

Calls 4

QueryGraph_NodeCountFunction · 0.85
QueryGraph_EdgeCountFunction · 0.85
QueryGraph_NewFunction · 0.85
_QueryGraph_ExtractPathFunction · 0.85

Tested by

no test coverage detected