Re: BIND semantics (2)

This message is a further example to be read with my previous comment, 
and is not intended as a separate comment.

Sorry that I did not consolidate all my thoughts on this issue before 
starting.

The example is, with the same dataset

  <http://example.org>

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://www.youtube.com/watch?v=EyXcWDv5elk> rdfs:label "Been Teen" .


Consider the following query:

PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?x ?y ?z
FROM <http://example.org>
WHERE {
       ?x rdfs:label ?label .
       BIND (?label AS ?y)
       BIND (?y AS ?z)
}


I believe that the current text leaves ?z as unbound since the BIND 
applies to the basic graph pattern, and the first BIND ends the first 
basic graph pattern, and the query hence contains a second empty basic 
graph pattern.
http://www.w3.org/TR/2012/WD-sparql11-query-20120724/#sparqlTranslateBindAssignments

For each BIND(expr AS var) in the group graph pattern:
    Let P = immediately preceding translated TriplesBlock or empty BGP if none.
    Replace BIND(expr AS var) with Extend(P, var, expr)
    End

i.e. the correct results are:

<sparql xmlns="http://www.w3.org/2005/sparql-results#">
    <head>
      <variable name="x"/>
      <variable name="y"/>
      <variable name="z"/>
    </head>
    <results>
      <result>
        <binding name="x">
          <uri>http://www.youtube.com/watch?v=EyXcWDv5elk</uri  <http://www.youtube.com/watch?v=EyXcWDv5elk%3C/uri>>
        </binding>
        <binding name="y">
          <literal>Been Teen</literal>
        </binding>
      </result>
    </results>
</sparql>

This seems a strange design, and maybe not what you intend.

Received on Friday, 17 August 2012 05:33:15 UTC