Context
Given a certain KG with the following structure
<distanceTo:1> <weight> 3 .
<distanceTo:1> <weight> 4 .
<a> <distance_with_weight> <distanceTo:1> .
<distanceTo:1> <goes_to> <b> .
<b> <distance_with_weight> <distanceTo:2> .
<distanceTo:2> <goes_to> <c> .
I'd say that there is a path between a and c with a weight of 3 + 4 = 7.
Question
Is there a way to calculate weighted shortest path using SPARQL or SPARQL-BI?
I know there's the TRANSITIVE and T_SHORTEST clauses, but as far as I understand they only work with simple edges (with no weights).
I understand that I can enumerate all the paths and take the minimum sum of weights, but that'd be undesirable since, in this context, the SSSP Dijkstra algorithm could be way faster.
What I have so far
SELECT ?t, total_weight
WHERE {
<a> <distance_with_weight>/<goes_to>* ?t.
# here I need the sum of the weights involved so that I can get the minimum later.
}