Skip to content

Commit

Permalink
Formatter / DCAT / Core / Dataset / Services.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Dec 11, 2023
1 parent 18fb48c commit 18285eb
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?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:xlink="http://www.w3.org/1999/xlink"
xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/2.0"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.1"
xmlns:dcat="http://www.w3.org/ns/dcat#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
exclude-result-prefixes="#all">

<xsl:variable name="endpointDescriptionProtocols"
as="xs:string*"
select="('OpenAPI', 'GetCapabilities')"/>
<!--
RDF Property: dcat:endpointURL
Definition: The root location or primary endpoint of the service (a Web-resolvable IRI).
Domain: dcat:DataService
Range: rdfs:Resource
-->
<xsl:template mode="iso19115-3-to-dcat"
match="srv:containsOperations/*/srv:connectPoint/*[cit:protocol/*/text() != $endpointDescriptionProtocols]/cit:linkage">
<dcat:endpointURL rdf:resource="{*/text()}"/>
</xsl:template>

<!--
RDF Property: dcat:endpointDescription
Definition: A description of the services available via the end-points, including their operations, parameters etc.
Domain: dcat:DataService
Range: rdfs:Resource
Usage note: The endpoint description gives specific details of the actual endpoint instances, while dcterms:conformsTo is used to indicate the general standard or specification that the endpoints implement.
Usage note: An endpoint description may be expressed in a machine-readable form, such as an OpenAPI (Swagger) description [OpenAPI], an OGC GetCapabilities response [WFS], [ISO-19142], [WMS], [ISO-19128], a SPARQL Service Description [SPARQL11-SERVICE-DESCRIPTION], an [OpenSearch] or [WSDL20] document, a Hydra API description [HYDRA], else in text or some other informal mode if a formal representation is not possible.
-->
<xsl:template mode="iso19115-3-to-dcat"
match="srv:containsOperations/*/srv:connectPoint/*[cit:protocol/*/text() = $endpointDescriptionProtocols]/cit:linkage">
<dcat:endpointDescription rdf:resource="{*/text()}"/>
</xsl:template>

<!--
RDF Property: dcat:servesDataset
Definition: A collection of data that this data service can distribute.
Range: dcat:Dataset
-->
<xsl:template mode="iso19115-3-to-dcat"
match="srv:operatesOn">
<dcat:servesDataset>
<dcat:Dataset rdf:about="{if (@xlink:href) then @xlink:href else @uriref}"/>
</dcat:servesDataset>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<xsl:import href="dcat-utils.xsl"/>

<xsl:import href="dcat-core-catalog.xsl"/>
<xsl:import href="dcat-core-dataservice.xsl"/>
<xsl:import href="dcat-core-dataset.xsl"/>
<xsl:import href="dcat-core-contact.xsl"/>
<xsl:import href="dcat-core-keywords.xsl"/>
Expand Down Expand Up @@ -100,7 +101,7 @@
|mdb:metadataLinkage
"/>

<!-- Dataset
<!-- Dataset, DatasetSeries
Unsupported:
* prov:wasGeneratedBy (Could be associated resource of type project?)
-->
Expand All @@ -112,7 +113,13 @@
|mdb:identificationInfo/*/mri:extent/*/gex:geographicElement/gex:EX_GeographicDescription
|mdb:identificationInfo/*/mri:extent/*/gex:temporalElement/*/gex:extent
|mdb:distributionInfo//mrd:onLine
"/>
"/>

<!-- DataService -->
<xsl:apply-templates mode="iso19115-3-to-dcat"
select="mdb:identificationInfo/*/srv:containsOperations/*/srv:connectPoint/*/cit:linkage
|mdb:identificationInfo/*/srv:operatesOn
"/>
</rdf:Description>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
<xsl:variable name="isoToDcatCommonNames"
as="node()*">
<entry key="dct:title">mdb:MD_Metadata/mdb:identificationInfo/mri:MD_DataIdentification/mri:citation/cit:CI_Citation/cit:title</entry>
<entry key="dct:title">mdb:MD_Metadata/mdb:identificationInfo/srv:SV_ServiceIdentification/mri:citation/cit:CI_Citation/cit:title</entry>
<entry key="dct:title">mdb:MD_Metadata/mdb:metadataStandard/cit:CI_Citation/cit:title</entry>
<entry key="dct:title">mdb:MD_Metadata/mdb:distributionInfo/mrd:MD_Distribution/mrd:transferOptions/mrd:MD_DigitalTransferOptions/mrd:onLine/cit:CI_OnlineResource/cit:name</entry>
<entry key="dct:title">mdb:MD_Metadata/mdb:distributionInfo/mrd:MD_Distribution/mrd:distributor/mrd:MD_Distributor/mrd:distributorTransferOptions/mrd:MD_DigitalTransferOptions/mrd:onLine/cit:CI_OnlineResource/cit:name</entry>
<entry key="dcat:version" isMultilingual="false">mdb:MD_Metadata/mdb:identificationInfo/mri:MD_DataIdentification/mri:citation/cit:CI_Citation/cit:edition</entry>
<entry key="dcat:version" isMultilingual="false">mdb:MD_Metadata/mdb:identificationInfo/srv:SV_ServiceIdentification/mri:citation/cit:CI_Citation/cit:edition</entry>
<entry key="dcat:keyword">mdb:MD_Metadata/mdb:identificationInfo/mri:MD_DataIdentification/mri:descriptiveKeywords/mri:MD_Keywords/mri:keyword</entry>
<entry key="dcat:keyword">mdb:MD_Metadata/mdb:identificationInfo/srv:SV_ServiceIdentification/mri:descriptiveKeywords/mri:MD_Keywords/mri:keyword</entry>
<entry key="dct:description">mdb:MD_Metadata/mdb:identificationInfo/mri:MD_DataIdentification/mri:abstract</entry>
<entry key="dct:description">mdb:MD_Metadata/mdb:identificationInfo/srv:SV_ServiceIdentification/mri:abstract</entry>
<entry key="dct:description">mdb:MD_Metadata/mdb:distributionInfo/mrd:MD_Distribution/mrd:transferOptions/mrd:MD_DigitalTransferOptions/mrd:onLine/cit:CI_OnlineResource/cit:description</entry>
<entry key="dct:description">mdb:MD_Metadata/mdb:distributionInfo/mrd:MD_Distribution/mrd:distributor/mrd:MD_Distributor/mrd:distributorTransferOptions/mrd:MD_DigitalTransferOptions/mrd:onLine/cit:CI_OnlineResource/cit:description</entry>
<entry key="owl:versionInfo">mdb:MD_Metadata/mdb:metadataStandard/cit:CI_Citation/cit:edition</entry>
Expand Down

0 comments on commit 18285eb

Please sign in to comment.