You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Kamalraj Jairam <kj...@semanticsoftware.com.au> on 2014/02/14 05:44:43 UTC

ARQ Federated query performance

Hello All,

I’m having performance issues with ARQ federated query.

ARQ seems to generate multiple select queries to the endpoints when it should just send only 2 queries to the respective endpoints

CONSTRUCT { ?s ?p ?o . ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://localhost/target#Doctor> .}
WHERE { SERVICE <http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o } SERVICE <http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o . ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://localhost/traleerdf/db#Physician> } }

What am i doing wrong?

regards

Regards,

Kamalraj Jairam
General Manager -  Solutions Development
Semantic Software
www.semanticsoftware.com.au<http://www.semanticsoftware.com.au/>
Australian Office: +61-2-9931-7848
Australian Cell: +61-405-203134




Re: ARQ Federated query performance

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hello All,

This Jira ticket explains my situation well.

After reading through the following paragraph in https://jena.apache.org/documentation/query/service.html
Performance Considerations

This feature is a basic building block to allow remote access in the middle of a query, not a general solution to the issues in distributed query evaluation. The algebra operation is executed without regard to how selective the pattern is. So the order of the query will affect the speed of execution. Because it involves HTTP operations, asking the query in the right order matters a lot. Don't ask for the whole of a bookstore just to find book whose title comes from a local RDF file - ask the bookshop a query with the title already bound from earlier in the query.

I modified the code to restructure the sequence of call

CONSTRUCT { ?s ?p ?o . ?s ?p <http://localhost/target#Doctor> .}
WHERE {
SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
 { ?s ?p <http://localhost/traleerdf/db#Physician>. ?s ?p ?o . }
 SERVICE <http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o }
 } LIMIT 10

       So, the query which returns minimum no of rows is called first and then the second service is executed. This way, the calls to the endpoint are drastically reduced.

Thanks for the response

Regards
Kamalraj



On 14 Feb 2014, at 9:07 pm, Olivier Rossel <ol...@gmail.com>> wrote:

May be that thread might help:
https://issues.apache.org/jira/browse/JENA-449#comment-13651857httpstatus

Give us your feedback.


On Fri, Feb 14, 2014 at 5:44 AM, Kamalraj Jairam <
kjairam@semanticsoftware.com.au<ma...@semanticsoftware.com.au>> wrote:

Hello All,

I'm having performance issues with ARQ federated query.

ARQ seems to generate multiple select queries to the endpoints when it
should just send only 2 queries to the respective endpoints

CONSTRUCT { ?s ?p ?o . ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://localhost/target#Doctor> .}
WHERE { SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s ?p ?o } SERVICE <
http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o . ?s <
http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <
http://localhost/traleerdf/db#Physician> } }

What am i doing wrong?

regards

Regards,

Kamalraj Jairam
General Manager -  Solutions Development
Semantic Software
www.semanticsoftware.com.au<http://www.semanticsoftware.com.au/><http://www.semanticsoftware.com.au/>
Australian Office: +61-2-9931-7848
Australian Cell: +61-405-203134


Re: ARQ Federated query performance

Posted by Olivier Rossel <ol...@gmail.com>.
May be that thread might help:
https://issues.apache.org/jira/browse/JENA-449#comment-13651857httpstatus

Give us your feedback.


On Fri, Feb 14, 2014 at 5:44 AM, Kamalraj Jairam <
kjairam@semanticsoftware.com.au> wrote:

> Hello All,
>
> I'm having performance issues with ARQ federated query.
>
> ARQ seems to generate multiple select queries to the endpoints when it
> should just send only 2 queries to the respective endpoints
>
> CONSTRUCT { ?s ?p ?o . ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://localhost/target#Doctor> .}
> WHERE { SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
> { ?s ?p ?o } SERVICE <
> http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o . ?s <
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <
> http://localhost/traleerdf/db#Physician> } }
>
> What am i doing wrong?
>
> regards
>
> Regards,
>
> Kamalraj Jairam
> General Manager -  Solutions Development
> Semantic Software
> www.semanticsoftware.com.au<http://www.semanticsoftware.com.au/>
> Australian Office: +61-2-9931-7848
> Australian Cell: +61-405-203134
>
>
>
>

Re: ARQ Federated query performance

Posted by Rob Vesse <rv...@dotnetrdf.org>.
This is by design.

Nothing in the spec says it must only make one query per SERVICE call and
ARQ takes the approach which is often more efficient of substituting bound
values into the SERVICE calls and making multiple more specific calls.

This also has the side effect of actually doing more what the user
intended.  Often remote services have result limits on them therefore
making a generic query may not return any relevant data that joins with
the rest of the query even if the remote dataset does contain such data.
On the other hand making multiple specific queries tends to find the data
the user actually wanted.

Rob

On 14/02/2014 04:44, "Kamalraj Jairam" <kj...@semanticsoftware.com.au>
wrote:

>Hello All,
>
>I¹m having performance issues with ARQ federated query.
>
>ARQ seems to generate multiple select queries to the endpoints when it
>should just send only 2 queries to the respective endpoints
>
>CONSTRUCT { ?s ?p ?o . ?s
><http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
><http://localhost/target#Doctor> .}
>WHERE { SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
>{ ?s ?p ?o } SERVICE
><http://localhost:8084/processor/webresources/rs/sparql> { ?s ?p ?o . ?s
><http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
><http://localhost/traleerdf/db#Physician> } }
>
>What am i doing wrong?
>
>regards
>
>Regards,
>
>Kamalraj Jairam
>General Manager -  Solutions Development
>Semantic Software
>www.semanticsoftware.com.au<http://www.semanticsoftware.com.au/>
>Australian Office: +61-2-9931-7848
>Australian Cell: +61-405-203134
>
>
>