Re: Query Document Review

On 2011-03-15, at 13:05, Matthew Perry wrote:

> Hi,
> 
> My review the query document is below.

[snip]

> --- 11.7 ---
> It seems that unbound and error will be treated differently now (e.g. encountering a blank node during a sum() gives an error but encountering an unbound value has no effect). I recall that errors used to have the same effect as unbound.
> 
> If I understand correctly, these queries would have different results now whereas before they gave the same result.
> 
> SELECT (SUM(?X) + SUM(?Y) AS ?XY)
> WHERE { ?X :P ?Y }

So, SUM(?X) will be an error, meaning ?XY will be an error.

> SELECT SUM(?XY)
> WHERE { SELECT (?X + ?Y) AS ?XY
>        WHERE { ?X :P ?Y }
> }

I think that it will be the same, eval(?XY) will be an error, so SUM(?XY) will also be an error.

“ListEval((unbound), μ) = (error), as the evaluation of an unbound expression is an error.”
From §18.4, but it's stated informally in a number of places too.

Though, there was a typo in the definition of Sum() I've just fixed. Sum(3) was op:numeric-add(3, 1), which is clearly not right.

...

> Minor comments / typos:
> --- 1.1 ---
> [Sections => Section] 11 introduces the mechanism to group and aggregate results, which can [be] incorporated as subqueries as described in Section 12.

Thanks, fixed.

...

> --- 11.2 ---
> In order to calculate aggregate values for a solution, the solution is first divided into one or more groups, and [the the => the] aggregate value is calculated for each group.

Thanks again.

- 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 Tuesday, 29 March 2011 12:16:13 UTC