Re: Date Representation Best Practice

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 UTC