# Changes to Query 1.1

From: Steve Harris <steve.harris@garlik.com>
Date: Wed, 29 Sep 2010 10:31:22 +0100
Message-Id: <40007C44-428F-4B89-A094-48A6B893D62C@garlik.com>
To: "public-rdf-dawg@w3.org Group" <public-rdf-dawg@w3.org>
```Revisions 1.95, 1.96

Add note explaining the use of the value 1 as a key in groups
Use the empty set instead of the digit 0 in Aggreagation example
Fix example of Sum() evaluation (was decimal, should have been float)
Fix defintion of Sum() so that Sum("a") is a type error
Use "codepoint U+0020" instead of "codepoint 32"
Remove outdated note about variable scope errors in Subselect section
Fix Aggregation() example in section 10.2.3

Outstanding things that I've left are:

10 Aggregates

This section should mention somewhere that aggregates must be aliased in order to project them. A brief mention with a link to 15.1.2 SELECT expressions would be sufficient.

10.1 Aggregate Example

The introductory text seems a bit thin for readers that may not already be familiar with aggregates. Similarly, the example in 10.1 might be aided by some explanatory text detailing how the final result is arrived at.

10.2 Algebra Operators

"Aggregation, a function which calculates a scalar value as an output of the aggregate expression in the SELECT clause." -- aggregate expressions can also be in the HAVING clause, right (not just SELECT)?

The second argument to the call to the aggregate set function 'func' is defined as card[range(g)] - card[M], but the use of this value isn't discussed until later in 10.2.2, and then only vaguely. It is never used in the definitions of the set functions.

Material to move to formal definitions:
10.2.3 Mapping from Abstract Syntax to Algebra

In the "Joining Aggregate Values" section, I have no idea what the introductory sentence is meant to convey. I may have misunderstood the definition of AggregateJoin, but it seems like it will produce a multiset of single-mapping sets, {agg_i -> range(A_i)}. I would have expected something like:

AggregateJoin(A) = { { (agg_i -> range(A_i)) | dom(A_i) = k } | k in set-union(dom(A)) }

The algorithmic sketch of using AggregateJoin in 17.2.3 might be more intuitive if there were more than one 'Let A_i' line (more than one aggregate operation in the query).

11 Subqueries

There needs to be introductory text for subqueries.

- 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