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

Re: BIND, FILTERs and BGPs

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Thu, 14 Oct 2010 12:09:04 +0100
Message-ID: <4CB6E4D0.4020405@epimorphics.com>
To: Axel Polleres <axel.polleres@deri.org>
CC: Lee Feigenbaum <lee@thefigtrees.net>, SPARQL Working Group <public-rdf-dawg@w3.org>


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?"

> But for Query2:
>
> ASK { FILTER(?two = 2) . BIND("foo" AS ?bar) . BIND(2 AS ?two) . }
>
> would this mean
>
> Answer: 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) }

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:09:44 GMT

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