W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2007

Re: Comparing with <=

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Fri, 31 Aug 2007 15:48:02 +0100
Message-ID: <46D82A22.10001@hp.com>
To: Lee Feigenbaum <lee@thefigtrees.net>, 'RDF Data Access Working Group' <public-rdf-dawg@w3.org>
CC: Eric Prud'hommeaux <eric@w3.org>

Lee Feigenbaum wrote:
> + <= on equivalent RDF terms with unknown datatypes in 
> open-world/open-cmp-02 (issue for EricP / AndyS ?)

A datatype includes a function from lexical space to value space.  Because 
it's a function, for two literals, if sameTerm(x,y), then the lexical forms 
are the same so if they are legal for the datatype, then x has the same value 
as y.  This is regardless of whether a datatype is know to the SPARQL 
processor or not.

Intuitively, "x = y" implies "x <= y"

open-cmp-02.rq is the query
PREFIX      :    <http://example/>
PREFIX  xsd:    <http://www.w3.org/2001/XMLSchema#>

SELECT ?x ?v1 ?v2
     ?x :p [ :v1 ?v1 ; :v2 ?v2 ] .
     FILTER ( ?v1 <= ?v2 || ?v1 > ?v2 )

In the operators table, <= is defined for various pairs of types but only for 
known types.

XPath/XQuery defines <= (called "le") as fn:not( the > operator ) for each type.

But in SPARQL things are open : can have partial extended types implemented 
(e.g. value based "=", not all of "<").


1/ Test change

Change the test from:
     FILTER ( ?v1 <= ?v2 || ?v1 > ?v2 )
     FILTER ( ?v1 = ?v2 || ?v1 < ?v2 || ?v1 > ?v2 )

This is splits up the <= which is a bit ugly IMHO.

2/ Spec change

Define "A <= B" to be  "A = B || A < B" (this needs only doing once).
Define "A => B" to be  "A = B || A > B" (this needs only doing once).

Then define A < B and A > B as before.

A type error situation becomes legal in an unextended implementation 
("x"^^:unknown <= "x"^^:unknown ) which is what the test says.

Another point: people have been reporting not failing the test so either they 
pass it, or don't run because xsd:date is not supported.  So the test change 
is potentially more work.


Hewlett-Packard Limited
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England
Received on Friday, 31 August 2007 14:48:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:00:51 UTC