Skip to content

Commit

Permalink
Merge remote-tracking branch 'mw/dcat' into metawal-4.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed May 16, 2024
2 parents c098893 + fe54f4a commit bb6542c
Show file tree
Hide file tree
Showing 14 changed files with 9,478 additions and 1,974 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
exclude-result-prefixes="#all">

<xsl:variable name="euLicenses"
select="document('vocabularies/licences-skos.rdf')"/>

<xsl:variable name="isMappingResourceConstraintsToEuVocabulary"
as="xs:boolean"
select="false()"/>

<!--
RDF Property: dcterms:accessRights
Definition: Information about who can access the resource or an indication of its security status.
Expand Down Expand Up @@ -81,45 +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>
<!-- TODO: isMappingResourceConstraintsToEuVocabulary -->
<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>
</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 bb6542c

Please sign in to comment.