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

Function Graph_IsNodeLabeled

src/graph/graph.c:745–760  ·  view source on GitHub ↗

return true if node is labeled as 'l'

Source from the content-addressed store, hash-verified

743
744// return true if node is labeled as 'l'
745bool Graph_IsNodeLabeled
746(
747 Graph *g, // graph to operate on
748 NodeID id, // node ID to inspect
749 LabelID l // label to check for
750) {
751 ASSERT(g != NULL);
752 ASSERT(id != INVALID_ENTITY_ID);
753
754 bool x;
755 // consult with labels matrix
756 RG_Matrix nl = Graph_GetNodeLabelMatrix(g);
757 GrB_Info info = RG_Matrix_extractElement_BOOL(&x, nl, id, l);
758 ASSERT(info == GrB_SUCCESS || info == GrB_NO_VALUE);
759 return info == GrB_SUCCESS;
760}
761
762// dissociates each label in 'lbls' from given node
763void Graph_RemoveNodeLabels

Callers 1

UpdateNodeLabelsFunction · 0.85

Calls 2

Graph_GetNodeLabelMatrixFunction · 0.85

Tested by

no test coverage detected