Skip to content

Commit

Permalink
Add dcatde:contributorID to dcat output and update namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
seitenbau-govdata authored and jvanzadelhoff committed Jul 17, 2020
1 parent 7ff7a18 commit 70105ce
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/resources/camel-oai-pmh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ db.item.csw.TYPE=${db.item.csw.TYPE}
db.item.csw.URL=${db.item.csw.URL}
db.item.ckan.TYPE=${db.item.ckan.TYPE}
db.item.ckan.URL=${db.item.ckan.URL}
dcatde.contributorID=http:https://dcat-ap.de/def/contributors/gdiDE
6 changes: 6 additions & 0 deletions src/main/resources/camel-oai-pmh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
<setHeader headerName="response_date">
<simple>${date:now:yyyy-MM-dd'T'HH:mm:ss'Z'}</simple>
</setHeader>
<setHeader headerName="contributorID">
<simple>{{dcatde.contributorID}}</simple>
</setHeader>
<removeHeader headerName="page"/>
<removeHeader headerName="cookie"/>
<!-- we need some element for xsl input, but the result only depends on header (request) parameters -->
Expand Down Expand Up @@ -231,6 +234,9 @@
<setHeader headerName="baseCatalogUri">
<simple>{{rdf.catalog.base.url}}</simple>
</setHeader>
<setHeader headerName="contributorID">
<simple>{{dcatde.contributorID}}</simple>
</setHeader>
<removeHeader headerName="resumptionToken"/>
<removeHeader headerName="cookie"/>
<!-- we need some element for xsl input, but the result only depends on header (request) parameters -->
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/dcat2iso.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
xmlns:rdfs="http:https://www.w3.org/2000/01/rdf-schema#"
xmlns:srv="http:https://www.isotc211.org/2005/srv"
xmlns:vcard="http:https://www.w3.org/2006/vcard/ns#"
xmlns:dcatde="http:https://dcat-ap.de/def/dcatde/1_0/"
xmlns:dcatde="http:https://dcat-ap.de/def/dcatde/"
exclude-result-prefixes="dcat dcatde dct foaf gml locn rdf rdfs vcard"
expand-text="true">
<xsl:output method="xml"/>
Expand Down
20 changes: 17 additions & 3 deletions src/main/resources/iso2dcat.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
xmlns:xlink="http:https://www.w3.org/1999/xlink"
xmlns:cnt="http:https://www.w3.org/2011/content#"
xmlns:gmi="http:https://www.isotc211.org/2005/gmi"
xmlns:dcatde="http:https://dcat-ap.de/def/dcatde/1_0/"
xmlns:dcatde="http:https://dcat-ap.de/def/dcatde/"
xmlns:adms="http:https://www.w3.org/ns/adms#"
xmlns:org="http:https://www.w3.org/ns/org#"
xmlns:xs="http:https://www.w3.org/2001/XMLSchema"
Expand All @@ -29,16 +29,17 @@

<xsl:output method="xml"/>

<!-- Parameters from route -->
<xsl:param name="contributorID"/>

<!--
<xsl:strip-space elements="*"/>
-->
<xsl:variable name="c_license">license</xsl:variable>
<xsl:variable name="c_no_limitation">keine</xsl:variable>
<xsl:variable name="c_other_restrictions">otherRestrictions</xsl:variable>

<xsl:param name="resumptionToken">51:dcat_ap::</xsl:param>
<xsl:variable name="tokeDcatAp">:dcat_ap:</xsl:variable>
<xsl:param name="metadataPrefix">dcat_ap</xsl:param>
<xsl:variable name="prefixDcatAp">dcat_ap</xsl:variable>

<xsl:variable name="mdrFileTypes" select="document('filetypes-skos.rdf')"/>
Expand Down Expand Up @@ -87,6 +88,9 @@
<!--dct:description-->
<xsl:apply-templates select="gmd:identificationInfo[1]/*/gmd:abstract/gco:CharacterString[text()]"/>

<!-- dcatde:contributorID -->
<xsl:call-template name="contributorID"/>

<!--dct:identifier-->
<xsl:apply-templates select="gmd:fileIdentifier/gco:CharacterString"/>

Expand Down Expand Up @@ -150,6 +154,16 @@
</dcat:Dataset>
</xsl:template>

<xsl:template name="contributorID">
<xsl:if test="$contributorID">
<dcatde:contributorID>
<xsl:attribute name="rdf:resource">
<xsl:value-of select="$contributorID"/>
</xsl:attribute>
</dcatde:contributorID>
</xsl:if>
</xsl:template>

<xsl:template match="gmd:fileIdentifier/*">
<adms:identifier>
<xsl:value-of select="."/>
Expand Down

0 comments on commit 70105ce

Please sign in to comment.