Skip to content

Commit 944671d

Browse files
committed
replace identification.doi with metadata.additional_identifiers
1 parent 5afffeb commit 944671d

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

docs/content/reference/mcf.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ version|Mandatory|version of MCF format|1.0|pygeometa
126126
Property Name|Mandatory/Optional|Description|Example|Reference
127127
-------------|------------------|-----------|-------|---------:
128128
identifier|Mandatory|unique identifier for this metadata file|11800c2c-e6b9-11df-b9ae-0014c2c00eab|ISO 19115:2003 Section B.2.1
129-
additional_identifiers|Optional|any additional identifiers for the resource with their scheme property|10.5324/3f342f64|ISO 19115:2003 Section B.2.1
130129
language|Mandatory|primary language used for documenting metadata, the metadata records themselves can be provided in multiple languages nonetheless|en|ISO 19115:2003 Section B.2.1
131130
language_alternate|Optional|alternate language used for documenting metadata|en|ISO 19115:2003 Annex J
132131
charset|Mandatory|full name of the character coding standard used for the metadata set|utf8|ISO 19115:2003 Section B.2.1
@@ -135,6 +134,13 @@ hierarchylevel|Mandatory|level to which the metadata applies (must be one of 'se
135134
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
136135
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
137136

137+
### `metadata.additional_identifiers`
138+
139+
Property Name|Mandatory/Optional|Description|Example|Reference
140+
-------------|------------------|-----------|-------|---------:
141+
identifier|Mandatory|identifier|10.5324/3f342f64|ISO 19115:2003 Section B.2.1
142+
scheme|Optional|https://doi.org|ISO 19115:2003 Section B.2.1
143+
138144
### `spatial`
139145

140146
Property Name|Mandatory/Optional|Description|Example|Reference
@@ -146,7 +152,6 @@ geomtype|Mandatory|name of point or vector objects used to locate zero-, one-, t
146152

147153
Property Name|Mandatory/Optional|Description|Example|Reference
148154
-------------|------------------|-----------|-------|---------:
149-
doi|Optional|Digital Object Identifier (DOI)|12345|ISO 19115:2003 Section B.3.2.1
150155
language|Optional|language(s) used within the dataset. If the dataset is made of numerical values, the dataset language can be set to 'missing', 'withheld', 'inapplicable', 'unknown' or 'template'|eng; CAN|ISO 19115:2003 Section B.2.2.1
151156
charset|Optional|full name of the character coding standard used for the dataset|eng; CAN|ISO 19115:2003 Section B.2.1
152157
title|Mandatory|name by which the cited resource is known|Important Bird Areas|ISO 19115:2003 Section B.3.2.1

pygeometa/schemas/mcf/core.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ properties:
100100
identification:
101101
type: object
102102
properties:
103-
doi:
104-
type: string
105-
description: Digital Object Identifier (DOI)
106103
language:
107104
type: string
108105
description: |-

pygeometa/schemas/ogcapi_records/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,19 @@ def write(self, mcf: dict, stringify: str = True) -> Union[dict, str]:
121121
'links': []
122122
}
123123

124-
if 'doi' in mcf['identification']:
125-
record['properties']['externalIds'] = [{
126-
'scheme': 'https://doi.org',
127-
'value': mcf['identification']['doi']
128-
}]
124+
if 'additional_identifiers' in mcf['metadata']:
125+
LOGGER.debug('Adding additional identifiers')
126+
127+
record['properties']['externalIds'] = []
128+
129+
for ai in mcf['metadata'].get('additional_identifiers', []):
130+
ai_dict = {
131+
'value': ai['identifier']
132+
}
133+
if 'scheme' in ai:
134+
ai_dict['scheme'] = ai['scheme']
135+
136+
record['properties']['externalIds'].append(ai_dict)
129137

130138
if self.lang1 is not None:
131139
record['properties']['language'] = {

pygeometa/schemas/wmo_cmp/main.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,15 @@
149149
{% if record['identification']['edition'] %}
150150
{{ cs.get_freetext('edition', record['metadata']['language_alternate'], get_charstring(record['identification'].get('edition'), record['metadata']['language'], record['metadata']['language_alternate'])) }}
151151
{% endif %}
152+
{% for ai in record['metadata'].get('additional_identifiers', []) %}
152153
<gmd:identifier>
153154
<gmd:MD_Identifier>
154155
<gmd:code>
155-
<gmx:Anchor xlink:href="http://dx.doi.org/{{ record['identification']['doi'] }}" xlink:title="DOI" xlink:actuate="onRequest">doi:{{ record['identification']['doi'] }}</gmx:Anchor>
156+
<gmx:Anchor xlink:href="{{ ai['scheme'] }}/{{ ai['identifier'] }}" xlink:title="{{ai['scheme']}}" xlink:actuate="onRequest">{{ai['scheme']}}:{{ ai['identifier'] }}</gmx:Anchor>
156157
</gmd:code>
157158
</gmd:MD_Identifier>
158159
</gmd:identifier>
160+
{% endfor %}
159161
{{ cs.get_freetext('otherCitationDetails', record['metadata']['language_alternate'], get_charstring(record['identification'].get('rights'), record['metadata']['language'], record['metadata']['language_alternate'])) }}
160162
</gmd:CI_Citation>
161163
</gmd:citation>

sample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
identifier: 3f342f64-9348-11df-ba6a-0014c2c00eab
66
additional_identifiers:
77
- identifier: 10.277/3f342f64-9348
8-
scheme: https://doi.org/
8+
scheme: https://doi.org
99
language: en
1010
language_alternate: fr
1111
charset: utf8

0 commit comments

Comments
 (0)