[tdwg-content] date elements in Darwin Core XML schemas

John Wieczorek tuco at berkeley.edu
Wed Jul 20 01:03:09 CEST 2011


Geoffrey Allen has asked for a clarification about the date fields in
Darwin Core. Commentary about the problem is recorded in Issue 118
(http://code.google.com/p/darwincore/issues/detail?id=118) in the
Darwin Core Issue Tracker. Below is an excerpt of my explanation. The
bottom line for this mailing list is that I believe Geoffrey has
revealed an error in the XML Schema
http://darwincore.googlecode.com/svn/trunk/xsd/tdwg_dwcterms.xsd that
should be amended. I'm posting it here for commentary to see if there
is/was any good reason for restricting the dateTime elements in Darwin
Core more than in the recommendation in the definition of the terms.
If not, this is a proposal to change the types in that schema from
xs:dateTime to dateTimeISO.

Commentary from Issue 118 follows:

Through the date terms (eventDate, dateIdentified,
relationshipEstablishedDate, measurementDeterminedDate,
dcterms:modified) in the Darwin Core recommend the ISO 8601 standard
for dates, the XML application schema published at
http://darwincore.googlecode.com/svn/trunk/xsd/tdwg_dwcterms.xsd
implements the more restrictive xs:dateTime type for these terms. For
example,

<xs:element name="eventDate" type="xs:dateTime"
substitutionGroup="dwc:anyEventTerm"/>

I'm not sure what the rationale was for implementing these terms as
xs:dateTime rather than the less restrictive type dateTimeISO (see
below) defined in
http://darwincore.googlecode.com/svn/trunk/xsd/tdwg_basetypes.xsd,
especially since
http://darwincore.googlecode.com/svn/trunk/xsd/tdwg_dwcterms.xsd
imports that bastypes schema and has a comment specifically about the
use of dateTimeISO, which it doesn't actually use. I believe this is
an unintentional error in tdge_dwcterms.xsd, but will post this to the
tdwg_content list to see if there is any dissenting opinion about
"correcting" it.

<xs:simpleType name="dateTimeISO">
<xs:annotation>
<xs:documentation xml:lang="en">
The date and time expressed in a way conforming to a subset of ISO
8601. Meant to be exactly the same as DateTimeISO defined in ABCD.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d\d\d\d(\-(0[1-9]|1[012])(\-((0[1-9])|1\d|2\d|3[01])(T(0\d|1\d|2[0-3])(:[0-5]\d){0,2})?)?)?|\-\-(0[1-9]|1[012])(\-(0[1-9]|1\d|2\d|3[01]))?|\-\-\-(0[1-9]|1\d|2\d|3[01])"></xs:pattern>
</xs:restriction>
</xs:simpleType>


More information about the tdwg-content mailing list