Duplicate triples?

26 views
Skip to first unread message

Chris Wallace

unread,
May 9, 2010, 9:44:21 AM5/9/10
to Data Incubator
Having loaded (and re-loaded a few times) my Election dataset, I'm
seeing duplicates in a SPARQL query where I don't think there should
be any.

the Query

prefix : <http://www.cems.uwe.ac.uk/xmlwiki/rdf/election/vocab#>
select ?cand ?party where {
<http://www.cems.uwe.ac.uk/xmlwiki/rdf/Election/UK2010/Constituency/
Bristol_West>
:candidate ?cand.
?cand :party ?party.
}

http://api.talis.com/stores/cwallace-dev3/services/sparql?query=prefix+%3A+%3Chttp%3A%2F%2Fwww.cems.uwe.ac.uk%2Fxmlwiki%2Frdf%2Felection%2Fvocab%23%3E%0D%0Aselect+%3Fcand+%3Fparty++where+{%0D%0A+++%3Chttp%3A%2F%2Fwww.cems.uwe.ac.uk%2Fxmlwiki%2Frdf%2FElection%2FUK2010%2FConstituency%2FBristol_West%3E+%0D%0A+++++++++%3Acandidate+%3Fcand.%0D%0A++++%3Fcand+%3Aparty+%3Fparty.%0D%0A}

shows duplicate triples

Any ideas?
Chris

--
You received this message because you are subscribed to the Google Groups "Data Incubator" group.
To post to this group, send email to datain...@googlegroups.com.
To unsubscribe from this group, send email to dataincubato...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dataincubator?hl=en.

Keith Alexander

unread,
May 9, 2010, 10:11:24 AM5/9/10
to datain...@googlegroups.com
Duplicate rows from a SPARQL SELECT doesn't mean there are duplicate
triples (I don't think there will be duplicate triples in your store),
just that there are more than one solution for your triple pattern
with the same values.

Try SELECT DISTINCT ?

Chris Wallace

unread,
May 9, 2010, 10:48:21 AM5/9/10
to Data Incubator
Let me simplify the query to show the problem more clearly:
Bristol_West/Candidate/Stephen_Williams> :party ?party.
}

http://api.talis.com/stores/cwallace-dev3/services/sparql

This pattern has URIs for subject and predicate with only one free
variable - it returns two matches.

Adding DISTINCT shows that the triples are duplicates.

Therefore there must be duplicate triples in the store.

Does that logic seem right?

I wonder if something has gone amiss with my successive cleans and
reloads?

Chris

On May 9, 3:11 pm, Keith Alexander <k.j.w.alexan...@gmail.com> wrote:
> Duplicate rows from a SPARQL SELECT doesn't mean there are duplicate
> triples (I don't think there will be duplicate triples in your store),
> just that there are more than one solution for your triple pattern
> with the same values.
>
> Try SELECT DISTINCT ?
>
> On Sun, May 9, 2010 at 2:44 PM, Chris Wallace
>
>
>
> <kit.wall...@googlemail.com> wrote:
> > Having loaded (and re-loaded a few times)  my Election dataset, I'm
> > seeing duplicates in a SPARQL query where I don't think there should
> > be any.
>
> > the Query
>
> > prefix : <http://www.cems.uwe.ac.uk/xmlwiki/rdf/election/vocab#>
> > select ?cand ?party  where {
> >   <http://www.cems.uwe.ac.uk/xmlwiki/rdf/Election/UK2010/Constituency/
> > Bristol_West>
> >         :candidate ?cand.
> >    ?cand :party ?party.
> > }
>
> >http://api.talis.com/stores/cwallace-dev3/services/sparql?query=prefi...{%0D%0A+++%3Chttp%3A%2F%2Fwww.cems.uwe.ac.uk%2Fxmlwiki%2Frdf%2FElection%2FUK2010%2FConstituency...}
>
> > shows  duplicate triples
>
> > Any ideas?
> > Chris
>
> > --
> > You received this message because you are subscribed to the Google Groups "Data Incubator" group.
> > To post to this group, send email to datain...@googlegroups.com.
> > To unsubscribe from this group, send email to dataincubato...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/dataincubator?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Data Incubator" group.
> To post to this group, send email to datain...@googlegroups.com.
> To unsubscribe from this group, send email to dataincubato...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/dataincubator?hl=en.

Andy Seaborne

unread,
May 9, 2010, 1:09:40 PM5/9/10
to datain...@googlegroups.com
It does look like there's a problem somewhere.

Chris - could let me have a copy of the original data? It could well be
the repeated reset/reloads but I'd like to also check the original data.

Thanks
Andy

Chris Wallace

unread,
May 9, 2010, 1:41:03 PM5/9/10
to Data Incubator
The same data has been loaded into another datastore and is OK - the
application is here.

http://www.cems.uwe.ac.uk/xmlwiki/Scrape/home.xq?model=Election

Andy, I'll send the RDF files - I haven't touched the faulty store.

Chris

Andy Seaborne

unread,
May 9, 2010, 1:47:13 PM5/9/10
to datain...@googlegroups.com
I'm sure the data is OK. Duplicate are fairly common so stores do tend
to get quite tested for duplicate surpression. I'm just wondering if
some characteristic of the data is causing the duplicates to appear on
access as returned by the store, or whether it's the reset/reload
cycling, or something else.

Andy

On 09/05/2010 18:41, Chris Wallace wrote:
> The same data has been loaded into another datastore and is OK - the
> application is here.
>
> http://www.cems.uwe.ac.uk/xmlwiki/Scrape/home.xq?model=Election
>
> Andy, I'll send the RDF files - I haven't touched the faulty store.
>
> Chris

Reply all
Reply to author
Forward
0 new messages