Skip to content

Commit

Permalink
support multiple platforms (#112)
Browse files Browse the repository at this point in the history
* set metadata scope rather then hard coding to dataset

* improve lineage section. not this results in a change to the 'hsitory' attribute which was previously a string and is now expected to be an object.

* fix some xml bugs and update sample reqcord with bilingual values

* adjust template to add related works

* update template to include new lineage and related works fields

* add iso version of scope

* update template to support new multiple platforms

* make platform a list.
  • Loading branch information
fostermh authored Apr 27, 2024
1 parent 95ae4bb commit dae507e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
31 changes: 15 additions & 16 deletions metadata_xml/iso19115-cioos-template/main.j2
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@
</mcc:MD_Scope>
</mac:scope>
{# platform: Recommended #}
{% for platform in record['platform'] %}
<mac:platform>
<mac:MI_Platform>
{# identifier: mandatory #}
Expand All @@ -845,8 +846,8 @@
<mcc:authority>
<cit:CI_Citation>
{# validation says cit:CI_Citation requires title #}
{{- bl.bilingual('cit:title', 'name', record['platform']) -}}
{% if record['platform']['role'] and record['platform']['authority'] %}
{{- bl.bilingual('cit:title', 'name', platform) -}}
{% if platform['role'] and platform['authority'] %}
{# citedResponsibleParty: mandatory #}
<cit:citedResponsibleParty>
<cit:CI_Responsibility>
Expand All @@ -860,7 +861,7 @@
<cit:party>
<cit:CI_Organisation>
{# name: mandatory #}
{{- bl.bilingual('cit:name', 'authority', record['platform']) -}}
{{- bl.bilingual('cit:name', 'authority', platform) -}}
{# CIOOS core mandatory element #}
{# MI_Metadata/acquisitionInformation/MI_AcquisitionInformation/platform/MI_Platform/identifier/MD_Identifier/authority/CI_Citation/citedResponsibleParty/CI_Responsibility/party/CI_Party/name/CharacterString #}
</cit:CI_Organisation>
Expand All @@ -874,38 +875,36 @@
<mcc:code>
{# CIOOS core mandatory element #}
{# MI_Metadata/acquisitionInformation/MI_AcquisitionInformation/platform/MI_Platform/identifier/MD_Identifier/code/CharacterString #}
<gco:CharacterString>{{- record['platform']['id'] -}}</gco:CharacterString>
<gco:CharacterString>{{- platform['id'] -}}</gco:CharacterString>
</mcc:code>
</mcc:MD_Identifier>
</mac:identifier>
{# description: mandatory #}
{# CIOOS core mandatory element #}
{# MI_Metadata/acquisitionInformation/MI_AcquisitionInformation/platform/MI_Platform/description/CharacterString #}
{{- bl.bilingual('mac:description', 'description', record['platform']) -}}
{{- bl.bilingual('mac:description', 'description', platform) -}}

{% for instrument in record['platform']['instruments'] %}
{% for instrument in platform['instruments'] %}
{# instrument: Recommended, if platform not used then this should be under mac:MI_AcquisitionInformation #}

{{- instr.get_instrument(instrument) -}}

{{- instr.get_instrument(instrument) -}}
{% endfor %}

{% if record['platform']['type'] %}

{# cant have 'otherProperty' without 'instrument'. This adds dummy instrument #}
{% if instrument not in record['platform']['instruments']%}
<mac:instrument/>
{% endif %}
{% if platform['type'] %}
{# cant have 'otherProperty' without 'instrument'. This adds dummy instrument #}
{% if platform['instruments']|length == 0 %}
<mac:instrument/>
{% endif %}

<mac:otherProperty xlink:href="http://vocab.nerc.ac.uk/collection/L06/current/" xlink:title="SeaVoX Platform Categories">
<gco:Record>
<gco:CharacterString>{{- record['platform']['type'] -}}</gco:CharacterString>
<gco:CharacterString>{{- platform['type'] -}}</gco:CharacterString>
</gco:Record>
</mac:otherProperty>
{% endif %}

</mac:MI_Platform>
</mac:platform>
{% endfor %}
</mac:MI_AcquisitionInformation>
</mdb:acquisitionInformation>
{% endif %}
Expand Down
42 changes: 21 additions & 21 deletions sample_records/record.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,27 @@ distribution:
fr: resource description in French

platform:
type: drifting subsurface profiling float
name: platform_name
authority: platform_authority
id: platform id
description:
en: platformDescription in English
fr: platformDescription in French
translations:
fr:
validated: true
message: Auto-translated using AWS
instruments:
- id: 123
manufacturer: manufacturer en 1
version: A1.53
type:
en: type en 1
fr: type fr 1
description:
en: instrument description en 1
fr: instrument description fr 1
- type: drifting subsurface profiling float
name: platform_name
authority: platform_authority
id: platform id
description:
en: platformDescription in English
fr: platformDescription in French
translations:
fr:
validated: true
message: Auto-translated using AWS
instruments:
- id: 123
manufacturer: manufacturer en 1
version: A1.53
type:
en: type en 1
fr: type fr 1
description:
en: instrument description en 1
fr: instrument description fr 1
instruments:
- id: id not in platform
manufacturer: manufacturer not in platform
Expand Down

0 comments on commit dae507e

Please sign in to comment.