- From: Andy Seaborne <andy.seaborne@epimorphics.com>
 - Date: Fri, 24 Aug 2012 11:47:06 +0100
 - To: SPARQL Working Group <public-rdf-dawg@w3.org>
 
This completes ACTION-673.
The design has been reverted to that of 1LC and 2LC
1/ Informative text changed.
2/ Variable Scope section has a paragraph specifically on BIND
3/ Algebra translation translation reverts to previous text (and special 
on BIND removed)
No execution tests are invalidated.
Reverting the scope rules affects syntax tests:
     syntax-BINDscope7.rq
     syntax-BINDscope8.rq
which are now bad syntax.
A few notes about the BIND fix:
This is illegal under both designs:
SELECT *
{
    ?s ?p ?o
    BIND("foo" AS ?o)
}
This is illegal on the reverted design:
SELECT * {
     ?s ?p ?o
     OPTIONAL{?s ?p2 ?o2}
     BIND(5 AS ?o2)
}
And note adding {} (which are not a subquery with project) does not make 
any difference:
SELECT *
{
    { ?s ?p ?o }
    BIND("foo" AS ?o) # Bad
}
because it is still a previous element of a group so the accumulated 
scope of that element shows up in the group BIND is in - i.e. it 
includes all of { ?s ?p ?o }
which makes sense because we want BIND to apply a previous element like:
SELECT * {
    { ?s ?p ?o } UNION {?s ?p2 ?o2}
    BIND(5 AS ?o)       # Bad
   }
Legal: masked
SELECT *
{
    { SELECT ?s { ?s ?p ?o } }
    BIND("foo" AS ?o) # GOOD
}
Legal: scope rules do not extend outwards of {} in which BIND is used.
SELECT *
{
    { ?s ?p ?o }
    UNION
    { BIND("foo" AS ?o) } # GOOD
}
Received on Friday, 24 August 2012 10:47:34 UTC