W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > December 2011

Re: When is HAVING processed?

From: Birte Glimm <birte.glimm@comlab.ox.ac.uk>
Date: Thu, 8 Dec 2011 12:07:31 +0100
Message-ID: <CABt65OfySshNrR3ZqnzV2vNyBHr_SZyvrWRwRoFGqRbBVPCiUQ@mail.gmail.com>
To: Alex Miller <amiller@revelytix.com>
Cc: public-rdf-dawg-comments@w3.org
Alex,

Thank you for your comment about the SPARQL 1.1 Query specification.

We agree that there was some inconsistency in the specification and
your observation about the wrong order of items at the beginning of
18.2.4 is fixed in the current editors' draft, see
http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#convertGroupAggSelectExpressions.

We would be grateful if you would acknowledge that your comment has
been answered by sending a reply to this mailing list.

Birte, on behalf of the SPARQL-WG

On 3 November 2011 16:06, Alex Miller <amiller@revelytix.com> wrote:
> I've been puzzling over the SPARQL spec trying to determine the intent as to
> when the HAVING clause is executed.
>
> In particular, re section 18.2.4:
> http://www.w3.org/TR/sparql11-query/#convertGroupAggSelectExpressions
>
> The link above lists processing in the order of: Grouping, Aggregates,
> Bindings, Select exprs, and Having.
> However, the sub-sections of 18.2.4 are listed in the order of: Grouping and
> Aggregation, HAVING, BINDINGS, SELECT Expressions.  Note that HAVING is
> listed in a different order than #1.
> In the Grouping and Aggregation section (18.2.4.1), the algorithm given
> shows the HAVING filters being executed at the end of the Grouping step.
> In the Having section (18.2.4.2) it says "Note that, due to the logic
> position in which the HAVING clause is evaluated, expressions projected by
> the SELECT clause are not visible to the HAVING clause."  This seems to be
> in alignment with #2.
>
> #2-4 seem consistent and I thus conclude that the list at the beginning of
> 18.2.4 is ordered incorrectly and should say:
>
> Grouping
> Aggregates
> Having   // moved from end
> Bindings
> Select exprs
>
> Have I correctly interpreted the intent?  If so, can this issue be resolved
> in a future draft?
>
> Thanks,
> Alex Miller
> Revelytix
>



-- 
Dr. Birte Glimm, Room 309
Department of Computer Science
University of Oxford
Parks Road
Oxford
OX1 3QD
United Kingdom
+44 (0)1865 283520
Received on Thursday, 8 December 2011 11:08:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 8 December 2011 11:08:15 GMT