hey folks, trying to join some datasets via federated queries.
when I do something like
select * where {
service<service1> {
select ?fk where { ?fk :hasId "123" }
}
service <service2> {
?subj :hasFKey ?fk.
?subj :otherProp ?prop1 .
}
}
this seems to be fast. However, adding VALUES to subquery/service1 slows it down considerably (even if i don't use the ?val var):
select * where {
service<service1> {
VALUES (?val) { ("id1") ("id2") }
select ?fk where { ?fk :hasId "123" }
}
service <service2> {
?subj :hasKey ?fk.
?subj :otherProp ?pro1 .
}
}
there's some discussion on SO about the engine pulling back all the values locally for the join. I couldn't see if there was a way to bypass this in rdf4j (e.g. passing the variable from one subquery to another though it seems to work for the first query when only 1 value was used).
https://stackoverflow.com/questions/45356326/sparql-speed-up-federated-query talks about some "reuse.vars.in.subselects" for the sesame protocol.. but perhaps it's only a graphdb thing?
is there a way to "pass along variables" to federated sparql? (I tried making service1 call a subquery for service2 call and it was still slow)
thx, matt