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

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

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Sat, 26 May 2012 16:22:48 +0100
Message-ID: <4FC0F548.80508@epimorphics.com>
To: public-rdf-dawg@w3.org


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 GMT

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