Finding labels for a given path


#1

Hello,

I’m New to Cayley. I’m having trouble retrieving labels from a given path, and am unable to APIs that allows me to do quick retrievals
i.e., g.V('node1").Label().All()

Any directions would be greatly appreciated!

Thanks


#2

Hi @Flavian5,

Sorry for a long wait.

Do you mean the label in a quad (the forth quad value)? If so, I’m afraid this function is not exposed via Gizmo API yet, but it’s available if you use Cayley as a library from Go.


#3

Hello @Flavian5,

Actually, this was recently added, but the documentation seems not to have been updated. You can look at the test for the behavior here: https://github.com/cayleygraph/cayley/blob/master/query/gizmo/gizmo_test.go#L406.

Given your example, it would be:

g.V("node1").Labels().All()

#4

Thank you so much!

Since I am unable to use more recent versions of Cayley for my project right now, my work around is to generate new quads based on the subject-object edges as the subject and label as object.