Re: 'FILTER' '(' Expression ')'

Eric Prud'hommeaux wrote:
> "{ ?p ?s ?o FILTER ?x = q:name () ?p ?o2 }" was ambiguous so AndyS,
> DaveB, SteveH, and Jeen decided we'd put parens around the filter
> expression.

AndyS wasn't expressing an opinion one way or the other in the discussion.

 > AndyS proposed an exception for FILTER (REGEX(?a, ?b)) but
> the rest of us dragged our feet.

Regular expressions seem to be a common feature that people use with RDQL/Jena. 
  It is also a source of many questions as to the syntax.

The fully nested form

FILTER (REGEX(?a, "substring"))

is unnnecessarily bracketted.

 >
 > example test:
 >
 > 
http://www.w3.org/2005/01/yacker/uploads/sparqlTest?lang=perl&text=PREFIX+%3A++%3Chttp%3A%2F%2Fexample.org%2Fns%23%3E+%0D%0ASELECT+*%0D%0A%7B+OPTIONAL+%7B+%3Aa+%3Ab+%3Ac+%7D+.+%3Fx+%3Fy+%3Fz+FILTER+%28%3Fx+%3C+%3Fy%29+%7D%0D%0A&action=validate+text
 >

I have tested requiring () on filters, except REGEXs, and it seems to work out OK.

As we accepted the syntax tests yesterday, and they would need to change, I have 
not made any changes until it is clear I can or shouldn't.

There are 3 syntax tests to change and there are about 11 examples to change 
from rq23.

 Andy


PS

== Aside

Note that this does not avoid the other parser issue around this area:

  FILTER ?x = q:name ()

has to greedily accept the () because

  FILTER ?x = q:name

is also legal.

It's common - example - "?x" and "?x + 2"

This is because we use qnames for functions and for expression constants.  Using 
"&" for function call / cast does not have this matter.  I am not proposing this 
as a solution - just giving a complete account.

Received on Wednesday, 8 June 2005 13:44:48 UTC