Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rdf4j-dev] reusing vars across federated queries

Assuming this is the correct place for it? https://github.com/eclipse/rdf4j/discussions/4529

Thanks.

btw- will be at kgc nyc next week if anyone's around.


-----Original Message-----
From: Håvard Ottestad <hmottestad@xxxxxxxxx>
To: Matthew Nguyen <nguyenm9@xxxxxxx>; rdf4j developer discussions <rdf4j-dev@xxxxxxxxxxx>
Sent: Mon, May 1, 2023 3:12 pm
Subject: Re: [rdf4j-dev] reusing vars across federated queries

Hi Matthew,

Could you post your question on GitHub? It’ll be easier to answer it there, especially for follow up discussion.

Håvard

On 1 May 2023, at 15:59, Matthew Nguyen via rdf4j-dev <rdf4j-dev@xxxxxxxxxxx> wrote:


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
_______________________________________________
rdf4j-dev mailing list
rdf4j-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/rdf4j-dev

Back to the top