W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2005

Re: sparql test for order by and distinct

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Wed, 27 Jul 2005 12:12:21 +0100
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-Id: <1122462741.27845.34.camel@hoth.ilrt.bris.ac.uk>

On Wed, 2005-07-27 at 11:58 +0100, Dave Beckett wrote:

A little later I work out that the blank nodes and ordering is not
significant here and the bug is testable as long as the query has
SELECT DISTINCT ?something and ORDER BY ?somethingelse with some
duplicates to remove.

So here is a testable data/query/result set:

data:
@prefix ex: <http://example.org/abc#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:r1 ex:prop "value 1" .
ex:r2 ex:prop "value 3" .
ex:r3 ex:prop "value 3" .
ex:r4 ex:prop "value 4" .

query:
PREFIX ex: <http://example.org/abc#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?value
FROM <data.ttl>
WHERE {
  ?res ex:prop ?value .
}
ORDER BY ?res

result:
-------------
| value     |
=============
| "value 1" |
| "value 3" |
| "value 4" |
-------------

(and my code gives 4 answers values 1, 3, 3, 4)

Dave
Received on Wednesday, 27 July 2005 11:12:30 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:23 GMT