This is an extension of Get all nodes in a transitive relation
Is it possible to get all transitive nodes between two transitive nodes using SPARQL? I tried to dig it out from this site and answer-semanticweb, but it seems that it's currently not possible if the length of the path is not defined as suggested in Can JENA ARQ show property path details. But I see a ray of hope from the Joshua Taylor answer to the first question.
[Edited] I provide the picture of my data sample to show the extent of the problem:
[Edited] I wanted to find the path between :a
and :h
, which should be resulted in four results:
a -> b -> c -> d -> h
.
a -> b -> c -> e -> h
.
a -> f -> h
.
a -> g -> h
.
[Edited] Using the solution from Joshua Taylor in the comment, I got every node grouped into single result, which is the closest solution that I got for this problem so far.