Re: Attemt to tackle in-scope BIND issue (ACTION-618 - part 1)

On 26/05/12 07:52, Axel Polleres wrote:
> Dear all,
>
> As per http://lists.w3.org/Archives/Public/public-rdf-dawg/2012AprJun/0161.html
> I added 8 new BIND scope test cases under
>
>   http://www.w3.org/2009/sparql/docs/tests/data-sparql11/syntax-query/
>
> which are marked
>    :test55 - :test62
> in the manifest file
>   http://www.w3.org/2009/sparql/docs/tests/data-sparql11/syntax-query/manifest.ttl
>
> best,
> Axel

Good for tests : I disagree with test 7 and test 8.

test 7:

PREFIX : <http://www.example.org>
SELECT *
WHERE {
    {
    :s :p ?o .
    :s :q ?o1 .
    }
    BIND((1+?o) AS ?o1)
}


Add the inner {} around the BGP scopes ?o1 to a deeper level.
What is confusing here is that simplification happens.

I also think the algebra generation text in rq25 is wrong for BIND.

If we had:

PREFIX : <http://www.example.org>
  SELECT *
  WHERE {
     BIND((1+?o) AS ?o1)
     {
      :s :p ?o .
      :s :q ?o1 .
     }
  }

we keep the join:

(prefix ((: <http://www.example.org>))
   (join
     (extend ((?o1 (+ 1 ?o)))
       (table unit))
     (bgp
       (triple :s :p ?o)
       (triple :s :q ?o1)
     )))

but joins are commutative so this (the translation of the test) is not 
right:

(prefix ((: <http://www.example.org>))
   (extend ((?o1 (+ 1 ?o)))
     (bgp
       (triple :s :p ?o)
       (triple :s :q ?o1)
     )))

it should be:


(prefix ((: <http://www.example.org>))
   (join
     (bgp
       (triple :s :p ?o)
       (triple :s :q ?o1)
     )
     (extend ((?o1 (+ 1 ?o)))
       (table unit))
   ))

i.e. the BIND applies to the immediate BGP, not across the nested group 
elements.

I need to investigate this further.

	Andy

Received on Saturday, 26 May 2012 15:23:18 UTC