Re: ungrouped variables used in projections - Further implications?

On 2010-08-26, at 14:59, Andy Seaborne wrote:
> 
> On 26/08/10 10:18, Steve Harris wrote:
>> On 2010-08-25, at 18:15, Axel Polleres wrote:
>>>> Personally, I'd be happy with forbidding the use variables of grouping
>>>> expressions:
>>>> 
>>>>  SELECT (1/(1-?o) AS ?o1) { ?s ?p ?o } GROUP BY (1/(1-?o)) # Forbiddable
>>>>  SELECT ?o WHERE { ?s ?p ?o } GROUP BY (1/(1-?o)) # Forbiddable
>>> 
>>> Without expressing any strong opinion here: This rules out the new test case agg08, or, resp.,
>>> turns it into a negativeSyntaxTest. I had assumed for the current version of agg08 that the
>>> former would be allowed whereas the latter wouldn't. That's why I had "*or expressions*" in
>>> my rewording proposal.
>>> 
>>> I assume what Andy means here (and which I think holds) is that we could forbid expressions
>>> in Grouping alltogether, since they can be always emulated by subqueries, i.e.
>>> 
>>>   SELECT (1/(1-?o) AS ?o1) { ?s ?p ?o } GROUP BY (1/(1-?o))
>>> 
>>> could be written without expression in the GROUP BY clause as:
>>> 
>>>   SELECT ?o1 { SELECT (1/(1-?o) AS ?o1) { ?s ?p ?o } } GROUP BY ?o1 }
>>> ?x is a shor form of ?x AS ?x?x is a shor form of ?x AS ?x
> 
> 
>>> So, why not just doing just that and forbidding expressions in GROUP BY in the grammar already?
>> 
>> We already made a decision to do that I believe.
> 
> As I recall (and I can't find the record,maybe more an informal discussion with consensus), we agreed not to have AS in GROUP BY to name expressions used as grouping. There's no technical reason not to allow this:
> 
>  GROUP BY (?o1+?o2 AS ?o3) , ?x
> 
> and gives a name to the expression value for the group.  We could be consist with SELECT expressions and go so far as to require the AS is an expression is used.

Wasn't there some issue with execution order? People expected it to be available (lexically) at some stage it wasn't (logically).

> It would change the
>  Group(ExprList, Ω)
> to be
>  Group(VarList, Ω)
> 
> We could be consistent with SELECT expressions and go so far as to require the AS is an expression is used.

Yup, it would be consistent.

- Steve

-- 
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, 26 August 2010 14:37:27 UTC