Re: ungrouped variables used in projections - Further implications?

[sorry, just found this mail sitting on my desktop, must have forgotten to send it]

On 2010-08-25, at 13:33, Axel Polleres wrote:

> The more I think about this, I am afraid there are possibly further implications 
> of this discussion...
> 
> This is the current text:
> 
> "In aggregate queries and sub-queries variables that appear in the query
> pattern, but are not grouped by cannot be projected nor used in project
> expressions. In order to project arbitrary expressions the SAMPLE
> aggregate may be used."
> 
> I am afraid it is still potentially not totally clear:
> 
> 1) in principle this forbids 
> 
> SELECT (COUNT(?O1) AS ?C)
> WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?O1 + ?O2)
> ORDER BY ?O12
> 
> (currently this is reflected within testcase agg08)
> I am not sure we intended to forbid this?

Yeah, that's caused by the addition of the "... nor used in project expressions" text.

it needs to say something like "... project expressions, other than as expressions passed to aggregates". That's just getting more complex though. I will add some examples of what's ok and not, later today.

> 2) 
> ACTION-209 reflects our understanding that we shouldn't allow projected variables being reused 
> in HAVING clauses.  Now how about non-grouped variables and expressions in HAVING clauses?

That should have the same restriction.

- 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 09:48:46 UTC