Skip to content

Commit

Permalink
Merge pull request #6043 from fgravin/ods-harvesting-mimetype
Browse files Browse the repository at this point in the history
Add mimetype in WWW:DOWNLOAD protocol on opendatasoft harveting
  • Loading branch information
fgravin authored Nov 19, 2021
2 parents 3a332d2 + c9a1247 commit 1a61cfd
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="#all">

<xsl:import href="protocol-mapping.xsl"></xsl:import>

<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

Expand Down Expand Up @@ -414,6 +416,7 @@
<mrd:transferOptions>
<mrd:MD_DigitalTransferOptions>
<xsl:for-each select="distribution">
<xsl:variable name="format" select="format"/>
<mrd:onLine>
<cit:CI_OnlineResource>
<cit:linkage>
Expand All @@ -423,11 +426,7 @@
</cit:linkage>
<cit:protocol>
<gco:CharacterString>
<xsl:choose>
<xsl:when test="format = 'Web Page'">WWW:LINK-1.0-http--link</xsl:when>
<xsl:when test="format = 'ArcGIS GeoServices REST API'">ESRI:REST</xsl:when>
<xsl:otherwise>WWW:DOWNLOAD</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$format-protocol-mapping/entry[format=lower-case($format)]/protocol"/>
</gco:CharacterString>
</cit:protocol>
<cit:name>
Expand All @@ -437,7 +436,7 @@
</cit:name>
<cit:description>
<gco:CharacterString>
<xsl:value-of select="format"/>
<xsl:value-of select="$format"/>
</gco:CharacterString>
</cit:description>
</cit:CI_OnlineResource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="#all">

<xsl:output method="xml" indent="yes"/>
<xsl:import href="protocol-mapping.xsl"></xsl:import>

<xsl:output method="xml" indent="yes"/>

<xsl:strip-space elements="*"/>

Expand Down Expand Up @@ -525,8 +527,6 @@
</mrd:MD_Distribution>
</mdb:distributionInfo>



<mdb:resourceLineage>
<mrl:LI_Lineage>
<mrl:statement>
Expand Down Expand Up @@ -555,16 +555,18 @@
</gco:CharacterString>
</cit:linkage>
<cit:protocol>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http--download</gco:CharacterString>
<gco:CharacterString>
<xsl:value-of select="$format-protocol-mapping/entry[format=lower-case($format)]/protocol"/>
</gco:CharacterString>
</cit:protocol>
<cit:name>
<gco:CharacterString>
<xsl:value-of select="concat('Download as ', upper-case($format))"/>
<xsl:value-of select="$format"/>
</gco:CharacterString>
</cit:name>
<cit:description>
<gco:CharacterString>
<xsl:value-of select="concat('Download this dataset in the ', upper-case($format), ' format.')"/>
<xsl:value-of select="$format"/>
</gco:CharacterString>
</cit:description>
<cit:function>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dct="http://purl.org/dc/terms/"
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:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:variable name="format-protocol-mapping">
<entry>
<format>csv</format>
<protocol>WWW:DOWNLOAD:text/csv</protocol>
</entry>
<entry>
<format>geojson</format>
<protocol>WWW:DOWNLOAD:application/vnd.geo+json</protocol>
</entry>
<entry>
<format>kml</format>
<protocol>WWW:DOWNLOAD:application/vnd.google-earth.kml+xml</protocol>
</entry>
<entry>
<format>zip</format>
<protocol>WWW:DOWNLOAD:application/zip</protocol>
</entry>
<entry>
<format>shapefile</format>
<protocol>WWW:DOWNLOAD:x-gis/x-shapefile</protocol>
</entry>
<entry>
<format>json</format>
<protocol>WWW:DOWNLOAD:application/json</protocol>
</entry>
<entry>
<format>web page</format>
<protocol>WWW:LINK-1.0-http--link</protocol>
</entry>
<entry>
<format>arcgis geoservices rest api</format>
<protocol>ESRI:REST</protocol>
</entry>
</xsl:variable>

</xsl:stylesheet>

0 comments on commit 1a61cfd

Please sign in to comment.