clones path from 'qg' into 'graph'
| 315 | |
| 316 | // clones path from 'qg' into 'graph' |
| 317 | QueryGraph *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' |
| 341 | QueryGraph *QueryGraph_ExtractPatterns |
no test coverage detected