You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jean-Claude Moissinac <jc...@gmail.com> on 2019/03/07 16:55:52 UTC
Fwd: Equivalent query and performances
Hello
I'm using jena-fuseki 3.6.0
I've tried two queries which, for me seems equivalent:
select (count(distinct ?s) as ?c)
from <http://givingsense.eu/datamusee/onto/contextgraph18022019>
where {
?s a ?t;
a <http://dbpedia.org/ontology/Painter>
}
and
select (count(distinct ?s) as ?c)
where {
graph <http://givingsense.eu/datamusee/onto/contextgraph18022019> {
?s a ?t;
a <http://dbpedia.org/ontology/Painter>
}
}
The second is much muck quickest than the first; for example, 42712 ms for
the first one and 524 ms for the second
It's a penalty because I would like sometimes to use several graphs and the
from version seems to be the good way.
Any advices or comments?
--
Jean-Claude Moissinac
Re: Equivalent query and performances
Posted by Andy Seaborne <an...@apache.org>.
It might be going to the network though as far as I can tell,
http://givingsense.eu/datamusee/onto/contextgraph18022019
does not have any triples.
In order to do FROM, the query engine has to create create a different
dataset and that can imped some TDB features. Have you tried:
where {
?s a <http://dbpedia.org/ontology/Painter>
?s a ?t;
}
also - what happens if you remove the "?s a ?t" because with the
DISTINCT, it does not change the results.
Andy
On 07/03/2019 17:47, Zachary Whitley wrote:
> I believe that the first query with the "from" will make a network call and
> add what is returned to to default graph while the second one will query
> the data already loaded in the named graph. If I'm correct that would
> explain the difference and wouldn't be surprised to see the results you're
> getting.
>
> https://jena.apache.org/tutorials/sparql_datasets.html
>
> On Thu, Mar 7, 2019 at 11:56 AM Jean-Claude Moissinac <jc...@gmail.com>
> wrote:
>
>> Hello
>>
>> I'm using jena-fuseki 3.6.0
>> I've tried two queries which, for me seems equivalent:
>> select (count(distinct ?s) as ?c)
>> from <http://givingsense.eu/datamusee/onto/contextgraph18022019>
>> where {
>> ?s a ?t;
>> a <http://dbpedia.org/ontology/Painter>
>> }
>> and
>> select (count(distinct ?s) as ?c)
>> where {
>> graph <http://givingsense.eu/datamusee/onto/contextgraph18022019> {
>> ?s a ?t;
>> a <http://dbpedia.org/ontology/Painter>
>> }
>> }
>>
>> The second is much muck quickest than the first; for example, 42712 ms for
>> the first one and 524 ms for the second
>> It's a penalty because I would like sometimes to use several graphs and the
>> from version seems to be the good way.
>>
>> Any advices or comments?
>> --
>> Jean-Claude Moissinac
>>
>
Re: Equivalent query and performances
Posted by Zachary Whitley <za...@gmail.com>.
I believe that the first query with the "from" will make a network call and
add what is returned to to default graph while the second one will query
the data already loaded in the named graph. If I'm correct that would
explain the difference and wouldn't be surprised to see the results you're
getting.
https://jena.apache.org/tutorials/sparql_datasets.html
On Thu, Mar 7, 2019 at 11:56 AM Jean-Claude Moissinac <jc...@gmail.com>
wrote:
> Hello
>
> I'm using jena-fuseki 3.6.0
> I've tried two queries which, for me seems equivalent:
> select (count(distinct ?s) as ?c)
> from <http://givingsense.eu/datamusee/onto/contextgraph18022019>
> where {
> ?s a ?t;
> a <http://dbpedia.org/ontology/Painter>
> }
> and
> select (count(distinct ?s) as ?c)
> where {
> graph <http://givingsense.eu/datamusee/onto/contextgraph18022019> {
> ?s a ?t;
> a <http://dbpedia.org/ontology/Painter>
> }
> }
>
> The second is much muck quickest than the first; for example, 42712 ms for
> the first one and 524 ms for the second
> It's a penalty because I would like sometimes to use several graphs and the
> from version seems to be the good way.
>
> Any advices or comments?
> --
> Jean-Claude Moissinac
>