Re: BIND semantics (2)

> would it be possible for you to add to your note an example dataset


In preparing the answer to this question, I realized I had made a couple 
of minor errors in my queries - the corrected queries are below.
Please adjust my formal comment with the corrected queries.



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" .

=====

Results 1 - for all four queries using e.g. jena 2.7.2
- and for queries b) c) d) using jena 2.7.3

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

Results 2:

- for query a) using jena 2.7.3
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
   <head>
     <variable name="x"/>
     <variable name="y"/>
   </head>
   <results>
     <result>
       <binding name="x">
         <uri>http://www.youtube.com/watch?v=EyXcWDv5elk</uri>
       </binding>
     </result>
   </results>
</sparql>


Aside:
our understanding is that the Jena 2.7.3 behavior more accurately 
reflects the current LC draft, and is, in our view, undesirable - hence 
our comment on the specification.



Query a)

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


Query b)

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

Query c)

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

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

Received on Tuesday, 14 August 2012 16:52:58 UTC