Skip to content

Commit 906097e

Browse files
committed
update MCF record lifecycle dates
1 parent 1427ef8 commit 906097e

23 files changed

+78
-42
lines changed

docs/content/reference/mcf.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,25 @@ language_alternate|Optional|alternate language used for documenting metadata|en|
135135
charset|Mandatory|full name of the character coding standard used for the metadata set|utf8|ISO 19115:2003 Section B.2.1
136136
parentidentifier|Optional|file identifier of the metadata to which this metadata is a subset|11800c2c-e6b9-11df-b9ae-0014c2c33ebe|ISO 19115:2003 Section B.2.1
137137
hierarchylevel|Mandatory|level to which the metadata applies (must be one of 'series', 'software', 'featureType', 'model', 'collectionHardware', 'collectionSession', 'nonGeographicDataset', 'propertyType', 'fieldSession', 'dataset', 'service', 'attribute', 'attributeType', 'tile', 'feature', 'dimensionGroup'|dataset|ISO 19115:2003 Section B.2.1
138-
datestamp|Mandatory|date that the metadata was created, pygeometa supports specifying the $date$ or $datetime$ variable to update the date value at run time|2000-11-11 or 2000-01-12T11:11:11Z|ISO 19115:2003 Section B.2.1
139138
dataseturi|Optional|Uniformed Resource Identifier (URI) of the dataset to which the metadata applies|`urn:x-wmo:md:int.wmo.wis::http://geo.woudc.org/def/data/uv-radiation/uv-irradiance`|ISO 19115:2003 Section B.2.1
140139

140+
#### `metadata.dates`
141+
142+
`metadata.dates` sections (in the context of metadata record lifecycle) can have 1..n `dates` sections as required with the following object names/types:
143+
144+
Property Name|Mandatory/Optional|Description|Example|Reference
145+
-------------|------------------|-----------|-------|---------:
146+
creation|Mandatory|record creation date|2000-09-01 or 2000-09-01T00:00:00Z|OGC API - Records - Part 1: Core, Subclause 7.2.2, Table 8
147+
revision|Optional|record update date|2000-09-01 or 2000-09-01T00:00:00Z|OGC API - Records - Part 1: Core, Subclause 7.2.2, Table 8
148+
149+
```yaml
150+
metadata:
151+
...
152+
dates:
153+
creation: 2025-03-21
154+
revision: 2026-11-25
155+
```
156+
141157
### `metadata.additional_identifiers`
142158

143159
Property Name|Mandatory/Optional|Description|Example|Reference
@@ -183,13 +199,13 @@ browsegraphic|Optional|graphic that provides an illustration of the dataset|http
183199

184200
#### `identification.dates`
185201

186-
`identification.dates` sections can have 1..n `dates` sections as required with the following object names/types:
202+
`identification.dates` sections (in the context of data citation) can have 1..n `dates` sections as required with the following object names/types:
187203

188204
Property Name|Mandatory/Optional|Description|Example|Reference
189205
-------------|------------------|-----------|-------|---------:
190-
creation|Mandatory*|'creation' reference date for the cited resource, referring to when the resource was brought into existence, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
191-
publication|Optional*|'publication' reference date for the cited resource, referring to when the resource was issued, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
192-
revision|Optional*|'revision' reference date for the cited resource, referring to when the resource was examined or re-examined and improved or amended, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
206+
creation|Optional|'creation' reference date for the cited resource, referring to when the resource was brought into existence, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
207+
publication|Optional|'publication' reference date for the cited resource, referring to when the resource was issued, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
208+
revision|Optional|'revision' reference date for the cited resource, referring to when the resource was examined or re-examined and improved or amended, *: presence of creation or publication or revision is mandatory|2000-09-01 or 2000-09-01T00:00:00Z|ISO 19115:2003 Section B.3.2.4
193209

194210
```yaml
195211
identification:

pygeometa/core.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import os
5353
import pathlib
5454
import re
55-
import traceback
5655
from typing import IO, Union
5756
from xml.dom import minidom
5857

@@ -369,11 +368,9 @@ def import_metadata(schema: str, metadata: str) -> dict:
369368
error_message = f'Import not supported for {s}'
370369
except Exception as err:
371370
error_message = f'Import failed: {err}'
372-
error_trace = traceback.format_exc()
373371

374372
if error_message is not None:
375373
LOGGER.warning(error_message)
376-
LOGGER.debug(error_trace)
377374

378375
return content
379376

pygeometa/schemas/cwl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def import_(self, metadata: str) -> dict:
112112

113113
mcf['metadata']['identifier'] = wf['id']
114114
mcf['metadata']['hierarchylevel'] = 'application'
115-
mcf['metadata']['datestamp'] = now
115+
mcf['metadata']['dates']['creation'] = now
116116
mcf['identification']['title'] = wf['label']
117117
mcf['identification']['abstract'] = wf['doc']
118118

pygeometa/schemas/iso19139/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def import_(self, metadata: str) -> dict:
8383
'mcf': {
8484
'version': '1.0',
8585
},
86-
'metadata': {},
86+
'metadata': {
87+
'dates': {}
88+
},
8789
'spatial': {},
8890
'identification': {},
8991
'contact': {},
@@ -100,7 +102,7 @@ def import_(self, metadata: str) -> dict:
100102
mcf['metadata']['identifier'] = m.identifier
101103

102104
mcf['metadata']['hierarchylevel'] = m.hierarchy
103-
mcf['metadata']['datestamp'] = m.datestamp
105+
mcf['metadata']['dates']['creation'] = m.datestamp
104106

105107
LOGGER.debug('Setting language')
106108
if m.language:

pygeometa/schemas/iso19139/main.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% endfor %}
3030
<gmd:dateStamp>
31-
{% set datestamp = record['metadata'].get('datestamp','')|normalize_datestring %}
31+
{% set datestamp = record['metadata']['dates']['creation']|normalize_datestring %}
3232
{% if datestamp|length > 11 %}
3333
<gco:DateTime>{{ datestamp }}</gco:DateTime>
3434
{% else %}

pygeometa/schemas/iso19139_2/main.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% endfor %}
3030
<gmd:dateStamp>
31-
{% set datestamp = record['metadata']['datestamp']|normalize_datestring %}
31+
{% set datestamp = record['metadata']['dates']['created']|normalize_datestring %}
3232
{% if datestamp|length > 11 %}
3333
<gco:DateTime>{{ datestamp }}</gco:DateTime>
3434
{% else %}

pygeometa/schemas/iso19139_hnap/main.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% endfor %}
3030
<gmd:dateStamp>
31-
{% set datestamp = record['metadata']['datestamp']|normalize_datestring %}
31+
{% set datestamp = record['metadata']['dates']['creation']|normalize_datestring %}
3232
{% if datestamp|length > 11 %}
3333
<gco:DateTime>{{ datestamp }}</gco:DateTime>
3434
{% else %}

pygeometa/schemas/mcf/core.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,18 @@ properties:
7070
- tile
7171
- feature
7272
- dimensionGroup
73-
datestamp:
74-
$ref: '#/definitions/date_or_datetime_string'
75-
description: date that the metadata was created, pygeometa supports specifying the `$date$` or `$datetime$` variable to update the date value at run time
73+
dates:
74+
type: object
75+
description: record lifecycle dates
76+
properties:
77+
creation:
78+
$ref: '#/definitions/date_or_datetime_string'
79+
format: string
80+
revision:
81+
$ref: '#/definitions/date_or_datetime_string'
82+
format: string
83+
required:
84+
- creation
7685
dataseturi:
7786
type: string
7887
description: Uniform Resource Identifier (URI) of the dataset to which the metadata applies
@@ -81,7 +90,7 @@ properties:
8190
- language
8291
- charset
8392
- hierarchylevel
84-
- datestamp
93+
- dates
8594
spatial:
8695
type: object
8796
properties:
@@ -259,13 +268,13 @@ properties:
259268
properties:
260269
anyOf:
261270
creation:
262-
type: '#/definitions/date_or_datetime_string'
271+
$ref: '#/definitions/date_or_datetime_string'
263272
format: string
264273
publication:
265-
type: '#/definitions/date_or_datetime_string'
274+
$ref: '#/definitions/date_or_datetime_string'
266275
format: string
267276
revision:
268-
type: '#/definitions/date_or_datetime_string'
277+
$ref: '#/definitions/date_or_datetime_string'
269278
format: string
270279
extents:
271280
type: object
@@ -358,7 +367,6 @@ properties:
358367
- rights
359368
- url
360369
- status
361-
- dates
362370
- extents
363371
- keywords
364372
content_info:

pygeometa/schemas/openaire/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def import_(self, metadata: str) -> dict:
8686
'mcf': {
8787
'version': '1.0',
8888
},
89-
'metadata': {},
89+
'metadata': {
90+
'dates': {}
91+
},
9092
'identification': {},
9193
'contact': {}
9294
}
@@ -145,7 +147,8 @@ def import_(self, metadata: str) -> dict:
145147

146148
date_of_collection = metadata_.get('dateOfCollection')
147149
if date_of_collection is not None:
148-
mcf['metadata']['datestamp'] = metadata_.get('dateOfCollection')
150+
mcf['metadata']['dates']['creation'] = \
151+
metadata_.get('dateOfCollection')
149152

150153
if main_instance_ is not None:
151154
urls = main_instance_.get('urls')
@@ -193,11 +196,10 @@ def import_(self, metadata: str) -> dict:
193196
e_date = metadata_.get('embargoEndDate')
194197
if p_date:
195198
dates_dict['publication'] = p_date
196-
mcf['identification']['datestamp'] = [p_date]
197199
if e_date:
198200
dates_dict['embargoend'] = e_date
199201
if dates_dict:
200-
mcf['identification']['dates'] = dates_dict
202+
mcf['metadata']['dates'] = dates_dict
201203

202204
subjects_ = metadata_.get('subjects')
203205
if isinstance(subjects_, dict):

pygeometa/schemas/wmo_cmp/main.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{% endif %}
2929
{% endfor %}
3030
<gmd:dateStamp>
31-
{% set datestamp = record['metadata']['datestamp']|normalize_datestring %}
31+
{% set datestamp = record['metadata']['dates']['creation']|normalize_datestring %}
3232
{% if datestamp|length > 11 %}
3333
<gco:DateTime>{{ datestamp }}</gco:DateTime>
3434
{% else %}

0 commit comments

Comments
 (0)