W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2010

Re: BIND, FILTERs and BGPs

From: Axel Polleres <axel.polleres@deri.org>
Date: Thu, 14 Oct 2010 08:18:54 -0300
Cc: "Lee Feigenbaum" <lee@thefigtrees.net>, "SPARQL Working Group" <public-rdf-dawg@w3.org>
Message-Id: <6941DA20-727F-4625-9960-F9A14E5D6DAD@deri.org>
To: "Andy Seaborne" <andy.seaborne@epimorphics.com>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:44 GMT