W3C home > Mailing lists > Public > semantic-web@w3.org > August 2007

Re: RDF's curious literals

From: Richard Cyganiak <richard@cyganiak.de>
Date: Thu, 2 Aug 2007 00:41:07 +0200
Message-Id: <49D176E7-F8E2-4B51-B2C3-C7B662C963CD@cyganiak.de>
Cc: Bruce D'Arcus <bdarcus@gmail.com>, Tim Berners-Lee <timbl@w3.org>, Sandro Hawke <sandro@w3.org>, Story Henry <henry.story@bblfish.net>, Semantic Web <semantic-web@w3.org>
To: Garret Wilson <garret@globalmentor.com>

Garret,

On 1 Aug 2007, at 21:38, Garret Wilson wrote:
> Bruce D'Arcus wrote:
>> Not having been involved in any of this, I wouldn't be surprised  
>> if there wasn't a fair bit of pressure from the W3C community to  
>> have a notion of datatype in RDF that could be more-or-less  
>> consistent with datatypes used in other W3C efforts (say, XML  
>> Schema and XQuery). Surely that would be a good enough reason,  
>> even if it might not be the best technical reason.
>
> That's probably a good idea---I want to use the way XML Schema  
> models integers and booleans and such.
>
> That doesn't mean we have to create some new thing called  
> rdfs:Literal in the RDF model. We could just as easily construct a  
> URI identifier from the XML Schema datatype URI, combined with the  
> lexical form in question. This would allow integers and such to be  
> used just like any other RDF resource, but could leverage all the  
> semantics provided by XML Schema.

rdfs:Literal is not what you think. From your writing, it sounds as  
if you believe that rdfs:Literal is the class of all things that are  
represented as "foo"^^ex:bar in the RDF abstract syntax (what you  
call the “RDF model”). But in fact, rdfs:Literal is the value space  
of the lexical-to-value mapping functions of all known datatypes. In  
other words, "1"^^xsd:int is an rdfs:Literal, but "Bob"^^xsd:int is  
not, because it's not well-formed. The lexical-to-value mapping of  
xsd:int doesn't map "Bob" to anything.

In the semantics for your proposed alternative abstract syntax, where  
typed literals are represented like <http://example.com/int/1>, you  
probably still would want to use L2V mappings because they could tell  
you that <http://example.com/int/1> and <http://example.com/int/0001>  
denote the same thing. So there might still be some benefit in having  
an rdfs:Literal class. <http://example.com/int/1> would be an  
rdfs:Literal, but <http://example.com/int/Bob> would not.

To summarize: rdfs:Literal does *not* exist because literals are  
represented differently from other resources in the RDF abstract  
syntax. It does exist because lexical-to-value mappings are used in  
the RDF semantics. (I speculate that the motivation for having L2V  
mappings in RDF semantics was a desire to re-use XSD datatypes, which  
already existed with well-defined L2V mapping functions.)

This doesn't invalidate your main point though, which is about how  
literals ought to be represented in the RDF abstract syntax.

As another interesting aside: Are you aware that all RDF datatypes,  
such as xsd:int, xsd:string and that you might define yourself, are  
also RDFS classes that contain exactly the members of the datatype's  
value space? In other words, the only thing that stops you from saying

     "1"^^xsd:int rdf:type xsd:int .

is the fact that RDF doesn't allow literals in the subject position.  
If we use the workaround and define that

     <http://example.com/int/1> = "1"^^xsd:int .

then it follows that

     <http://example.com/int/1> rdf:type xsd:int .

is true.

This entailment is in RDF Semantics to make rdfs:range work not just  
with “ordinary” classes but also with RDF datatypes, which therefore  
must be defined as classes as well.

> Reusing work done by XML Schema does not mean we can't have a  
> consistent RDF data model---we could easily do both. If the hardest  
> problem we're having here is coming to consensus on how to combine  
> an XML Scheme datatype URI and a lexical form into a combined URI,  
> that's a small problem indeed. *Any* such URI would be better than  
> making the RDF data model inconsistent, as has been done.

I think you have made a decent case that the RDF abstract syntax does  
not necessarily need the distinction between URIs and literals. I  
don't think you have demonstrated that the RDF abstract syntax is  
*inconsistent*.

Best,
Richard


>
> Garret
>
>
Received on Wednesday, 1 August 2007 22:42:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:17 GMT