W3C home > Mailing lists > Public > www-rdf-interest@w3.org > November 2002

Re: Date Representation Best Practice

From: Patrick Stickler <patrick.stickler@nokia.com>
Date: Fri, 15 Nov 2002 08:17:46 +0300
To: "Ian Davis" <iand@internetalchemy.org>, www-rdf-interest@w3.org, Patric k Stickler <patrick.stickler@nokia.com>
Message-ID: <SLXQxBV6jZjn.htKl2MGP@mail.nokia.com>


Ian,

The new datatyping facilities in RDF will facilitate
what you want to do. What you are dealing with
are values, not strings, and even though folks 
use various lexical representations for dates in
the RDF, they are (almost) always denoting the
value, not the string.

To that end, you will want to use typed literals, which
are lexical forms paired with an explicit datatype (e.g.
one of the XML schema date/time types), to express
your values. 

Whether you use complete datetime values or break
them into complex subgraphs is up to you. In any case,
you will still have to parse the lexical forms into system
specific value representations to make comparisons.

I've been putting together a Java library for working with
RDF typed literals, and while very much alpha, it does
support xsd:dateTime values. Have a look. Perhaps
it will prove useful, at least as an example:

http://www-nrc.nokia.com/sw/datatypes.zip
 
Have a look at the Test class for usage examples.

Cheers,

Patrick

[Patrick Stickler, Nokia, +358 40 8019690, patrick.stickler@nokia.com] 

_____________Original message ____________
Subject:	Date Representation Best Practice
Sender:	ext Ian Davis <iand@internetalchemy.org>
Date:		Fri, 15 Nov 2002 07:48:43 +0300


Hi all,

I'm experimenting with an application that ties people and
historical events together and have a question regarding the
representation of dates. Currently most RDF applications I have seen
use a literal date representation, utilizing one of the various
standard date formats.

However, this representation requires additional date logic within the
RDF application. In order to answer questions such as "In what year
did a man first walk on the moon?" the application must first seek
the date literal for the event and then parse it to determine the
year.

I've been looking at representing the dates as resources. This lets me
make assertions about each date such as year, month and day. To answer
my question above I then ask for the year of the date of the event. I
can also assert other relationships with other dates such as before
and after which should enable me to find the first man on the moon by
finding a moon walk event such that there are no moon walk events
before it.

Aside from the practical considerations of generating resources for
all possible dates, are there any other reasons why one would favour
literals over resources? Will the proposals for data typing literals
cover date relationships?

Ian
Received on Friday, 15 November 2002 01:18:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:57 GMT