Re: BIND, FILTERs and BGPs

On 14 Oct 2010, at 08:09, Andy Seaborne wrote:
> On 14/10/10 11:09, Axel Polleres wrote:
> > Just to get that right:
> >
> >>> 1/ BIND terminates the current BGP
> >>> 2/ FILTER goes after BIND in the BGP
> >
> > Sorry, I am a bit confused about what the "FILTER goes after BIND in the BGP" part
> > means... Do I understand part 2/ of this proposal correctly as follows?
> >
> > For Query1:
> >
> >    ASK { FILTER(?two = 2) . BIND(2 AS ?two) . }
> >     =:=
> >    ASK { BIND(2 AS ?two) . FILTER(?two = 2) }
> >
> > this means
> >
> > Answer: yes?
> 
> I don't understand what you are asking.  "yes" as the answer to the ASK
> or "yes" to the "Do I understand" or "yes" as in "do you agree?"

I meant to ask: Does your proposal mean that the answer to Query1 is "yes" according to your proposal...

> 
> > But for Query2:
> >
> > ASK { FILTER(?two = 2) . BIND("foo" AS ?bar) . BIND(2 AS ?two) . }
> >
> > would this mean
> >
> > Answer: no?
> 

.... and likewise that the answer to Query2 would be "no"?

> I suggest that a sequence of BINDs is considered as ending one BGP, not
> having nested BGPs subject to FILTERs.
> 
> ASK { BIND("foo" AS ?bar) . BIND(2 AS ?two) . FILTER(?two = 2) }
> 

ah, ok, gotcha, so you say all BINDs and FILTERS belong to the same group and will be ordered
in the sense that first the BINDs are evaluated lexicographically and then the FILTERs. 
that looks fine to me then in principle, it just means that the Subselect rwriting discussed 
in the last call would need to put the FILTERs outside the subselect, right?

cheers,
Axel


> BINDs need to keep their relative order.
> 
> ASK { BIND(1 AS ?one) . BIND(?one+1 AS ?two) . FILTER(?two = 2) }
> 
> > (since the first bind terminates the BGP, ?two wouldn't yet be bound?!?)
> >
> > Would - alternatively "2/ BIND goes after FILTER in the BGP" also be an option?
> 
> then the filter can not test the outcome of the BIND. I can't think of a
> reason why making the FILTER cause an error on unbound when a BIND is
> used is helpful to the application writer. Do you have use case?
> 
> { BIND(2 AS ?two) . FILTER(?two = 2) }
> same as
> { FILTER(?two = 2) . BIND(2 AS ?two) . }
> 
> makes more sense to me given we have floating FILTERs.
> 
> > (might be seen more intuitive from the viewpoint that Query1 and Query2 would behave
> > the same?)
> >
> > Thanks for clarification,
> > Axel
> 
>         Andy
> 

Received on Thursday, 14 October 2010 11:19:34 UTC