sets node label and label ID
| 13 | |
| 14 | // sets node label and label ID |
| 15 | static void _QueryGraphSetNodeLabel |
| 16 | ( |
| 17 | QGNode *n, |
| 18 | const cypher_astnode_t *ast_entity |
| 19 | ) { |
| 20 | GraphContext *gc = QueryCtx_GetGraphCtx(); |
| 21 | |
| 22 | // retrieve node labels from the AST entity |
| 23 | uint nlabels = cypher_ast_node_pattern_nlabels(ast_entity); |
| 24 | |
| 25 | for(uint i = 0; i < nlabels; i++) { |
| 26 | const char *l = cypher_ast_label_get_name( |
| 27 | cypher_ast_node_pattern_get_label(ast_entity, i)); |
| 28 | |
| 29 | // if a schema is found, the AST refers to an existing label |
| 30 | Schema *s = GraphContext_GetSchema(gc, l, SCHEMA_NODE); |
| 31 | int l_id = (s) ? Schema_GetID(s) : GRAPH_UNKNOWN_LABEL; |
| 32 | QGNode_AddLabel(n, l, l_id); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // adds node to query graph |
| 37 | static void _QueryGraphAddNode |
no test coverage detected