W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2010

Re: More Aggregates questions ... Another scalar parameter for GROUP_CONCAT?

From: Steve Harris <steve.harris@garlik.com>
Date: Thu, 7 Oct 2010 11:18:35 +0100
Cc: SPARQL Working Group <public-rdf-dawg@w3.org>
Message-Id: <F53547B3-7749-4CA8-A5E7-C9506B429BDD@garlik.com>
To: Axel Polleres <axel.polleres@deri.org>
My feeling is that you need ORDER BY expression to make it useful.

- Steve

On 2010-10-07, at 02:50, Axel Polleres wrote:

> When thinking about practical examples for GROUP_CONCAT, I can hardly think of any where I wouldn't want to impose an order...
> ... thus, what's the opinions about adding another scalar parameter "order" which takes as parameter  "DESC"|"ASC"
> 
> That is, e.g. something like:
> 
>    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
>    SELECT ( SAMPLE(?N) as ?Name)
>       ( GROUP_CONCAT(?M; SEPARATOR = ", " , ORDER="ASC") AS ?Nicknames )
> WHERE { ?P a foaf:Person ;
>           foaf:name ?N ;
>           foaf:nick ?M . }
> GROUP BY ?P 
> 
> It seems that GROUP_CONCAT in SQL dialects also has an ORDER BY clause, as e.g. a quick google search reveals for MySQL [1].
> 
> Steve, do you think that would be a big deal to add?
> Others?
> 
> Axel
> 
> P.S.: I thought briefly about not only allowing "ASC"|"DESC" but an arbitrary ORDER BY expression, however, that admittedly seems not 
> to go well with the current Aggregation() semantics definition, I am afraid...
> 
> 
> 1. http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat

-- 
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD
Received on Thursday, 7 October 2010 10:19:09 GMT

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