How can I filter a Path in Go such that only quads with a Label field matching a given value are traversed?
Example:
store, err := cayley.NewMemoryGraph()
// Add some quads to the graph
store.AddQuad(quad.MakeIRI("node1", "predicate", "node2", ""))
store.AddQuad(quad.MakeIRI("node1", "predicate", "node3", "myvalue"))
store.AddQuad(quad.MakeIRI("node1", "predicate", "node4", "othervalue"))
// TODO: How do I filter to only the quad with "myvalue" here?
p := cayley.
StartPath(store, quad.IRI("node1")).
Out(quad.IRI("predicate"))
it := p.Iterate(nil)
err = it.EachValue(nil, func(value quad.Value) error {
nativeValue := quad.NativeOf(value) // this converts RDF values to normal Go types
fmt.Println(nativeValue)
return nil
})
if err != nil {
fmt.Println(err.Error())
}
}
How can I filter a Path in Go such that only quads with a Label field matching a given value are traversed?
Example:
Thanks.