W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > July 2012

Re: Question about duplicate triples

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Tue, 31 Jul 2012 09:11:30 +0100
Message-ID: <50179332.8010807@epimorphics.com>
To: public-rdf-dawg-comments@w3.org


On 30/07/12 23:18, David Booth wrote:
> Suppose I LOAD a single file of NTriples into a named graph foo:, and
> that file contains some duplicate triples such as:
>
>    _:bnode <http://example/ppp> <http://example/vvv> .
>    _:bnode <http://example/ppp> <http://example/vvv> .
>    _:bnode <http://example/ppp> <http://example/vvv> .
>
> According to the RDF Semantics, an RDF graph is a *set* of triples.
> Hence, AFAIK the above file represents an RDF graph containing *one*
> triple, and the graph is lean.

Yes - it is a graph of one triple.

(The fact it is lean is not relevant)

> If I then query that named graph as follows, how many solutions should I
> get?
>
>    SELECT * WHERE { GRAPH foo: { ?s ?p ?v } }
>
> Is the SPARQL server permitted to return more than one solution (i.e.,
> duplicates) in this case?

No.

And

SELECT (count(*) AS ?C) WHERE { GRAPH foo: { ?s ?p ?v } }

returns a single row with ?C=1

> I am aware of the DISTINCT keyword, but I always understood it as being
> intended for situations where the query could generate multiple
> candidate solutions, which is not the situation in this case.  It seems
> a little weird if a SPARQL server might return multiple solutions in
> this case, but would it still be conforming to the SPARQL spec if it
> did?
>
> Thanks

You may wish to consider the mailing list public-sparql-dev@w3.org for 
general questions about SPARQL and its implementation.

	Andy
Received on Tuesday, 31 July 2012 08:12:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 31 July 2012 08:12:25 GMT