W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > August 2012

Re: BIND semantics (2)

From: Jeremy Carroll <jeremy@topquadrant.com>
Date: Thu, 16 Aug 2012 22:32:45 -0700
Message-ID: <502DD77D.7030709@topquadrant.com>
To: public-rdf-dawg-comments@w3.org
CC: Holger Knublauch <holger@topquadrant.com>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 17 August 2012 05:33:16 GMT