Skip to content

Commit

Permalink
Formatter / DCAT / Service
Browse files Browse the repository at this point in the history
Fix service mapping for DCAT due to the change in namespace for SRV (#7806) which happened in between PRs.
  • Loading branch information
fxprunayre committed Nov 29, 2024
1 parent 0fc0447 commit 9d8976f
Show file tree
Hide file tree
Showing 7 changed files with 451 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
xmlns:msr="http://standards.iso.org/iso/19115/-3/msr/2.0"
xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0"
xmlns:mdq="http://standards.iso.org/iso/19157/-2/mdq/1.0"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.1"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0"
xmlns:gex="http://standards.iso.org/iso/19115/-3/gex/1.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
xmlns:msr="http://standards.iso.org/iso/19115/-3/msr/2.0"
xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0"
xmlns:mdq="http://standards.iso.org/iso/19157/-2/mdq/1.0"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.1"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0"
xmlns:gex="http://standards.iso.org/iso/19115/-3/gex/1.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,36 @@
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:srv="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0"
xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0"
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')"/>
<!--
Filter to define which service operation has to be considered
as an endpoint URL or description depending on linkage and protocol.
-->
<xsl:param name="endpointDescriptionUrllExpression"
as="xs:string"
select="'GetCapabilities|WSDL'"/>
<xsl:param name="endpointDescriptionProtocolsExpression"
as="xs:string"
select="'OpenAPI|Swagger|GetCapabilities|WSDL|Description'"/>

<!--
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/*[not(cit:protocol/*/text() = $endpointDescriptionProtocols)]/cit:linkage">
<dcat:endpointURL rdf:resource="{normalize-space(gco:CharacterString/text())}"/>
match="srv:containsOperations/*/srv:connectPoint/*[not(
matches(cit:protocol/(gco:CharacterString|gcx:Anchor)/text(), $endpointDescriptionProtocolsExpression, 'i')
or matches(cit:linkage/(gco:CharacterString|gcx:Anchor)/text(), $endpointDescriptionUrllExpression, 'i'))]/cit:linkage">

<dcat:endpointURL rdf:resource="{normalize-space((gco:CharacterString|gcx:Anchor)/text())}"/>
</xsl:template>


Expand All @@ -31,11 +43,19 @@
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.
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="{normalize-space(gco:CharacterString/text())}"/>
match="srv:containsOperations/*/srv:connectPoint/*[
matches(cit:protocol/(gco:CharacterString|gcx:Anchor)/text(), $endpointDescriptionProtocolsExpression, 'i')
or matches(cit:linkage/(gco:CharacterString|gcx:Anchor)/text(), $endpointDescriptionUrllExpression, 'i')]/cit:linkage">
<dcat:endpointDescription rdf:resource="{normalize-space((gco:CharacterString|gcx:Anchor)/text())}"/>
</xsl:template>

<!--
Expand All @@ -46,7 +66,7 @@
<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:Dataset rdf:about="{if (@xlink:href) then @xlink:href else @uuidref}"/>
</dcat:servesDataset>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
xmlns:mmi="http://standards.iso.org/iso/19115/-3/mmi/1.0"
xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0"
xmlns:mdq="http://standards.iso.org/iso/19157/-2/mdq/1.0"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.1"
xmlns:srv="http://standards.iso.org/iso/19115/-3/srv/2.0"
xmlns:gex="http://standards.iso.org/iso/19115/-3/gex/1.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
Expand Down
Loading

0 comments on commit 9d8976f

Please sign in to comment.