W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2009

select distinct and ordered from two graphs

From: Mirko <idonthaveenoughinformation@googlemail.com>
Date: Mon, 31 Aug 2009 11:56:30 +0200
Message-Id: <221381D9-29FD-4474-B751-E3FA2A1A42D4@googlemail.com>
To: public-sparql-dev@w3.org
Hi,
I wonder how to solve this. I have the following query:

SELECT ?labelValue FROM :graphA FROM :graphB
WHERE {	
  ?post :contains :givenTag .
  ?post :contains ?tag .
  ?tag :label ?labelValue .
  ?post :created ?date
  }
ORDER BY DESC (?date)
LIMIT 10

Now, I would like to have only distinct ?labelValues as results.  
Unfortunately, in my case SELECT DISTINCT messes up the order when  
selecting from several graphs.

How could I make the results (?labelValue) of the above query distinct  
while keeping the order?

Thanks,
Mirko
Received on Monday, 31 August 2009 09:57:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 31 August 2009 09:57:26 GMT