Skip to content

Commit

Permalink
Formatter / EU-DCAT-AP / Improve shacl validation status - primaryTop…
Browse files Browse the repository at this point in the history
…ic is required even if isPrimaryTopic is defined. Only one rights allowed.
  • Loading branch information
fxprunayre committed Dec 15, 2023
1 parent f0bf45e commit b85e1e5
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,22 @@
match="mdb:identificationInfo/*/mri:resourceConstraints/*[mco:accessConstraints]">
<xsl:if test="count(../preceding-sibling::mri:resourceConstraints/*[mco:accessConstraints]) = 0">
<xsl:for-each select="../../mri:resourceConstraints/*[mco:accessConstraints]/mco:otherConstraints">
<xsl:element name="{if (position() = 1) then 'dct:accessRights' else '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="'rdfs:label'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</dct:RightsStatement>
</xsl:element>
<xsl:if test="position() = 1 or ($isPreservingAllResourceConstraints and position() > 1)">
<xsl:element name="{if (position() = 1) then 'dct:accessRights' else '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="'rdfs:label'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</dct:RightsStatement>
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
Expand Down Expand Up @@ -98,20 +100,22 @@
</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="'rdfs:label'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</dct:RightsStatement>
</dct:rights>
<xsl:if test="$isPreservingAllResourceConstraints">
<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="'rdfs:label'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</dct:RightsStatement>
</dct:rights>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/ns/dcat#CatalogRecord"/>
<xsl:copy-of select="$properties"/>
<foaf:primaryTopic rdf:resource="{$recordUri}"/>
</rdf:Description>
</foaf:isPrimaryTopicOf>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<xsl:import href="dcat-core-associated.xsl"/>
<xsl:import href="dcat-core-lineage.xsl"/>

<xsl:variable name="recordUri"
select="/root/mdb:MD_Metadata/mdb:metadataLinkage/*/cit:linkage/*/text()"/>

<xsl:variable name="languages"
as="node()*">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all">
<xsl:param name="expandSkosConcept" select="'true'"/>
<xsl:param name="isExpandSkosConcept" select="xs:boolean($expandSkosConcept)"/>
<xsl:param name="expandSkosConcept"
select="'true'"/>
<xsl:param name="isExpandSkosConcept"
select="xs:boolean($expandSkosConcept)"/>

<xsl:variable name="isPreservingAllResourceConstraints"
as="xs:boolean"
select="true()"/>

<xsl:variable name="europaPublicationBaseUri" select="'http://publications.europa.eu/resource/authority/'"/>
<xsl:variable name="europaPublicationCorporateBody" select="concat($europaPublicationBaseUri,'corporate-body/')"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<xsl:import href="../dcat/dcat-core.xsl"/>
<xsl:import href="eu-dcat-ap-core-dataset.xsl"/>

<xsl:variable name="isPreservingAllResourceConstraints"
as="xs:boolean"
select="false()"/>
<!--
Catalogue Record
[o] title Literal 0..* A name given to the Catalogue Record. This property can be repeated for parallel language versions of the name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
l'exception de celles qui ont été attribuées à la cellule de développement territorial (CDT), également
dénommée "ESPACE", dont la création a été décidée par le Gouvernement wallon le 19 septembre 2005.
</dct:description>
<foaf:primaryTopic rdf:resource="https://metawal.wallonie.be/geonetwork/srv/api/records/7fe2f305-1302-4297-b67e-792f55acd834"/>
</rdf:Description>
</foaf:isPrimaryTopicOf>
<dcat:landingPage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- Accéder aux séries de couches de données géographiques relatives au thème "Sites protégés" et aux sites de
désignation par site protégé.
</dct:description>
<foaf:primaryTopic rdf:resource="https://metawal.wallonie.be/geonetwork/srv/api/records/3dbe0017-a71f-4923-9b44-fdb5afef5778"/>
</rdf:Description>
</foaf:isPrimaryTopicOf>
<dcat:landingPage>
Expand Down
Loading

0 comments on commit b85e1e5

Please sign in to comment.