Inequality and type errors


Some of the open-world tests fail on my SPARQL implementation in Elixir [1]. These tests seem to suggest that the != operator should treat type errors as false, although there's no hint on this behaviour in the spec. For example, the open-eq-08 test states that the result for this query:

PREFIX : <http://example/>
PREFIX  xsd: <>
    ?x1 :p ?v1 .
    ?x2 :p ?v2 .
    FILTER ( ?v1 != ?v2 )

over this data:

@prefix : <http://example/> .
@prefix  xsd: <> .
:x1 :p "xyz" .
:x2 :p "xyz"@en .
:x3 :p "xyz"@EN .
:x4 :p "xyz"^^xsd:string .
:x5 :p "xyz"^^xsd:integer .
:x6 :p "xyz"^^:unknown .
:x7 :p _:xyz .
:x8 :p :xyz .

should include almost all permutations. I'm not seeing how this behavior can be explained with the spec, which defines != as the fn:not negation of the respective equality comparison according to the types. The equality comparisons are defined to result in almost all cases with different types in a type error. With fn:not defined to produce an error if its argument is an error, all the inequality comparisons in this example should result in a rejection of the solution, which my implementation exactly does. 

Kind regards
Marcel Otto


Received on Saturday, 27 October 2018 16:08:57 UTC