- From: Andy Seaborne <andy.seaborne@epimorphics.com>
- Date: Wed, 07 Dec 2011 13:11:12 +0000
- To: public-rdf-dawg@w3.org
On 06/12/11 22:53, Steve Harris wrote:
>>> "[...] In aggregate queries and sub-queries variables that appear
>>> >> in the query pattern, but are not in the GROUP BY clause cannot be
>>> >> projected nor used in project expressions." I would add a comma after
>>> >> "GROUP BY clause"
>> >
>> > Done
>> >
>>> >> I don't think this is correct. I can select expressions with aggrated
>>> >> variables that are not grouped:
>>> >> SELECT (SAMPLE(?x) AS ?y) { ?x :p ?z } GROUP BY ?z
>> >
>> > @@Steve
> I believe that's as the group intended.
I think Birte's point is that SAMPLE(?x) uses a variable in a select
expression, but it's not GROUP BY'ed.
As currently worded, that's not allowed.
>>> >> "It is an error for aggregates to project variables with a name
>>> >> already used in other aggregate projections."
>>> >> Isn't it even forbidden to use any variable that is used elsewhere?
>>> >> SELECT (SAMPLE(?x) AS ?y) { ?x :p ?y } GROUP BY ?y
>>> >> would not be valid, right?
>> >
>> > @@Steve
> I'm not really sure, that seems like more of a general select expressions restriction - I thought that was allowed at one time though?
>
> I guess it wouldn't hurt to reiterate if that is the case, Andy?
Agreed - restate the condition.
Andy
Received on Wednesday, 7 December 2011 13:11:45 UTC