Re: "in-scope" and BIND question

On 10/05/12 10:44, Polleres, Axel wrote:
>> Do you have suggestions? (I note the definition is based on your
>> suggestions)
>
> Right, but that pre-dated BIND, AFAIR... Anyways, I will think of something.
> In principle, I ask myself, why we have to restrict the use of variables assigned to
> in BIND *at all* except for not using variables within the expression on the LHS of the "AS".
>
>> Maybe something needed for across a group?
>
> Hmm, it seems to me that the current clause 12. in the grammar restrcitions
> tries to prohibit something like this:
>
> {
>   BIND ( ?X1 AS ?Y)
>   BIND ( ?X2 AS ?Y)

Yes - that's trying to set ?Y in each row two different ways.

This is not a join.

> }
>
> right? But I am not sure about whether we also want to prohibit this one:
>
> {
>   BIND ( ?X1 AS ?Y)
> }
> {
>   BIND ( ?X2 AS ?Y)
> }

By bottom up evaluation that's got to be possible.

It's a join of two sub-expressions.

The sub-expressions set the ?Y column and each is independent (eval'ed 
before the join).

> Anyways, I'll try to check through the "history" again and re-think.

Thanks.

	Andy

>
> Best,
> Axel
>
>
>> -----Original Message-----
>> From: Andy Seaborne [mailto:andy.seaborne@epimorphics.com]
>> Sent: Thursday, 10 May 2012 11:07 AM
>> To: public-rdf-dawg@w3.org
>> Subject: Re: "in-scope" and BIND question
>>
>>
>>
>> On 09/05/12 15:27, Polleres, Axel wrote:
>>> I havea a question on in-scope variables and BIND, particularly, on
>>> item 12. in
>>> http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlGrammar
>>> # " The variable assigned in a |BIND| clause must not be already
>>> in-scope<http://www.w3.org/TR/sparql11-query/#variableScope>.
>>> "
>>> I am not sure here, what "already" in-scope means. Can we
>> clarify that?
>>
>> Do you have suggestions? (I note the definition is based on your
>> suggestions)
>>
>>> Particularly, when reading the in-scope definition, I am a
>> bit unsure
>>> of what happens with regards to e.g. UNION queries, i.e. my
>> feeling is
>>> that SELECT * { { BIND (1 AS ?Y) } UNION {<s>  <p>  ?Y } }
>> shouldn't be
>>> different from SELECT * { {<s><p>  ?Y } UNION { BIND (1 AS
>> ?Y) } } and
>>> both should be allowed (returning 1 on the empty graph), is that
>>> correct?
>>
>> This is legal.  Scope as defined works bottom-up.
>>
>> Maybe something needed for across a group?
>>
>> 	Andy
>>
>>> thanks,
>>> Axel
>>> --
>>> Dr. Axel Polleres
>>> Siemens AG Österreich
>>> Corporate Technology Central Eastern Europe Research&
>> Technologies CT
>>> T CEE
>>> Tel.: +43 (0) 51707-36983
>>> Mobile: +43 (0) 664 88550859
>>> Fax: +43 (0) 51707-56682 mailto:axel.polleres@siemens.com
>>

Received on Thursday, 10 May 2012 10:30:40 UTC