Skip to content

Commit

Permalink
DCAT formatter / Improve the functions to obtain record / resource UR…
Browse files Browse the repository at this point in the history
…Is to produce full URIs.

Previously rdf:about elements contained not a full URI, like rdf:about='353108a0-f0f8-4f8e-9d0e-60f18dfda169' that was causing validation issues in DCAT-AP validator
  • Loading branch information
josegar74 committed Feb 6, 2025
1 parent 03c2aae commit fa8a2f9
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@
<!-- TODO: Should we consider DOI? It may be encoded in metadata linkage (not available in ISO19139) -->

<xsl:value-of select="if($metadataLinkage) then $metadataLinkage
else if($metadataIdentifier) then $metadataIdentifier
else concat($resourcePrefix, encode-for-uri($metadata/mdb:metadataIdentifier/*/mcc:code/*/text()))"
else if (string($metadataIdentifier) and starts-with($metadataIdentifier, 'http')) then $metadataIdentifier
else if (string($metadataIdentifier)) then concat($resourcePrefix, encode-for-uri($metadataIdentifier))
else concat($resourcePrefix, encode-for-uri($metadata/mdb:metadataIdentifier/*/mcc:code/*/text()))"
/>
</xsl:function>

Expand All @@ -125,7 +126,7 @@
select="($metadata/mdb:identificationInfo/*/mri:citation/*/cit:identifier)[1]"/>
</xsl:variable>

<xsl:value-of select="if($resourceIdentifier) then $resourceIdentifier
<xsl:value-of select="if(string($resourceIdentifier) and starts-with($resourceIdentifier, 'http')) then $resourceIdentifier
else concat($catalogRecordUri, '#resource')"
/>
</xsl:function>
Expand Down Expand Up @@ -247,6 +248,8 @@
|cit:identifier">
<xsl:variable name="code"
select="*/mcc:code/*/text()"/>
<xsl:variable name="codeAnchor"
select="*/mcc:code/*/@xlink:href"/>
<xsl:variable name="codeSpace"
select="*/mcc:codeSpace/*/text()"/>
<xsl:variable name="isUrn"
Expand All @@ -261,6 +264,7 @@
then concat($codeSpace,
(if (ends-with($codeSpace, $separator)) then '' else $separator),
$code)
else if ($codeAnchor) then $codeAnchor
else $code"/>

<xsl:variable name="codeType"
Expand Down

0 comments on commit fa8a2f9

Please sign in to comment.