W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2006

Re: Language tags and valu etetsing

From: Eric Prud'hommeaux <eric@w3.org>
Date: Sat, 4 Nov 2006 22:34:46 +0100
To: "Seaborne, Andy" <andy.seaborne@hp.com>
Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <20061104213446.GD4200@w3.org>

On Mon, Oct 23, 2006 at 05:39:16PM +0200, Eric Prud'hommeaux wrote:
> 
> On Mon, Oct 23, 2006 at 03:24:59PM +0100, Seaborne, Andy wrote:
> > ...
> > [[
> > The consequence of this rule is that extended SPARQL implementations will 
> > produce at least the same solutions as an unextended implementation, and 
> > may, for some queries, produce more solutions.
> > ]]
> > isn't true by the way - filters can be negated so more or less solutions 
> > are going to be possible with any kind of extensibility.
> 
> Exploring the results for a date comparison with or without negation,
> with or without support for xsd:date for this tests with only one of
> the FILTERs applied:
> 
> Data:
> <http://example.org/doc1> dc:date "2001-12-03T13:41"^^xsd:dateTime .
> <http://example.org/doc2> dc:date "2003-10-03"^^xsd:date .
> 
> Query:
> SELECT ?doc
>  WHERE { ?doc dc:date ?d
>          FILTER (?d > "2000-00-00T12:00"^^xsd:dateTime)    # t - TRUE
>          FILTER (!(?d < "2000-00-00T12:00"^^xsd:dateTime)) # tn - TRUE-negated
>          FILTER (?d < "2000-00-00T12:00"^^xsd:dateTime)    # f - FALSE
>          FILTER (!(?d > "2000-00-00T12:00"^^xsd:dateTime)) # fn - FALSE-negated
>        }
> 
> 	without xsd:date		with xsd:date support
> t	<http://example.org/doc1>	<http://example.org/doc1>
> 					<http://example.org/doc2>
> tn	<http://example.org/doc1>	<http://example.org/doc1>
> 					<http://example.org/doc2>
> f
> fn
> 
> That is, f and fn get no results.
> Can you come up with a case that meets our notion of monotinicity that
> violates this "produce at least the same solutions" assertion?

Per suggestion from AndyS on IRC, I tried !("foo"@en != "foo"@EN) with
and without lang support and still find it to be dawg:monotonic.
(AndyS, sorry it took so long to respnd -- suffered some mission creep.)

eric@unagi:~/sources/public/perl/modules/W3C/Rdf/bin$ ./algae --summary  --manifest /home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/manifest-lang-case-sensitivity.ttl

Note, I put this into a side manifest because we have not reached
consensus on how to designate particular extensions.


executing lang-case-sensitive-eq "'xyz'@en = 'xyz'@EN"
  reading <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity.ttl>
  executing query <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity-eq.rq>
  expect <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitive-eq.srx>
+-------------------+--------+-------------------+--------+
|                 x1|      v1|                 x2|      v2|
|-------------------|--------|-------------------|--------|
|<http://example/x2>|"xyz"@en|<http://example/x2>|"xyz"@en|
|<http://example/x3>|"xyz"@EN|<http://example/x3>|"xyz"@EN|
+-------------------+--------+-------------------+--------+

That is, "'xyz'@en was not found to be equal to 'xyz'@EN"


executing lang-case-insensitive-eq "'xyz'@en = 'xyz'@EN with mfx:LangCaseInsensitivity"
  require http://jena.hpl.hp.com/2005/05/test-manifest-extra#LangCaseInsensitivity
  reading <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity.ttl>
  executing query <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity-eq.rq>
  expect <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-insensitive-eq.srx>
+-------------------+--------+-------------------+--------+
|                 x1|      v1|                 x2|      v2|
|-------------------|--------|-------------------|--------|
|<http://example/x2>|"xyz"@en|<http://example/x2>|"xyz"@en|
|<http://example/x2>|"xyz"@en|<http://example/x3>|"xyz"@EN|
|<http://example/x3>|"xyz"@EN|<http://example/x2>|"xyz"@en|
|<http://example/x3>|"xyz"@EN|<http://example/x3>|"xyz"@EN|
+-------------------+--------+-------------------+--------+

With LangCaseInsensitivity, "'xyz'@en is equal to 'xyz'@EN"


executing lang-case-sensitive-ne "'xyz'@en != 'xyz'@EN"
  reading <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity.ttl>
  executing query <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity-ne.rq>
  expect <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitive-ne.srx>
+--+--+--+--+
|x1|v1|x2|v2|
|--|--|--|--|
+--+--+--+--+

Without LangCaseInsensitivity, "'xyz'@en is not != to 'xyz'@EN" (it
gets a type error instead.)


executing lang-case-insensitive-ne "'xyz'@en != 'xyz'@EN with mfx:LangCaseInsensitivity"
  require http://jena.hpl.hp.com/2005/05/test-manifest-extra#LangCaseInsensitivity
  reading <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity.ttl>
  executing query <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-sensitivity-ne.rq>
  expect <file://unagi/home/eric/WWW/2001/sw/DataAccess/tests/data/OpenWorld/lang-case-insensitive-ne.srx>
+--+--+--+--+
|x1|v1|x2|v2|
|--|--|--|--|
+--+--+--+--+

With LangCaseInsensitivity, "'xyz'@en is not != to 'xyz'@EN" beacuse
they are considered equal.


> > That's why "!=" should mean "not known to be unequal" and not "not(known to 
> > be equal)"
> 
> This is a separate issue, I believe. In XQuery, you are assumed to be
> doing something wrong if you compare anything outside the standard
> mapping, even to find out it is not equal. In SPARQL, we have to
> decide if we want that same functionality, or change RDFterm-equal [TEQ]
> [[
> Returns TRUE if term1 and term2 are the same RDF term as defined in
> Resource Description Framework (RDF): Concepts and Abstract Syntax
> [CONCEPTS]; produces a type error if the arguments are both literal
> but are not the same RDF term; returns FALSE otherwise. term1 and
> term2 are the same if any of the following is true:
> ]]
> to
> [[
> Returns TRUE if term1 and term2 are the same RDF term as defined in
> Resource Description Framework (RDF): Concepts and Abstract Syntax
> [CONCEPTS]; produces a type error if either of the arguments is a
> literal but is not a supported term; returns FALSE otherwise. term1
> and term2 are the same if any of the following is true: 
> ]]
> to add = and != tests for all the supported types.
> 
> [TEQ] http://www.w3.org/2001/sw/DataAccess/rq23/rq24#func-RDFterm-equal
-- 
-eric

home-office: +1.617.395.1213 (usually 900-2300 CET)
	    +33.1.45.35.62.14
cell:       +33.6.73.84.87.26

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.
Received on Saturday, 4 November 2006 21:33:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:27 GMT