Skip to content

Commit

Permalink
DCAT / Align with GeoNetwork. Add support for multiple useConstraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Nov 13, 2024
1 parent 29cb963 commit e49ef40
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
Usage note: Information about licenses and rights MAY be provided for the Resource. See also guidance at 9. License and rights statements.
-->
<xsl:template mode="iso19115-3-to-dcat"
match="mdb:identificationInfo/*/mri:resourceConstraints/*[mco:accessConstraints]">
<xsl:if test="count(../preceding-sibling::mri:resourceConstraints/*[mco:accessConstraints]) = 0">
match="mdb:identificationInfo/*/mri:resourceConstraints/*">
<xsl:if test="count(../preceding-sibling::mri:resourceConstraints/*) = 0">
<xsl:for-each select="../../mri:resourceConstraints/*[mco:accessConstraints]/mco:otherConstraints">
<xsl:if test="position() = 1 or ($isPreservingAllResourceConstraints and position() > 1)">
<xsl:element name="{if (position() = 1) then 'dct:accessRights' else 'dct:rights'}">
Expand All @@ -76,18 +76,11 @@
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>


<xsl:template mode="iso19115-3-to-dcat"
name="iso19115-3-to-dcat-license"
match="mdb:identificationInfo/*/mri:resourceConstraints/*[mco:useConstraints]">
<xsl:if test="count(../preceding-sibling::mri:resourceConstraints/*[mco:useConstraints]) = 0">
<xsl:variable name="useConstraints"
as="node()*">
<xsl:copy-of select="ancestor::mri:resourceConstraints/*[mco:useConstraints]/mco:otherConstraints"/>
<xsl:copy-of select="ancestor::mri:resourceConstraints/*[mco:useConstraints]/mco:useLimitation"/>
<xsl:copy-of select="../../mri:resourceConstraints/*[mco:useConstraints]/mco:otherConstraints"/>
<xsl:copy-of select="../../mri:resourceConstraints/*[mco:useConstraints]/mco:useLimitation"/>
</xsl:variable>

<xsl:variable name="licensesAndRights" as="node()*">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,15 @@
|mri:otherLocale
|mdb:defaultLocale
|mdb:otherLocale">
<xsl:variable name="languageValue"
as="xs:string?"
select="if ($isoToDcatLanguage[@key = current()/*/lan:language/*/@codeListValue])
then $isoToDcatLanguage[@key = current()/*/lan:language/*/@codeListValue]
else */lan:language/*/@codeListValue"/>

<dct:language>
<!-- TO CHECK: In DCAT, maybe we should use another base URI? -->
<dct:LinguisticSystem rdf:about="{concat($europaPublicationLanguage, upper-case(*/lan:language/*/@codeListValue))}"/>
<dct:LinguisticSystem rdf:about="{concat($europaPublicationLanguage, upper-case($languageValue))}"/>
</dct:language>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,18 @@
<entry key="https://publications.europa.eu/resource/authority/file-type/GML">wps</entry>
<entry key="https://publications.europa.eu/resource/authority/file-type/ZIP">zip</entry>
</xsl:variable>

<!-- DCAT uses the terminology code, while ISO uses bibliographic code.
For some languages like Dutch, French or German the values differ. -->
<xsl:variable name="isoToDcatLanguage"
as="node()*">
<entry key="dut">nld</entry> <!-- Dutch -->
<entry key="cze">ces</entry> <!-- Czech -->
<entry key="ger">deu</entry> <!-- German -->
<entry key="gre">ell</entry> <!-- Greek -->
<entry key="fre">fra</entry> <!-- French -->
<entry key="rum">ron</entry> <!-- Romanian -->
<entry key="slo">slk</entry> <!-- Slovak -->
<entry key="ice">isl</entry> <!-- Icelandic-->
</xsl:variable>
</xsl:stylesheet>

0 comments on commit e49ef40

Please sign in to comment.