Skip to content

Commit

Permalink
Merge pull request #7059 from tkohr/xsl-fixes
Browse files Browse the repository at this point in the history
[Harvesting] Various ODS/DKAN fixes and improvements
  • Loading branch information
jahow authored May 9, 2023
2 parents 79cb231 + 3cdf603 commit b0952d0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@
<xsl:param name="value"></xsl:param>

<!-- Regexps for parsing expected date formats -->
<!-- example of localized date: "jeu, 03/06/2021 - 03:00" -->
<xsl:variable name="regExLoc">^.*([0-9]{2})/([0-9]{2})/([0-9]{4}) - ([0-9]{2}:[0-9]{2})$</xsl:variable>
<!-- example of internationalized date: "2020-12-09 00:00:00" -->
<!-- examples of localized date: "jeu, 24/12/2020 - 03:00", "24-12-2020 03:00" -->
<xsl:variable name="regExLoc">^.*([0-9]{2})[-/]([0-9]{2})[-/]([0-9]{4})[-\s]+([0-9]{2}:[0-9]{2}).*$</xsl:variable>
<!-- example of internationalized date: "2020-12-24 03:00:00" -->
<xsl:variable name="regExInt">^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}:[0-9]{2}:[0-9]{2})$</xsl:variable>

<xsl:variable name="dateFormatted">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@
<cit:date>
<gco:DateTime><xsl:value-of select="(metas/modified|dataset/metas/default/metadata_processed)[1]"/></gco:DateTime>
</cit:date>
<cit:dateType>
<cit:CI_DateTypeCode codeList="codeListLocation#CI_DateTypeCode" codeListValue="publication"/>
</cit:dateType>
</cit:CI_Date>
</mdb:dateInfo>
<mdb:dateInfo>
<cit:CI_Date>
<cit:date>
<gco:DateTime><xsl:value-of select="metas/metadata_processed"/></gco:DateTime>
</cit:date>
<cit:dateType>
<cit:CI_DateTypeCode codeList="codeListLocation#CI_DateTypeCode" codeListValue="revision"/>
</cit:dateType>
Expand Down Expand Up @@ -164,7 +174,17 @@
</gco:DateTime>
</cit:date>
<cit:dateType>
<cit:CI_DateTypeCode codeList="codeListLocation#CI_DateTypeCode" codeListValue="creation"/>
<cit:CI_DateTypeCode codeList="codeListLocation#CI_DateTypeCode" codeListValue="publication"/>
</cit:dateType>
</cit:CI_Date>
</cit:date>
<cit:date>
<cit:CI_Date>
<cit:date>
<gco:DateTime><xsl:value-of select="metas/data_processed"/></gco:DateTime>
</cit:date>
<cit:dateType>
<cit:CI_DateTypeCode codeList="codeListLocation#CI_DateTypeCode" codeListValue="revision"/>
</cit:dateType>
</cit:CI_Date>
</cit:date>
Expand Down Expand Up @@ -244,9 +264,16 @@
</mri:pointOfContact>
</xsl:for-each>

<mri:topicCategory>
<mri:MD_TopicCategoryCode></mri:MD_TopicCategoryCode>
</mri:topicCategory>
<!-- ODS themes copied as topicCategory -->
<xsl:if test="metas/theme">
<xsl:for-each select="metas/theme">
<mri:topicCategory>
<mri:MD_TopicCategoryCode>
<xsl:value-of select="."/>
</mri:MD_TopicCategoryCode>
</mri:topicCategory>
</xsl:for-each>
</xsl:if>

<!-- ODS keywords copied without type -->
<xsl:variable name="keywords"
Expand All @@ -265,25 +292,6 @@
</mri:descriptiveKeywords>
</xsl:if>

<!-- ODS themes copied as keywords with type 'theme' -->
<xsl:if test="metas/theme">
<mri:descriptiveKeywords>
<mri:MD_Keywords>
<xsl:for-each select="metas/theme">
<mri:keyword>
<gco:CharacterString>
<xsl:value-of select="."/>
</gco:CharacterString>
</mri:keyword>
</xsl:for-each>
<mri:type>
<mri:MD_KeywordTypeCode codeListValue="theme"
codeList="./resources/codeList.xml#MD_KeywordTypeCode"/>
</mri:type>
</mri:MD_Keywords>
</mri:descriptiveKeywords>
</xsl:if>

<!--
license_url: "http://opendatacommons.org/licenses/odbl/",
-->
Expand Down

0 comments on commit b0952d0

Please sign in to comment.