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

example query on aggregates in SPARQL/Query Section 2

From: Axel Polleres <axel.polleres@deri.org>
Date: Thu, 5 Nov 2009 09:58:19 -0800
Message-Id: <6F9097E9-37EB-4DED-8E9D-8C6160D66621@deri.org>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
Just browsing over the example again and rethinking our discussion  
regarding implicit grouping...

PREFIX  <http://books.example/>
SELECT SUM(?lprice) AS ?totalPrice
   ?org :affiliates ?auth .
   ?auth :writesBook ?book .
   ?book :price ?lprice
HAVING (SUM(?lprice) > 10)

has ungrouped variables book, auth...Looking at our resolution, I  
honestly don't get my head around the semantics here:

"Consensus on prohibiting projecting variables/functions on variables  
that are not included in the group by clause. Details are pending  
discussion of ISSUE-41."

That doesn't seem to cover this case, where there are ungrouped  
variables that *don't* appear in projections or scalar functions.
Obviously, that query doesn't becomes weird if there are more than one  
authors from the same org, or if there are several prices for the same  

Opinions to resolve?

Received on Thursday, 5 November 2009 17:59:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:00:57 UTC