Re: boolean operators and type errors

Jeen Broekstra wrote:
> So how does this affect querying?
> 
> Let's look again at Tim's example scenario. There was no smoke, and the 
> temparature is uncomparable to 40. The question he wants to ask is if 
> there is any smoke or if the temperature is above 40.
> 
> In RDF:
> 
> data:
>   :detector :temperature "garbled"^^my:UnknownDT .
>   :detector :smoke 0.
> 
> query:
>    SELECT ?smoke ?temp
>    WHERE { :foo :smoke ?smoke ;
>                 :temperature ?temp
>        FILTER (?smoke = 1 || ?temp > 40).
>       }
> 
> result using LC truth table: ( F || E -> F ):
>   no results.
> 
> result using SQL truth table: ( F || E -> E):
>   no results.
> 
> At first, no difference. (arguably in the SQL scenario one should give 
> back an error of some kind, I'll get back to that later).
> 
> However, the difference becomes apparent if we slightly alter the query 
> by using a NOT:
> 
>    SELECT ?smoke ?temp
>    WHERE { :foo :smoke ?smoke ;
>                 :temperature ?temp
>        FILTER (not(?smoke = 1 || ?temp <= 40)).
>       }
> 
> result using LC truth table:  (not(F || E) -> not(F) -> T )
>  ?smoke ?temp
>  0      "garbled"^^my:UnknownDT
> 
> result using SQL truth table: (not(F || E) -> not(E) -> E )
>   no results.

Crud, there is a stupid error in this example: of course the filter 
condition in the second query is not logically equivalent to the one in 
the first: it should be ?smoke = 0 but then the conclusion does not hold 
(because that query gives no results). Disregard please.

Nevertheless the conclusion that the behavior in combination with 
negation is counterintuitive in the LC scenario still holds IMHO. Will 
try and come up with a better example.

(and I thought I checked it thoroughly, sorry about that)

Jeen

Received on Wednesday, 7 September 2005 15:29:46 UTC