Skip to content

Commit

Permalink
Standards / ISO / Formatters / DCAT / Updates following GeoDCAT-AP wo…
Browse files Browse the repository at this point in the history
…rking group meeting.
  • Loading branch information
fxprunayre committed May 16, 2024
1 parent 7398ba1 commit 0bb68c1
Show file tree
Hide file tree
Showing 11 changed files with 2,214 additions and 1,830 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,59 +89,52 @@
<xsl:copy-of select="ancestor::mri:resourceConstraints/*[mco:useConstraints]/mco:otherConstraints"/>
<xsl:copy-of select="ancestor::mri:resourceConstraints/*[mco:useConstraints]/mco:useLimitation"/>
</xsl:variable>
<xsl:for-each select="$useConstraints">
<xsl:choose>
<xsl:when test="position() = 1">
<dct:license>
<dct:LicenseDocument>
<xsl:choose>
<xsl:when test="gcx:Anchor/@xlink:href">
<xsl:if test="$isMappingResourceConstraintsToEuVocabulary = true()">
<xsl:variable name="licenseUri" select="replace(gcx:Anchor/@xlink:href,'https?://','')"/>
<xsl:variable name="dcatLicense"
select="$euLicenses/rdf:RDF/skos:Concept[matches(skos:exactMatch/@rdf:resource,concat('https?://',$licenseUri,'/?'))]"/>
<xsl:if test="$dcatLicense != ''"><!-- If license found in vocabulary -->
<skos:Concept rdf:about="{$dcatLicense/@rdf:about}">
<xsl:copy-of select="$dcatLicense/skos:prefLabel[@xml:lang = $languages/@iso2code] | $dcatLicense/skos:exactMatch"
copy-namespaces="no"/>
</skos:Concept>
</xsl:if>
</xsl:if>

<!-- KEEP License as is-->
<xsl:if test="$isMappingResourceConstraintsToEuVocabulary = false()">
<xsl:attribute name="rdf:about" select="gcx:Anchor/@xlink:href"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="rdf-localised">
<xsl:with-param name="nodeName" select="'dct:description'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</dct:LicenseDocument>
</dct:license>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$isPreservingAllResourceConstraints">

<xsl:variable name="licensesAndRights" as="node()*">
<xsl:for-each select="$useConstraints">

<xsl:variable name="httpUriInAnchorOrText"
select="(gcx:Anchor/@xlink:href[starts-with(., 'http')]
|gco:CharacterString[starts-with(., 'http')])[1]"/>

<xsl:choose>
<xsl:when test="$httpUriInAnchorOrText != '' and $isMappingResourceConstraintsToEuVocabulary = true()">
<xsl:variable name="licenseUriWithoutHttp"
select="replace($httpUriInAnchorOrText,'https?://','')"/>
<xsl:variable name="euDcatLicense"
select="$euLicenses/rdf:RDF/skos:Concept[
matches(skos:exactMatch/@rdf:resource,
concat('https?://', $licenseUriWithoutHttp, '/?'))]"/>

<xsl:if test="$euDcatLicense != ''">
<dct:license>
<dct:LicenseDocument rdf:about="{$euDcatLicense/@rdf:about}">
<!--<xsl:copy-of select="$euDcatLicense/(skos:prefLabel[@xml:lang = $languages/@iso2code]
|skos:exactMatch)"
copy-namespaces="no"/>-->
</dct:LicenseDocument>
</dct:license>
</xsl:if>
</xsl:when>
<xsl:when test="$httpUriInAnchorOrText != ''">
<dct:license>
<dct:LicenseDocument rdf:about="{$httpUriInAnchorOrText}"/>
</dct:license>
</xsl:when>
<xsl:otherwise>
<dct:rights>
<dct:RightsStatement>
<xsl:choose>
<xsl:when test="gcx:Anchor/@xlink:href">
<xsl:attribute name="rdf:about" select="gcx:Anchor/@xlink:href"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="rdf-localised">
<xsl:with-param name="nodeName" select="'dct:description'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="rdf-localised">
<xsl:with-param name="nodeName" select="'dct:description'"/>
</xsl:call-template>
</dct:RightsStatement>
</dct:rights>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>

<xsl:copy-of select="$licensesAndRights"/>
</xsl:if>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Range: rdfs:Resource
-->
<xsl:template mode="iso19115-3-to-dcat"
match="srv:containsOperations/*/srv:connectPoint/*[cit:protocol/*/text() != $endpointDescriptionProtocols]/cit:linkage">
match="srv:containsOperations/*/srv:connectPoint/*[not(cit:protocol/*/text() = $endpointDescriptionProtocols)]/cit:linkage">
<dcat:endpointURL rdf:resource="{normalize-space(gco:CharacterString/text())}"/>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:mco="http://standards.iso.org/iso/19115/-3/mco/1.0"
xmlns:mdq="http://standards.iso.org/iso/19157/-2/mdq/1.0"
xmlns:mrl="http://standards.iso.org/iso/19115/-3/mrl/2.0"
xmlns:mrs="http://standards.iso.org/iso/19115/-3/mrs/1.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
exclude-result-prefixes="#all">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,7 @@
<!-- TODO: Add mapping to Datacite https://schema.datacite.org/meta/kernel-4.1/include/datacite-resourceType-v4.1.xsd ?-->
</xsl:template>


<xsl:template mode="iso19115-3-to-dcat"
match="mdb:referenceSystemInfo/*/mrs:referenceSystemIdentifier/*"/>
</xsl:stylesheet>
Loading

0 comments on commit 0bb68c1

Please sign in to comment.