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 

The example is, with the same dataset


@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>
       ?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.

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)

i.e. the correct results are:

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

This seems a strange design, and maybe not what you intend.
Received on Friday, 17 August 2012 05:33:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:13 UTC