You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Simon Helsen <sh...@ca.ibm.com> on 2012/06/19 15:32:02 UTC
ARQ eliminates duplicates during unionDefaultGraph?
Hi guys,
I recently ran into a query which produced a surprising result and it is
not clear to me if I don't understand the spec correctly or whether it is
an ARQ bug. The scenario is that you have a quad store with e.g. 2
identical triples, except that they live in 2 separate graphs. So
if your store contains the following 2 quads
<s1> <p1> <o1> <g1>
<s1> <p1> <o1> <g2>
and you execute the following query with unionDefaultGraph=true
SELECT ?s
WHERE {
?s <p1> <o1>
}
would you not expect two results? It seems that the current ARQ returns
only one result, i.e. by crossing the graphs during unionDefault, it seems
to eliminate duplicates. That is unexpected to me, but perhaps there is
something in the spec I am not aware of
Any thoughts?
Simon
Re: ARQ eliminates duplicates during unionDefaultGraph?
Posted by Simon Helsen <sh...@ca.ibm.com>.
thanks Andy,
I see the reason and it makes sense
Simon
From:
Andy Seaborne <an...@apache.org>
To:
dev@jena.apache.org
Date:
06/20/2012 02:57 AM
Subject:
Re: ARQ eliminates duplicates during unionDefaultGraph?
On 19/06/12 14:32, Simon Helsen wrote:
> Hi guys,
>
> I recently ran into a query which produced a surprising result and it is
> not clear to me if I don't understand the spec correctly or whether it
is
> an ARQ bug. The scenario is that you have a quad store with e.g. 2
> identical triples, except that they live in 2 separate graphs. So
>
> if your store contains the following 2 quads
>
> <s1> <p1> <o1> <g1>
> <s1> <p1> <o1> <g2>
>
> and you execute the following query with unionDefaultGraph=true
>
> SELECT ?s
> WHERE {
> ?s<p1> <o1>
> }
>
> would you not expect two results? It seems that the current ARQ returns
> only one result, i.e. by crossing the graphs during unionDefault, it
seems
> to eliminate duplicates. That is unexpected to me, but perhaps there is
> something in the spec I am not aware of
>
> Any thoughts?
>
> Simon
An RDF graph is a set of triples. A set does not have duplicates. How
the graph is formed does not matter; it must behave like a set. So Jena
removes duplicates for a union default graph.
Andy
Re: ARQ eliminates duplicates during unionDefaultGraph?
Posted by Andy Seaborne <an...@apache.org>.
On 19/06/12 14:32, Simon Helsen wrote:
> Hi guys,
>
> I recently ran into a query which produced a surprising result and it is
> not clear to me if I don't understand the spec correctly or whether it is
> an ARQ bug. The scenario is that you have a quad store with e.g. 2
> identical triples, except that they live in 2 separate graphs. So
>
> if your store contains the following 2 quads
>
> <s1> <p1> <o1> <g1>
> <s1> <p1> <o1> <g2>
>
> and you execute the following query with unionDefaultGraph=true
>
> SELECT ?s
> WHERE {
> ?s<p1> <o1>
> }
>
> would you not expect two results? It seems that the current ARQ returns
> only one result, i.e. by crossing the graphs during unionDefault, it seems
> to eliminate duplicates. That is unexpected to me, but perhaps there is
> something in the spec I am not aware of
>
> Any thoughts?
>
> Simon
An RDF graph is a set of triples. A set does not have duplicates. How
the graph is formed does not matter; it must behave like a set. So Jena
removes duplicates for a union default graph.
Andy