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

When is HAVING processed?

From: Alex Miller <amiller@revelytix.com>
Date: Thu, 3 Nov 2011 10:06:57 -0500
Message-ID: <CANFyktFHpO2k9r3+5nWkqq9viv7nJm-FzzNrOXEHC0qgmCQd=w@mail.gmail.com>
To: public-rdf-dawg-comments@w3.org
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


   1. The link above lists processing in the order of: Grouping,
   Aggregates, Bindings, Select exprs, and Having.
   2. 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.
   3. 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.
   4. 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
Received on Thursday, 3 November 2011 17:52:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 3 November 2011 17:52:55 GMT