W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2012

Re: Status of work on BIND

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Mon, 02 Jul 2012 12:12:05 +0100
Message-ID: <4FF18205.8040506@epimorphics.com>
To: public-rdf-dawg@w3.org
This is now complete.

1/ The grammar notes say that it is a syntax error to use a variable
in use in the preceeding TriplesBlock.

http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlGrammar

2/ There is a syntax to algebra translation step for BIND which happens 
before the processing of the whole group.  This means that BIND is 
scoped to the BGP/Proper path block, not the whole of the group up to 
that point.  The description and the formal translation disagreed with 
one another.

http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlTranslateBindAssignments

3/ Put in an example that has a intervening sub-group.

http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlAlgebraExamples

(near the end of the section)

4/ I have put up a version of the Jena SPARQL validator that 
incorporates the new scheme so you can try out the ARQ implementation
of the translation - tick the "SPARQL algebra" box for output.

http://www.sparql.org/query-validator.html

	Andy



On 21/06/12 17:17, Andy Seaborne wrote:
> FYI / Update
>
> I have been doing some work on the formal handling of BIND, but it is
> not finished yet.
>
> Much of the descriptive text is correct but the way it is handled in the
> algebra translation isn't right - it needs to happen separately and
> before the general group graph pattern processing step.
>
> The objective is that BIND adds a variable binding to the proceeding
> basic graph pattern + any path expression (i.e generalise BGP to include
> property paths).
>
> With this, BIND adds to a basic building blocks of SPARQL evaluation and
> all other combination with graph patterns is by join.
>
>      Andy
>
> Approximate examples:
>
> Example 1:
>
> SELECT *
> {
>    ?s ?p ?o
>    BIND ( ?o +1 AS ?o2 )
> }
> ==>
>    (extend ((?o2 (+ ?o 1)))
>      (bgp (triple ?s ?p ?o)))
>
>
> Example 2:
>
> SELECT *
> {
>    { ?s ?p ?o }
>    BIND ( ?o +1 AS ?o2 )
> }
> ==>
> SELECT *
> {
>    { ?s ?p ?o } # Sub-pattern
>    {} ## Insert empty BGP for BIND to work on.
>    BIND ( ?o +1 AS ?o2 )
> }
> ==>
>    (join
>      (bgp (triple ?s ?p ?o))
>      (extend ((?o2 (+ ?o 1))
>        (table unit)
>      )
>
> Example 3:
>
> SELECT *
> {
>    ?s ?p ?o
>    ?s :p* ?v
>    BIND ( ?o +1 AS ?o2 )
> }
> ==>??
>      (extend ((?o2 (+ ?o 1)))
>        (join
>          (bgp (triple ?s ?p ?o))
>          (path ?s (path* :p) ?v)))
>
Received on Monday, 2 July 2012 11:12:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:48 GMT