3

In using the Neo4j client for .NET I have not been able to find a way to capture labels belonging to a specific node.

I can observe that this data is available by capturing network traffic, but I cannot find any way to retrieve this data using the API. The same applies to retrieving the node IDs - I can observe those on the wire, but not in code.

Is this not yet implemented?

Tim Ferrell
  • 1,348
  • 3
  • 17
  • 40

1 Answers1

4

You should not be dealing with node ids. They are deprecated, and will go away more and more.

To retrieve the labels, copying straight from https://github.com/Readify/Neo4jClient/wiki/cypher-examples, this Cypher:

MATCH (user:User)
WHERE user.Id = 1234
RETURN labels(user)

Is this C#:

graphClient.Cypher
    .Match("(user:User)")
    .Where((User user) => user.Id == 1234)
    .Return(user => user.Labels())
    .Results
Tatham Oddie
  • 4,290
  • 19
  • 31
  • In the network request for a query, if I return the node directly, it comes back with a metadata property with the nodeId (I know you said that is deprecated now), but also the "labels" array. It looks like that labels property is not getting deserialized into Node, as well as the other relationship properties with URIs, is there a reason those properties aren't being deserialized into C# properties on Node? – Sam Mar 14 '16 at 02:30