Re: Proposed: SPARQL grammar is complete as-is

* Andy Seaborne <andy.seaborne@epimorphics.com> [2011-01-04 13:01+0000]
> 
> 
> On 03/01/11 17:16, Eric Prud'hommeaux wrote:
> >+
> >I like using BINDINGs in subselects for getting my head around (i.e.
> >debugging) aggregate queries as it puts the pre-aggregated result set
> >directly in my face. I use this for didactic and testing purposes:
> >   http://swobjects.svn.sourceforge.net/viewvc/swobjects/branches/sparql11/tests/sparql11/groupBy-f-having-f.rq?revision=1264&view=markup
> 
> More generally, inline data tables - i.e. the ability to put data
> into a query directly.  There are some ways to this -
> BINDINGS+SubSELECT but also anywhere AS is used can be combined with
> UNION to produce inline data.  The latter may be very verbose :-)

true, this validates:
SELECT ?a (COUNT(?b) AS ?d) WHERE {
       { BIND (1 AS ?a) BIND (2 AS ?b) BIND (3 AS ?c) }
 UNION { BIND (4 AS ?a) BIND (5 AS ?b) BIND (6 AS ?c) }
} GROUP BY ?c


> A more consistent approach might be:
> 
>    TABLE ?a ?b ?c { (1 2 3) (4 5 6) }
> 
> to put anywhere in graph pattern.
> 
> (not a proposal for this version of the spec)

Just for yucks, I tried:
  GraphPatternNotTriples ::= GroupOrUnionGraphPattern
      | OptionalGraphPattern
      | MinusGraphPattern
      | GraphGraphPattern
      | ServiceGraphPattern
      | Filter
      | Bind
      | "BINDINGS" Var* "{" ( "(" BindingValue+ ")" | NIL )* "}"¹

and got no reduce/reuse/recycle conflicts.

  http://www.w3.org/2005/01/yacker?name=SPARQL_11&replace=1&lang=perl#prod-SPARQL_11-GraphPatternNotTriples

e.g. http://www.w3.org/2005/01/yacker/uploads/SPARQL_11?lang=perl&text=SELECT+%3Fa+%28COUNT%28%3Fb%29+AS+%3Fd%29+WHERE+{%0D%0A++BINDINGS+%3Fa+%3Fb+%3Fc+{+%281+2+3%29+%284+5+6%29+}%0D%0A}+GROUP+BY+%3Fc&action=validate+text#language

¹ This is the same as the current BindingsClause except that
  the BindingsClause is all optional.


>  Andy

-- 
-ericP

Received on Wednesday, 5 January 2011 03:44:40 UTC