Re: GROUP BY

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 UTC