Skip to content

Commit

Permalink
feat: add back 19139
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 12, 2024
1 parent c269bdc commit 6b53c52
Show file tree
Hide file tree
Showing 6 changed files with 1,213 additions and 486 deletions.
84 changes: 84 additions & 0 deletions datafeeder/inspire/topic_category-19115-3.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common"
xmlns:geonet="http://www.fao.org/geonetwork" xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil" xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0"
version="2.0" exclude-result-prefixes="#all">

<!--
Template to add a <gmd:topicCategory> for each
gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString
matching the mappings defined here from keyword to RDF entry
The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory
-->
<xsl:template name="inspire_topic_category">
<xsl:variable name="inspire-themes" select="document('themes.rdf')"/>

<xsl:for-each select="$props//keywords//keyword">
<xsl:variable name="kw" select="."/>
<xsl:variable name="rdf_about_id" select="$inspire-themes//rdf:Description[skos:prefLabel=$kw]/@rdf:about" />
<xsl:choose>
<xsl:when test="$rdf_about_id != ''">
<xsl:variable name="topiccat_code" select="$topiccat-map/entry[@rdf:about=$rdf_about_id]/@topiccatcode"/>
<xsl:choose>
<xsl:when test="$topiccat_code != ''">
<mri:topicCategory>
<mri:MD_TopicCategoryCode>
<xsl:value-of select="$topiccat_code" />
</mri:MD_TopicCategoryCode>
</mri:topicCategory>
</xsl:when>
<xsl:otherwise>
<xsl:comment>
No mapping exists for rdf:about= '<xsl:value-of select="$rdf_about_id"/>'.
Keyword: '<xsl:value-of select="$kw" />'
</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:comment>No matching topic category for keyword '<xsl:value-of select="$kw" />'</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>

<!--
Mapping of <rdf:Description rdf:about="<id>"> in themes.rdf to topic category codes
-->
<xsl:variable name="topiccat-map">
<entry topiccatcode="location" rdf:about="3" />
<entry topiccatcode="boundaries" rdf:about="4" />
<entry topiccatcode="location" rdf:about="5" />
<entry topiccatcode="planningCadastre" rdf:about="6" />
<entry topiccatcode="transportation" rdf:about="7" />
<entry topiccatcode="inlandWaters" rdf:about="8" />
<entry topiccatcode="environment" rdf:about="9" />
<entry topiccatcode="elevation" rdf:about="10" />
<entry topiccatcode="imageryBaseMapsEarthCover" rdf:about="11" />
<entry topiccatcode="imageryBaseMapsEarthCover" rdf:about="12" />
<entry topiccatcode="geoscientificInformation" rdf:about="13" />
<entry topiccatcode="boundaries" rdf:about="14" />
<entry topiccatcode="structure" rdf:about="15" />
<entry topiccatcode="geoscientificInformation" rdf:about="16" />
<entry topiccatcode="planningCadastre" rdf:about="17" />
<entry topiccatcode="health" rdf:about="18" />
<entry topiccatcode="utilitiesCommunication" rdf:about="19" />
<entry topiccatcode="structure" rdf:about="20" />
<entry topiccatcode="structure" rdf:about="21" />
<entry topiccatcode="farming" rdf:about="22" />
<entry topiccatcode="society" rdf:about="23" />
<entry topiccatcode="planningCadastre" rdf:about="24" />
<entry topiccatcode="geoscientificInformation" rdf:about="25" />
<entry topiccatcode="climatologyMeteorologyAtmosphere" rdf:about="26" />
<entry topiccatcode="climatologyMeteorologyAtmosphere" rdf:about="27" />
<entry topiccatcode="oceans" rdf:about="28" />
<entry topiccatcode="oceans" rdf:about="29" />
<entry topiccatcode="biota" rdf:about="30" />
<entry topiccatcode="biota" rdf:about="31" />
<entry topiccatcode="biota" rdf:about="32" />
<entry topiccatcode="economy" rdf:about="33" />
<entry topiccatcode="economy" rdf:about="34" />
</xsl:variable>
</xsl:stylesheet>
31 changes: 16 additions & 15 deletions datafeeder/inspire/topic_category.xsl
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common"
xmlns:geonet="http://www.fao.org/geonetwork" xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil" xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0"
version="2.0" exclude-result-prefixes="#all">
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil" version="2.0" exclude-result-prefixes="#all">

<!--
Template to add a <gmd:topicCategory> for each
gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString
matching the mappings defined here from keyword to RDF entry
<!--
Template to add a <gmd:topicCategory> for each
gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gco:CharacterString
matching the mappings defined here from keyword to RDF entry
The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory
-->
The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification/gmd:topicCategory
-->
<xsl:template name="inspire_topic_category">
<xsl:variable name="inspire-themes" select="document('themes.rdf')"/>

Expand All @@ -23,11 +24,11 @@ The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification
<xsl:variable name="topiccat_code" select="$topiccat-map/entry[@rdf:about=$rdf_about_id]/@topiccatcode"/>
<xsl:choose>
<xsl:when test="$topiccat_code != ''">
<mri:topicCategory>
<mri:MD_TopicCategoryCode>
<gmd:topicCategory>
<gmd:MD_TopicCategoryCode>
<xsl:value-of select="$topiccat_code" />
</mri:MD_TopicCategoryCode>
</mri:topicCategory>
</gmd:MD_TopicCategoryCode>
</gmd:topicCategory>
</xsl:when>
<xsl:otherwise>
<xsl:comment>
Expand All @@ -38,7 +39,7 @@ The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:comment>No matching topic category for keyword '<xsl:value-of select="$kw" />'</xsl:comment>
<xsl:comment>No matching topic category for keyword '<xsl:value-of select="$kw" />'</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
Expand Down Expand Up @@ -81,4 +82,4 @@ The document must have an empty gmd:identificationInfo/gmd:MD_DataIdentification
<entry topiccatcode="economy" rdf:about="33" />
<entry topiccatcode="economy" rdf:about="34" />
</xsl:variable>
</xsl:stylesheet>
</xsl:stylesheet>
Loading

0 comments on commit 6b53c52

Please sign in to comment.