VForWaTer / metacatalog

Modular metadata management platform for environmental data.
https://vforwater.github.io/metacatalog
GNU General Public License v3.0
3 stars 1 forks source link

Refactoring the 'end' date and version #44

Closed mmaelicke closed 4 years ago

mmaelicke commented 4 years ago

Problem

I am unhappy with the 'end' attribute of an Entry.

short

It's not clear and can't be mapped into ISO19115.

long

I worked a bit more in ISO 19115 and found the CI_DateTypeCode. I am not sure how to map the current end date of i.e. a time series into this ISO CodeDefinition. It seems like the ISO does not have a date for the end of a time series or dataset.

Solutions

One possibility would be to implement the full code list as a lookup table and create an actual versioning history, that records event types. ISO 19115 and ISO 19115-1 define the MD_ProgressCode fur this purpose, which has to go into another lookup table. Then, the combination of Entry in 'onGoing' progress state can have a date in the newly created history of type 'lastUpdated'. Feels like a bit of an overkill, but I don't know how we can offer ISO-compliant metadata without losing important information else-wise.

A combination of both, linked to an Entry.id would give a pretty neat version history but also require some substantial refactoring. Therefore, if accepted, I would put this into the next larger release. The logic would then be that an Entry.version identifies the version of the metadata itself, whereas Entry.latest_version_id on other entires refer to the most recent one. Versioning information about the data would be called history and described by a data history table using ISO CodeDefinitions. On export, the requested Entry can use its progress state date to extract only the part of the history, that is relevant.

CodeLists for Reference

CI_DateTypeCode

<codelistItem>
<CodeListDictionary gml:id="CI_DateTypeCode">
<gml:description>identification of when a given event occurred</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">CI_DateTypeCode</gml:identifier>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_creation">
<gml:description>date identifies when the resource was brought into existence</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">creation</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_publication">
<gml:description>date identifies when the resource was issued</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">publication</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_revision">
<gml:description>date identifies when the resource was examined or re-examined and improved or amended</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">revision</gml:identifier>
</CodeDefinition>
</codeEntry>
<!--  19115-1 additions  -->
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_expiry">
<gml:description>date identifies when resource expires</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">expiry</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_lastUpdate">
<gml:description>date identifies when resource was last updated</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">lastUpdate</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_lastRevision">
<gml:description>date identifies when resource was last reviewed</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">lastRevision</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_nextUpdate">
<gml:description>date identifies when resource will be next updated</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">nextUpdate</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_unavailable">
<gml:description>date identifies when resource became not available or obtainable</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">unavailable</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_inForce">
<gml:description>date identifies when resource became in force</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">inForce</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_adopted">
<gml:description>date identifies when resource was adopted</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">adopted</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_deprecated">
<gml:description>date identifies when resource was deprecated</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">deprecated</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_superseded">
<gml:description>date identifies when resource was superseded or replaced by another resource</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">superseded</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_validityBegins">
<gml:description>time at which the data are considered to become valid. NOTE: There could be quite a delay between creation and validity begins</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">validityBegins</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
...
</codeEntry>
<codeEntry>
...
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="CI_DateTypeCode_distribution">
<gml:description>date identifies when an instance of the resource was distributed</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">distribution</gml:identifier>
</CodeDefinition>
</codeEntry>
</CodeListDictionary>
</codelistItem>

MD_ProgressCode

<codelistItem>
<CodeListDictionary gml:id="MD_ProgressCode">
<gml:description>status of the dataset or progress of a review</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">MD_ProgressCode</gml:identifier>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_completed">
<gml:description>production of the data has been completed</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">completed</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_historicalArchive">
<gml:description>data has been stored in an offline storage facility</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">historicalArchive</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_obsolete">
<gml:description>data is no longer relevant</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">obsolete</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_onGoing">
<gml:description>data is continually being updated</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">onGoing</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_planned">
<gml:description>fixed date has been established upon or by which the data will be created or updated</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">planned</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_required">
<gml:description>data needs to be generated or updated</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">required</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_underDevelopment">
<gml:description>data is currently in the process of being created</gml:description>
<gml:identifier codeSpace="ISOTC211/19115">underDevelopment</gml:identifier>
</CodeDefinition>
</codeEntry>
<!--  19115-1  -->
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_final">
<gml:description>progress concluded and no changes will be accepted</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">final</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_pending">
<gml:description>committed to, but not yet addressed</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">pending</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_retired">
<gml:description>item is no longer recommended for use. It has not been superseded by another item</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">retired</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_superseded">
<gml:description>replaced by new</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">superseded</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_tentative">
<gml:description>provisional changes likely before resource becomes final or complete</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">tentative</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_valid">
<gml:description>acceptable under specific conditions</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">valid</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_accepted">
<gml:description>agreed to by sponsor</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">accepted</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_notAccepted">
<gml:description>rejected by sponsor</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">notAccepted</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_withdrawn">
<gml:description>removed from consideration</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">withdrawn</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_proposed">
<gml:description>suggested that development needs to be undertaken</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">proposed</gml:identifier>
</CodeDefinition>
</codeEntry>
<codeEntry>
<CodeDefinition gml:id="MD_ProgressCode_deprecated">
<gml:description>resource superseded and will become obsolete, use only for historical purposes</gml:description>
<gml:identifier codeSpace="http://standards.iso.org/iso/19115">deprecated</gml:identifier>
</CodeDefinition>
</codeEntry>
</CodeListDictionary>
</codelistItem>
mmaelicke commented 4 years ago

This has been solved by #92 as the end is not part of Entryanymore. It can now be specified by a TemporalScale that is describing the DataSource as TemporalScale.extent.