Reputation: 43
Given a RDF graph and a starting node, I want to find all paths from that starting node to a node which is a Subject of an input relationship/ predicate. The RDF graph is stored in a triple store.
Example triples:
<A, *hasRelationship1*, B>
<B, *hasRelationship2*, C>
<B, *hasRelationship3*, C>
<B, *hasRelationship4*, F>
<C, *hasRelationship5*, D>
<D, *hasRelationship6*, E>
Given input A, I want to find all paths to a node which is Subject of hasRelationship6 (in example above that node is D). Also there are two paths from A->D in this example.
Would SPARQL be the right tool to get this answer? If yes any suggestions on the SPARQL query for above use case?
Or would the suggestion be to first find the Subject for hasRelationship6 and then run a graph algorithm to find paths between A and D? If yes, any suggested graph algorithm libraries which can run on SPARQL end points/ triple stores?
For my use case runtime query (or graph traversal) performance would be important.
Thanks
Upvotes: 0
Views: 562