Skip to content

Commit

Permalink
Formatter / EU-DCAT-AP-HVD / Base conversion with HVD category
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Jan 2, 2024
1 parent 9aae81d commit 92638f0
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
exclude-result-prefixes="#all">

<!-- TODO: either we only use the associated records in the current record
either we get all associated records using the API? -->
either we get all associated records using the API?
we may also have limitation depending on user privileges.-->

<xsl:variable name="isoAssociatedTypesToDcatCommonNames"
as="node()*">
Expand Down Expand Up @@ -101,19 +102,7 @@
else 'dct:relation'"/>

<xsl:element name="{$elementType}">
<xsl:choose>
<xsl:when test="*/mri:metadataReference/@xlink:href">
<xsl:attribute name="rdf:resource" select="*/mri:metadataReference/@xlink:href"/>
</xsl:when>
<xsl:when test="*/mri:metadataReference/@uuidref">
<!-- TODO: Here we need a not relative URI? -->
<xsl:attribute name="rdf:resource" select="*/mri:metadataReference/@uuidref"/>
</xsl:when>
<xsl:otherwise>
<!-- TODO: Here we need a not relative URI? -->
<xsl:attribute name="rdf:resource" select="*/mri:aggregateDataSetIdentifier/*/mri:code/*/text()"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates mode="rdf-metadata-ref" select="*/mri:metadataReference|*/mri:aggregateDataSetIdentifier"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0"
xmlns:lan="http://standards.iso.org/iso/19115/-3/lan/1.0"
xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/2.0"
xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:dcat="http://www.w3.org/ns/dcat#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
Expand All @@ -14,6 +15,7 @@
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:adms="http://www.w3.org/ns/adms#"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="#all">

<xsl:template name="create-node-with-info">
Expand Down Expand Up @@ -80,4 +82,20 @@
</xsl:element>
</xsl:template>

<xsl:template mode="rdf-metadata-ref" match="*">
<xsl:choose>
<xsl:when test="@xlink:href">
<xsl:attribute name="rdf:resource" select="@xlink:href"/>
</xsl:when>
<xsl:when test="@uuidref">
<!-- TODO: Here we need a not relative URI? -->
<xsl:attribute name="rdf:resource" select="@uuidref"/>
</xsl:when>
<xsl:otherwise>
<!-- TODO: Here we need a not relative URI? -->
<xsl:attribute name="rdf:resource" select="*/mri:code/*/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mdb="http://standards.iso.org/iso/19115/-3/mdb/2.0"
xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0"
xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/2.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:dcatap="http://data.europa.eu/r5r/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dct="http://purl.org/dc/terms/"
exclude-result-prefixes="#all">
<xsl:import href="../eu-dcat-ap/eu-dcat-ap-core.xsl"/>

<xsl:variable name="hvdCategoryThesaurusKey"
select="'http://data.europa.eu/bna/asd487ae75'"/>

<xsl:variable name="euHvdDataCategories"
select="document('vocabularies/high-value-dataset-category.rdf')"/>


<!--
Dataset
applicable legislation Legal Resource 1..* The legislation that mandates the creation or management of the Dataset. For HVD the value must include the ELI http://data.europa.eu/eli/reg_impl/2023/138/oj.
As multiple legislations may apply to the resource the maximum cardinality is not limited. P
conforms to Standard 0..* An implementing rule or other specification. The provided information should enable to the verification whether the detailed information requirements by the HVD is satisfied. For more usage suggestions see section on specific data requirements. Link A
contact point Kind 0..* Contact information that can be used for sending comments about the Dataset. Link A
dataset distribution Distribution 1..* An available Distribution for the Dataset. The HVD IR is a quality improvement of existing datasets. The intention is that HVD datasets are publicly and open accessible. Therefore a Distribution is expected to be present. (Article 3.1) Link A
DataService
applicable legislation Legal Resource 1..* The legislation that mandates the creation or management of the Data Service. For HVD the value MUST include the ELI http://data.europa.eu/eli/reg_impl/2023/138/oj.
As multiple legislations may apply to the resource the maximum cardinality is not limited. P
contact point Kind 1..* Contact information that can be used for sending comments about the Data Service. Article 3.4 requires the designation of a point of contact for an API. Link P
documentation Document 1..* A page that provides additional information about the Data Service. Quality of service covers a broad spectrum of aspects. The HVD regulation does not list any mandatory topic. Therefore quality of service information is considered part of the generic documentation of a Data Service. P
endpoint description Resource 0..* A description of the services available via the end-points, including their operations, parameters etc. The property gives specific details of the actual endpoint instances, while dct:conformsTo is used to indicate the general standard or specification that the endpoints implement.
Article 3.3 requires to provide API documentation in a Union or internationally recognised open, human-readable and machine-readable format. Link E
endpoint URL Resource 1..* The root location or primary endpoint of the service (an IRI). The endpoint URL SHOULD be persistent. This means that publishers should do everything in their power to maintain the value stable and existing. Link E
HVD category Concept 1..* The HVD category to which this Data Service belongs. P
licence Licence Document 0..1 A licence under which the Data service is made available. Article 3.3 specifies that the terms of use should be provided. According to the guidelines for legal Information in DCAT-AP HVD this is fullfilled by providing by preference a licence. As alternative rights can be used. Link E
rights Rights statement 0..* A statement that specifies rights associated with the Distribution. Article 3.3 specifies that the terms of use should be provided. According to the guidelines for legal Information in DCAT-AP HVD this is fullfilled by providing by preference a licence. As alternative rights can be used. P
serves dataset Dataset 1..* This property refers to a collection of data that this data service can distribute. An API in the context of HVD is not a standalone resource. It is used to open up HVD datasets. Therefore each Data Service is at least tightly connected with a Dataset. Link E
Distribution
access service Data Service 0..* A data service that gives access to the distribution of the dataset Link A
access URL Resource 1..* A URL that gives access to a Distribution of the Dataset. The resource at the access URL contains information about how to get the Dataset. In accordance to the DCAT guidelines it is preferred to also set the downloadURL property if the URL is a reference to a downloadable resource. Link A
applicable legislation Legal Resource 1..* The legislation that mandates the creation or management of the Distribution For HVD the value must include the ELI http://data.europa.eu/eli/reg_impl/2023/138/oj.
As multiple legislations may apply to the resource the maximum cardinality is not limited. P
licence Licence Document 0..1 A licence under which the Distribution is made available. Article 4.3 specifies that High-value datasets should be made available for reuse. According to the guidelines for legal Information in DCAT-AP HVD this is fullfilled by providing by preference a licence. As alternative rights can be used. Link E
linked schemas Standard 0..* An established schema to which the described Distribution conforms. The provided information should enable to the verification whether the detailed information requirements by the HVD is satisfied. For more usage suggestions see section on specific data requirements. Link A
rights Rights statement 0..* A statement that specifies rights associated with the Distribution. Article 4.3 specifies that High-value datasets should be made available for reuse. According to the guidelines for legal Information in DCAT-AP HVD this is fullfilled by providing by preference a licence. As alternative rights can be used. Link E
-->

<!--
HVD Category Concept 1..* The HVD category to which this Dataset belongs. P
-->
<xsl:template mode="iso19115-3-to-dcat"
match="mri:descriptiveKeywords[*/mri:thesaurusName/*/cit:title/*/@xlink:href = $hvdCategoryThesaurusKey]">
<xsl:for-each select="*/mri:keyword[*/text() != '']">

<xsl:variable name="hvdCategory"
select="$euHvdDataCategories/rdf:RDF/rdf:Description[skos:prefLabel/text() = current()/*/text()]"/>
<xsl:if test="$hvdCategory">
<dcatap:hvdCategory>
<skos:Concept rdf:about="{$hvdCategory/@rdf:about}">
<xsl:copy-of select="$hvdCategory/skos:prefLabel[@xml:lang = $languages/@iso2code]"/>
</skos:Concept>
</dcatap:hvdCategory>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mdb="http://standards.iso.org/iso/19115/-3/mdb/2.0"
xmlns:mcc="http://standards.iso.org/iso/19115/-3/mcc/1.0"
xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dct="http://purl.org/dc/terms/"
exclude-result-prefixes="#all">
<!-- https://semiceu.github.io/DCAT-AP/releases/2.2.0-hvd/ -->
<xsl:import href="eu-dcat-ap-hvd-core.xsl"/>

<xsl:template match="/root"
priority="2">
<rdf:RDF>
<xsl:call-template name="create-namespaces-eu-dcat-ap"/>
<xsl:apply-templates mode="iso19115-3-to-dcat"
select="mdb:MD_Metadata"/>
</rdf:RDF>
</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit 92638f0

Please sign in to comment.