Skip to content

Commit

Permalink
set metadata scope rather then hard coding to dataset (#107)
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
  • Loading branch information
fostermh authored Apr 25, 2024
1 parent 5e01be4 commit 1665fef
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 7 deletions.
66 changes: 61 additions & 5 deletions metadata_xml/iso19115-cioos-template/main.j2
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<mdb:MD_MetadataScope>
{# resourceScope: mandatory #}
<mdb:resourceScope>
<mcc:MD_ScopeCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ScopeCode" codeListValue="dataset" />
<mcc:MD_ScopeCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ScopeCode" codeListValue="{{- record['metadata']['scope'] or 'dataset' -}}" />
{# CIOOS core mandatory element #}
{# MI_Metadata/metadataScope/MD_MetadataScope/resourceScope/MD_ScopeCode #}
</mdb:resourceScope>
Expand Down Expand Up @@ -706,22 +706,78 @@
</mrd:MD_Distribution>
</mdb:distributionInfo>
{% endif %}
{% if record['metadata']['history'] %}
{% for history in record['metadata']['history'] %}
<mdb:resourceLineage>
<mrl:LI_Lineage>
{{- bl.bilingual('mrl:statement', 'history', record['metadata']) -}}
{{- bl.bilingual('mrl:statement', 'statement', history) -}}
{# scope: CIOOS core mandatory #}
<mrl:scope>
<mcc:MD_Scope>
{# level: mandatory #}
<mcc:level>
<mcc:MD_ScopeCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ScopeCode" codeListValue="dataset" />
<mcc:MD_ScopeCode codeList="http://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ScopeCode" codeListValue="{{- history['scope'] or 'dataset' -}}" />
</mcc:level>
</mcc:MD_Scope>
</mrl:scope>
{% for additional_documentation in history['additionalDocumentation'] %}
<mrl:additionalDocumentation>
<cit:CI_Citation>
{{- bl.bilingual('cit:title','title', additional_documentation) -}}
{% if additional_documentation['authority'] %}
<cit:identifier>
<mcc:MD_Identifier>
<mcc:authority>
<cit:CI_Citation>
<cit:title>
<gco:CharacterString>{{- additional_documentation['authority'] -}}</gco:CharacterString>
</cit:title>
</cit:CI_Citation>
</mcc:authority>
<mcc:code>
<gco:CharacterString>{{- additional_documentation['code'] -}}</gco:CharacterString>
</mcc:code>
</mcc:MD_Identifier>
</cit:identifier>
{% endif %}
</cit:CI_Citation>
</mrl:additionalDocumentation>
{% endfor %}

{% for source in history['source'] %}
<mrl:source>
<mrl:LI_Source id="lineageSource">
{{- bl.bilingual('mrl:description','description', source) -}}
{% if source['title'] %}
<mrl:sourceCitation>
<cit:CI_Citation>
{{- bl.bilingual('cit:title','title', source) -}}
<cit:date gco:nilReason="missing"/>
{% if source['authority'] %}
<cit:identifier>
<mcc:MD_Identifier>
<mcc:authority>
<cit:CI_Citation>
<cit:title>
<gco:CharacterString>{{- source['authority'] -}}</gco:CharacterString>
</cit:title>
</cit:CI_Citation>
</mcc:authority>
<mcc:code>
<gco:CharacterString>{{- source['code'] -}}</gco:CharacterString>
</mcc:code>
</mcc:MD_Identifier>
</cit:identifier>
{% endif %}
</cit:CI_Citation>
</mrl:sourceCitation>
{% endif %}
</mrl:LI_Source>
</mrl:source>
{% endfor %}

</mrl:LI_Lineage>
</mdb:resourceLineage>
{% endif %}
{% endfor %}

{# metadataMaintenance: CIOOS core mandatory #}
{# refers to the maintenance of the metadata #}
Expand Down
23 changes: 21 additions & 2 deletions sample_records/record.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,29 @@ metadata:
fr: comment in french

history:
en: history in english
fr: history in french
- statement:
en: history in english
fr: history in french
scope: model
additionalDocumentation:
- title:
en: title in english
fr: title in french
authority: citation authority
code: citation code
source:
- description:
en: description in english
fr: description in french
title:
en: title in english
fr: title in french
authority: citation authority for source
code: citation code for source

dates:
creation: 2011-11-11
scope: model

spatial:
bbox: [-141, 42, -52, 84]
Expand Down

0 comments on commit 1665fef

Please sign in to comment.