W3C home > Mailing lists > Public > www-rdf-logic@w3.org > November 2001

RE: literals and typing

From: <Patrick.Stickler@nokia.com>
Date: Tue, 13 Nov 2001 10:42:28 +0200
Message-ID: <2BF0AD29BC31FE46B788773211440431621767@trebe003.NOE.Nokia.com>
To: geoff@sover.net, www-rdf-logic@w3.org
 

-----Original Message-----
From: ext Geoff Chappell [mailto:geoff@sover.net]
Sent: 06 November, 2001 19:16
To: www-rdf-logic@w3.org
Subject: literals and typing


I've been taking a look at the current MT draft and the proposed changes for
datatyping. I've been trying to understand what it might be like to work
with from an implementation standpoint. Any MT gurus out there want to take
a look at the following dump of my thinking and shoot it full of holes where
appropriate?
 
First, I don't think it presents any great mental hurdle for anyone
(including programmers) to understand that the interpretation of a
particular literal is dependant upon its context. We all speak languages
after all where this is true (the same word often denotes different things
with the sense only discernable from context). It's only in the land of the
uri that this is in theory not true (by definition). That said, I initially
thought it would be painful for a reasoning system used in real world
applications not to have local datatyping. After some playing around, I
realized that it might very well be painful for a _reasoning system_ but not
so much of a problem if _rdf_ didn't.
 

Meaning, if I understand you, that the RDF layer should not itself provide
for any interpretation
of literals or mapping of lexical forms to value spaces, but merely preserve
the typing information
about the literal (either locally defined or via rdfs:range) so that it is
available to applications
operating on RDF encoded knowledge?
 
If so, then I *wholeheartedly* agree. Absolutely. Interpretation of literals
is outside the scope
of RDF proper.

I'm going to use rdfql below (the sql-like query language used in RDF
Gateway). A quick primer: {} surround triples, [] surround uris, single
quotes('') surround literals, triple order is PSO.
 
Today if we:
    insert {[age] [fido] '9'} into xxx
followed by
    select ?a using xxx where {[age] [fido] ?a}
will return a value for ?a of 9, type literal
 
I would expect that regardless of further datatype information this would
always be the response.
 
But given:
    {[rdfs:range] [age] [xsd:integer]}
and
    infer {[typedValue] ?l ?v} from {[rdf:type] ?l [xsd:integer]} and
?v=int(?l)
 
where the function int() would be provided by the reasoning system to
convert decimally encoded literals to integers.
 
I would expect that I could
    select ?v using xxx where {[age] [fido] ?a} and {[typedValue] ?a ?v}
would return a value of ?v of 9, type integer
 
Probably would be clearer if rdfql had a function definition syntax so we
could say
    ?v=typedValue(?l) where {[rdf:type] ?l [xsd:integer]} and ?v=int(?l) 
and so
    select ?v using xxx where {[age] [fido] ?a} and ?v=typedValue(?a)
just to take the conversion from literals to typed values firmly out of the
rdf triple space
 
 
It seems that it is the job of the reasoning system to actually extract the
literal value from the literal (though RDF describes the rules - expressed
in type and range relationships - by which this can be done). And it doesn't
appear that it would be difficult to implement in practice.
 

Right. Interpretation of literals is the job of the application (which may
be a reasoning system, or a query
API, or a general API, etc. and that interpretation, and the system internal
canonical representation that
lexical forms are mapped to, can change from application to application,
system to system.
 
RDF just needs to keep track of the critical information, maintain context
for literals relevant to determining
originally defined type, and provide for logical inference about type
relations independent of lexical forms.
 
Yep. That's a nice clear line that can be drawn.

One difficulty might be if you wanted to express in RDF equivalence
conditions based upon literals (i.e. two names denote the same person if
they are associated with the same email address through property foaf:mbox).
But I guess that's just the situation - either RDF has knowledge of
builit-in intrinsic datatypes or it doesn't. (and RDF doesn't do equivalence
so...)

But such equivalence is simply expressed in RDF as additional statements,
and the source of
those statements can be humans who explicitely state such equivalence,
reasoning agents who 
deduce/infer the equivalence (possibly interpreting literals and mapping
them to internalized
values for comparison), etc.
 
The RDF or RDFS layers themselves do not need to address these issues. RDF
need
not (and should not) have any "built-in intrinsic datatypes". Definitely
not.
 
However, once those equivalence relations are defined in terms of RDF and
RDFS, one can operate on that knowledge just as on any other RDF encoded
knowledge.
 
Cheers,
 
Patrick

--
Patrick Stickler                      Phone:  +358 3 356 0209
Senior Research Scientist             Mobile: +358 50 483 9453
Nokia Research Center                 Fax:    +358 7180 35409
Visiokatu 1, 33720 Tampere, Finland   Email:  patrick.stickler@nokia.com
  
Received on Tuesday, 13 November 2001 04:36:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:16:02 UTC