agiorguk / gemini

Resources relating to the UK Gemini metadata profile
5 stars 3 forks source link

2020-14: Obscure point on negative dates (Peter) #4

Open PeterParslow opened 3 years ago

PeterParslow commented 3 years ago

https://www.agi.org.uk/40-gemini/1048-uk-gemini-encoding-guidance#2.2 section 2.2.3 states “gco:Date and gco:DateTime XML elements do not accept negative values.” But ISO 19139 gco:Date and gco:DateTime are both implemented as xs:date and https://www.w3.org/TR/xmlschema-2/#date does allow negative years. ISO 8601 allows them “by mutual agreement”, and their presence in the XML standard seems to give that agreement. Suggestion: change section 2.2.3

(Reading up on this has made me realise that these bug identifiers could be mistaken for ISO 8601 month references. Well, not -13 & on!)

PeterParslow commented 1 week ago

I don't think we can say "However, gco:Date and gco:DateTime XML elements do not accept negative values.", as was done in PR #4, because "gco" shows that we're discussing the ISO 19139 Date / DateTime and those explicitly include the XML xs:date/xs:dateTime. ISO 19139 includes a paragraph effectively saying this is a cludge - but that's for different reasons!

Given that GEMINI ties itself to the Gregorian calendar, and (according to a few things on the web!) negative dates in the Gregorian calendar can be ambiguous & inaccurate, perhaps we should say "Given the limitations of negative dates in the Gregorian calendar, these should only be used with care. Given the uses that these data types are put to in GEMINI, this is not expected to be an issue."

Background/aside:

ISO 19115:2003's Date & DateTime are imported from ISO/TS 19103:2005, which I don't have access to. The way those are defined in the UML model as a collection of CharacterStrings (which is still accessible within http://iso.sparxcloud.com/index.php doesn't state a limitation), but there may have been a "non-negative" restriction in the text. I do have old "committee member" access to the second edition of ISO 19103 (2015) which does not say anything about negative/non-negative, but refers on to ISO 8601 & ISO 19108.

The new (soon to be released) ISO 19103 says that its "Date" represents an ISO/IEC 11404:2007 " data type whose values are points in time to a temporal resolution of a day." ISO 19103 will also restrict Date values to the Gregorian calendar. Apparently it is possible (but 'use with caution') to have -ve Gregorian calendar dates.