W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > August 2005

Re: GROUP BY

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Sun, 21 Aug 2005 16:39:31 +0100
Message-ID: <4308A033.8060502@hp.com>
To: Bruce D'Arcus <bdarcus@gmail.com>
Cc: Danny Ayers <danny.ayers@gmail.com>, public-rdf-dawg-comments@w3.org, Richard Newman <rich@holygoat.co.uk>



Bruce D'Arcus wrote:
> 
> On Aug 20, 2005, at 5:37 AM, Danny Ayers wrote:
> 
>> At [1]. What I found was the "Muenchian Method" in XSLT 1.0 could do
>> grouping of SPARQL XML query results, and multi-level grouping was
>> possible but not at all pretty.
> 
> 
> Indeed!
> 
>> My application was converting a particular set of RDF statements into
>> a Javascript data serialization (JSON, [2]).
> 
> 
> FWIW, my application (currently XML/XSLT oriented) is citation 
> processing.  If I want a bibliography list in the form ...
> 
> Doe, J. (1999a) ...
>  . (1999b) ...
> . (2000) ...
> 
> .... I need to group and sort by author, then year.
> 
> Bruce

Bruce - could you expand on the need for GROUP BY in this specific example? 
I don't see where an aggregate function is being used.

In particular, in what way does sorting by author then by year not achieve 
the effect of placing entries in the order described?  SPARQL does have 
"ORDER BY"

SELECT ?author  ?pubYear
WHERE { .... }
ORDER BY ?author DESC(?pubYear)

The sort condition can be a custom function (idnetified by qname/IRIref)


	Andy
Received on Sunday, 21 August 2005 15:39:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:49 GMT