W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > June 2006

Re: FILTER (?z)?

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Fri, 09 Jun 2006 14:47:46 +0100
Message-ID: <44897C02.7050203@hp.com>
To: Jan Wielemaker <wielemak@science.uva.nl>
CC: public-rdf-dawg-comments@w3.org



Jan Wielemaker wrote:
> Hi,
> 
> I'm writing a Prolog parser for SPARQL based on the latest document
> (April 6).  Aim is to provide SPARQL support on top of the SWI-Prolog
> semantic web libraries, but first some work to do ...

Cool!

> 
> To get the grammar debugged I'm using the SyntaxDev test-sets.  I
> understand they have no formal meaning and are not approved.  Still,
> I'd expect them to be mostly correct and there are only few syntax
> tests in the rest of the test-set.
> 
> I've trouble with the test 'syntax-keywords-01.rq':
> 
> ================================================================
> SELECT *
> WHERE { ?x FILTER:foo ?z FILTER (?z) }
> ================================================================
> 
> FILTER allows for a bracketed expression and function calls, but reading
> through the syntax this only allows for relation expressions. Skimming
> the rest of the document, I have the impression the "FILTER (?z)" is 
> illegal.  Am I right?
> 
> 	Cheers -- Jan

The expression in a FILTER evaluates to some value that is then treated as an 
Effecective Boolean Value (that is, the same as in XPath/XQuery functions and 
operators).

So ?z is an expression, albeit a simple one.  It is legal.

Details: http://www.w3.org/2001/sw/DataAccess/rq23/#ebv

Summary of the BEV rules:

+ Booleans are true/false
+ The plain literal "" is false as is xsd:string "", else any literal has a 
BEV of true.
+ Numbers have a BEV of true unless 0 when they have a BEV of false.
+ Else type error


	Andy
Received on Friday, 9 June 2006 13:48:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:50 GMT