W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2007

definition of DISTINCT

From: Eric Prud'hommeaux <eric@w3.org>
Date: Fri, 16 Mar 2007 12:18:22 -0400
To: public-rdf-dawg@w3.org
Message-ID: <20070316161822.GE21623@w3.org>
Looking at the definition for DISTINCT in light of the INDISTINCT
proposal, I reallized that I wasn't sure whether
  {(X=<a>, Y=<b>)
   (X=<b>, Y=<a>)} had a duplicate. Also, "duplicates" wasn't really
defined. I expanded the section to make it more clear what the default
was and how DISTINCT acted.

PROPOSED, replace 9.3 DISTINCT with this text:


The solution sequence with no DISTINCT or INDISTINCT modifier is
defined by the SPARQL algebra in 12 Definition of SPARQL:

  @prefix  foaf:  <http://xmlns.com/foaf/0.1/> .

  _:x    foaf:name   "Alice" .
  _:x    foaf:mbox   <mailto:alice@example.com> .

  _:y    foaf:name   "Alice" .
  _:y    foaf:mbox   <mailto:asmith@example.com> .

  _:z    foaf:name   "Alice" .
  _:z    foaf:mbox   <mailto:alice.smith@example.com> .

  PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
  SELECT ?name WHERE { ?x foaf:name ?name }


The DISTINCT solution modifier eliminates duplicate solutions.
Specifically, each solution that binds the same variables to the same
RDF terms as another solution is eliminated from the solution set.

  PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
  SELECT DISTINCT ?name WHERE { ?x foaf:name ?name }


If DISTINCT and LIMIT or OFFSET are specified, then duplicates are
eliminated before the limit or offset is applied.

office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA

Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Friday, 16 March 2007 16:18:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:53 UTC