TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
276 stars 88 forks source link

Update data.temporal.iso #2249

Open rettinghaus opened 2 years ago

rettinghaus commented 2 years ago

TEI should adopt the updates to ISO 8601 published in 2019.

E.g. it eliminates the possibility to encode "24:00", which we specifically address in the remarks in data.temporal.iso.

However, it needs to be discussed if this will be just a minor update, or if we should remodel it completely, as ISO 8601 now comes in two parts.

The second part (ISO 8601-2:2019) allows e.g. ranges. So if we adopt the complete standard (as somewhat suggested by the name data.temporal.iso) we could boil it down to @when-iso, because @notAfter-iso, @notBefore-iso, @from-iso, and @to-iso can now all be written in one expression.

bansp commented 2 years ago

With regard to the last statement, I would say, instinctively, that the changes in the ISO standard are perhaps not enough to deprecate attributes other than @when-iso, for two interconnected reasons:

So I'd suggest making it possible for users to only keep @when-iso and enjoy the full benefit of ISO 8601:2019 in their customization, but also to keep the extended repertoire of attributes in the generic Guidelines, even if the attributes may seem redundant from the point of view of an ISO expert.

sydb commented 2 years ago

Either way, yes, updating to ISO 8601:2019 is in the cards, and the preliminary step is on my to-do list. I had plans to do some significant work in this area first over winter break 2020–2021, but COVID problems hit others around me forcing me to take on other responsibilities; and then again over winter break 2021–2022, but I got quite sick myself (not COVID). I do not expect to make any progress on this for another month or so, but am very hopeful after that …

And, BTW, my thoughts are to do both — support the entirety of 8601:2019 (both parts), and still permit the old @from-iso, et al. Yes, that means there would be 2 ways of expressing a variety of cases. Nothing new to the TEI.

martinascholger commented 2 years ago

Council F2F: we removed the remark; updating to ISO 8601:2019 is blocked for now until Coucil has access to the specification.

ebeshero commented 2 years ago

Just noting that I added my comment to wrong ticket. I moved it to #2227 .

adunning commented 1 year ago

The integration of EDTF will be particularly significant within <msDesc> – both from a usability and data interchange perspective.

mprell commented 1 year ago

The integration of EDTF will be particularly significant within <msDesc> – both from a usability and data interchange perspective.

The same applies to the Propyläen project, in particular the ? for machine readability of parts of uncertain dates (EDTF Level 2)

sydb commented 1 year ago
  1. Sorry! (For the delay.) I am still working on the sort of “how to” for ISO 8601:2019 that is the precursor for updating the Guidelines. (It is > 1600 words so far, and there is lots more to go. If anyone with knowledge of 8601:2019-2 wants to either contribute, or at least proof read, please speak up! :-)
  2. Keep in mind that there is nothing to stop you from using @when-custom (and its siblings from att.datable.custom) using ISO 8601:2019 values now, and changing them to @when-iso (and its siblings from att.datable.iso) when we finally get 8601:2019 into the Guidelines. The transformation from the former to the latter will be, of course, trivial.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  exclude-result-prefixes="#all"
  version="3.0">

  <xsl:mode on-no-match="shallow-copy"/>

  <xsl:template match="@*[ ends-with( name(.), '-custom') ]">
    <xsl:variable name="oldName"      select="name(.)"/>
    <xsl:variable name="strippedName" select="substring-before( $oldName, '-custom')"/>
    <xsl:variable name="newName"      select="$strippedName||'-iso'"/>
    <xsl:attribute name="{$newName}" select="."/>
  </xsl:template>

</xsl:stylesheet>

Note that the only template above is purposefully somewhat verbose to make it easy to figure out what is going on. It could just as well be written

  <xsl:template match="@*[ name(.) => ends-with('-custom') ]">
    <xsl:attribute name="{substring-before( name(.), '-custom')||'-iso'}" select="."/>
  </xsl:template>

And, of course, this only works because there are no other attributes in TEI that end with “-custom”. 🤓

Updating your XSLT (or XQuery, I suppose) programs is a little tougher to do in XSLT, but still not that difficult. And it is trivial to just use a sledgehammer approach:

perl -p -i.bak -e 's,(\@(tei:)?(when|notBefore|notAfter|from|to))-custom,$1-iso,g;' /path/to/program.xslt

The problem with this approach is the entry

  <change when="2023-09-17" who="#ilte">
     Changed all @when-custom attributes to @when-iso attributes.
  </change>

gets changed to

  <change when="2023-09-17" who="#ilte">
     Changed all @when-iso attributes to @when-iso attributes.
  </change>

which is kinda unhelpful.