- From: Andy Seaborne <andy.seaborne@epimorphics.com>
- Date: Fri, 24 Aug 2012 14:56:33 +0100
- To: public-rdf-dawg@w3.org
On 24/08/12 14:00, Steve Harris wrote:
> OK, but what was the strange behaviour of the LC1-2 design which caused us to change it in the first place?
Unclarity esp. of the informal text. The 3LC was an attempt to minimise
change - I messed it up by not properly considering the scope of the
expression and it didn't work.
Andy
>
> Sorry if I missed some discussion, but I imagine it wasn't done on a whim…
>
> - Steve
>
> On 24 Aug 2012, at 11:47, Andy Seaborne wrote:
>
>> 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 13:57:03 UTC