W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > August 2002

Re: Syntax-level typing (was Re: A data typing proposal)

From: Patrick Stickler <patrick.stickler@nokia.com>
Date: Tue, 06 Aug 2002 10:09:13 +0300
To: ext Sergey Melnik <melnik@db.stanford.edu>, "R.V.Guha" <guha@guha.com>
CC: RDF Core <w3c-rdfcore-wg@w3.org>
Message-ID: <B97550C9.19971%patrick.stickler@nokia.com>

On 2002-08-02 14:28, "ext Sergey Melnik" <melnik@db.stanford.edu> wrote:

> R.V.Guha wrote:
>> ...
>> The simplest thing I can think of is to say that the literal always
>> denotes the string, unless there is an explicit xsd attribute which
>> specifies some other data type. Life just becomes so much simpler ...
> Let me elaborate a bit on the above. If what comes below is not what
> Guha had in mind, I apologize; call it syntax-level typing, anyway.
> The simplest things to do might be to make the primitive XSD datatypes
> part of RDF abstract syntax and tackle an extensible generic typing
> scheme later on (in WebOnt or RDF 2.0).
> In essence, we could assume that typed values can be referred to
> directly in the graph, without using their lexical forms. So, we simply have
> Jenny --age--> (int)5
> where (int)5 is a literal, just like "5" is another one. URIs like
> xsd:integer denotes the class of integers (as defined in XSD), so that
> age --rdfs:range--> xsd:integer
> has the expected effect.
> Typed literals as used above would be opaque to RDF; their
> interpretation be fixed. An extended serialization syntax needs to be
> used to distinguish (int)5 from "5". For RDF/XML we could simply use the
> XSD syntax, e.g.:
> <age xsi:type="xsd:integer">5</age>
> It would be the task of the parser to look at the xsi:type declaration
> and generate the correct triples. Other RDF syntaxes (e.g., NTriples)
> would have to design their own means of encoding typed values.
> All idioms that we've been discussing go away. Later on, other ways of
> referring to typed literals (e.g., using our idioms or URI-schemes) can
> be developed along with an extensible type system for RDF, which would
> allow defining derived types etc.
> The syntax-level typing sketched above does not require (but of course,
> can leave with) untidiness. In fact, typed literals like (int)5 can be
> mapped directly to say Java built-in types.
> Sergey

Well, ahem, this was basically the URV idiom that I tossed on the table
nearly a year ago.

And it requires no changes to RDF whatsoever. Just use a URI to denote
the typed literal which denotes the value in question. Done.

C.f. http://ietf.org/internet-drafts/draft-pstickler-val-01.txt

Yes, one may want to have some syntactic sugar in e.g. N3 to make
typing easier, but that's a secondary issue.


Patrick Stickler              Phone: +358 50 483 9453
Senior Research Scientist     Fax:   +358 7180 35409
Nokia Research Center         Email: patrick.stickler@nokia.com
Received on Tuesday, 6 August 2002 03:09:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:24:14 UTC