Re: Tests for expressions : boolean effective values

Howard Katz wrote:
> Hi Andy,
> 
> What you're saying about EFB is correct. I'm wondering tho what
> does it -mean- to AND a ?x variable with something? Can you give
 > me an example of when you might want to do that?
> 
> Howard

Hi Howard -

This came up while we were discussing value testing in general.  "AND ?x" is the 
simplest case but the general case is using ?x where a boolean is required (|| 
&&, not).  And in SPARQL, we also have the extension functions which filter 
(sort of return a boolean); if we make function and casting syntax the same, 
then we have cases where "AND qn:foo(?x)" can occur as well as builtins like 
bound/isXYZ.

So booleans arise in expressions and "AND ?x" is just the simplest case.  In 
itself, it's probably not a good thing to write but I'd be loath to go round 
making the grammar exclude things based on the argument of "that's not nice" though.

 Andy

> 
>  > -----Original Message-----
>  > From: public-rdf-dawg-request@w3.org
>  > [mailto:public-rdf-dawg-request@w3.org]On Behalf Of Seaborne, Andy
>  > Sent: Thursday, February 17, 2005 11:13 AM
>  > To: RDF Data Access Working Group
>  > Subject: Tests for expressions : boolean effective values
>  > 
>  > 
>  > 
>  > Today, some of us were puzzling over boolean expressions in 
>  > XQuery/Xpath and how 
>  > they affect SPARQL.  We think that the "boolean effective 
>  > values" rules apply in 
>  > constraints and I have checked in some tests into 
>  > tests/data/Expr2 for this.
>  > 
>  > "boolean effective values" reference:
>  > http://www.w3.org/TR/xquery/#dt-ebv
>  > 
>  > and it means that:
>  > 
>  > "AND ?x" is legal.
>  > 
>  > ?x is true if the value of ?x is:
>  > 
>  > * boolean and the value of the boolean is true
>  > * a string and length(string) > 0
>  > * a numeric: number != NaN && number != 0
>  > 
>  > Anything else is "type error" which means the whole solution is rejected.
>  > 
>  >  Andy
>  > 
>  > 
>  > 
> 
> 

Received on Friday, 18 February 2005 11:06:02 UTC