Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DCAT-AP v3 #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/main/plugin/dcat-ap/formatter/xsl-view/view.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@
<!-- Field with no lang : display all -->
<xsl:template mode="render-field" match="dct:created|dct:issued|dct:modified|dct:identifier|skos:notation|schema:startDate|
schema:endDate|vcard:street-address|vcard:locality|vcard:postal-code|vcard:country-name|
vcard:hasTelephone|vcard:fn|vcard:organization-name|skos:prefLabel|owl:versionInfo|
adms:versionNotes|dcat:byteSize|dcat:hadRole|dcat:spatialResolutionInMeters|dcat:temporalResolution">
vcard:hasTelephone|vcard:fn|vcard:organization-name|skos:prefLabel|dcat:version|
adms:versionNotes|dcat:byteSize|dcat:hadRole|dcat:spatialResolutionInMeters|dcat:temporalResolution|
owl:versionInfo"> <!-- DCAT-AP v2 compatibility -->
<xsl:param name="xpath"/>
<xsl:variable name="stringValue" select="string()"/>
<xsl:if test="normalize-space($stringValue) != ''">
Expand Down Expand Up @@ -549,7 +550,8 @@

<!-- ########################## -->
<!-- Render values for text with clickable URL ... -->
<xsl:template mode="render-value" match="dct:title|dct:description|owl:versionInfo|adms:versionNotes|dct:LicenseDocument/dct:identifier">
<xsl:template mode="render-value" match="dct:title|dct:description|dcat:version|adms:versionNotes|dct:LicenseDocument/dct:identifier|
owl:versionInfo"> <!-- DCAT-AP v2 compatibility -->
<xsl:call-template name="linkify">
<xsl:with-param name="txt" select="."/>
</xsl:call-template>
Expand Down Expand Up @@ -598,8 +600,9 @@
</xsl:template>

<xsl:template mode="render-url"
match="*[name(..) = 'dct:relation' or name(..) = 'dct:source' or name(..) = 'dct:isVersionOf' or name(..) = 'dct:hasVersion']|
@*[name(..) = 'dct:relation' or name(..) = 'dct:source' or name(..) = 'dct:isVersionOf' or name(..) = 'dct:hasVersion']">
match="*[name(..) = 'dct:relation' or name(..) = 'dct:source' or name(..) = 'dcat:isVersionOf' or name(..) = 'dcat:hasVersion']|
@*[name(..) = 'dct:relation' or name(..) = 'dct:source' or name(..) = 'dcat:isVersionOf' or name(..) = 'dcat:hasVersion']|
*[name(..) = 'dct:isVersionOf' or name(..) = 'dct:hasVersion']|@*[name(..) = 'dct:isVersionOf' or name(..) = 'dct:hasVersion']"> <!-- DCAT-AP v2 compatibility -->
<a
href="{concat($nodeUrl,$langId,'/catalog.search#/search?resultType=details&amp;sortBy=relevance&amp;from=1&amp;to=20&amp;fast=index&amp;_content_type=json&amp;any=',.)}"
style="color=#06c; text-decoration: underline;">
Expand Down
71 changes: 59 additions & 12 deletions src/main/plugin/dcat-ap/layout/config-editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,23 @@
</snippet>
</template>
</for>
<for name="dct:isVersionOf" templateModeOnly="true" forceLabel="true" label="key">
<for name="dcat:isVersionOf" templateModeOnly="true" forceLabel="true" label="key">
<template>
<values>
<key label="key" xpath="@rdf:resource" tooltip="dct:isVersionOf" required="true"/>
<key label="key" xpath="@rdf:resource" tooltip="dcat:isVersionOf" required="true"/>
</values>
<snippet>
<dct:isVersionOf rdf:resource="{{key}}"/>
<dcat:isVersionOf rdf:resource="{{key}}"/>
</snippet>
</template>
</for>
<for name="dct:hasVersion" templateModeOnly="true" forceLabel="true" label="key">
<for name="dcat:hasVersion" templateModeOnly="true" forceLabel="true" label="key">
<template>
<values>
<key label="key" xpath="@rdf:resource" tooltip="dct:hasVersion" required="true"/>
<key label="key" xpath="@rdf:resource" tooltip="dcat:hasVersion" required="true"/>
</values>
<snippet>
<dct:hasVersion rdf:resource="{{key}}"/>
<dcat:hasVersion rdf:resource="{{key}}"/>
</snippet>
</template>
</for>
Expand Down Expand Up @@ -343,6 +343,28 @@
</snippet>
</template>
</for>

<!-- DCAT-AP v2 compatibility -->
<for name="dct:isVersionOf" templateModeOnly="true" forceLabel="true" label="key">
<template>
<values>
<key label="key" xpath="@rdf:resource" tooltip="dct:isVersionOf" required="true"/>
</values>
<snippet>
<dct:isVersionOf rdf:resource="{{key}}"/>
</snippet>
</template>
</for>
<for name="dct:hasVersion" templateModeOnly="true" forceLabel="true" label="key">
<template>
<values>
<key label="key" xpath="@rdf:resource" tooltip="dct:hasVersion" required="true"/>
</values>
<snippet>
<dct:hasVersion rdf:resource="{{key}}"/>
</snippet>
</template>
</for>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need for keeping DCAT-ap 2 compatibility in the editor ?
Since DCAT 2 and 3 are pretty similar, maybe the update-fixed-info.xsl should automatically migrate any DCAT-ap 2 records being edited.

</fields>

<!-- Complex fields. -->
Expand Down Expand Up @@ -423,21 +445,26 @@
<name>dct:isPartOf</name>
<name>dct:relation</name>
<name>dct:isReferencedBy</name>
<name>dct:hasVersion</name>
<name>dct:isVersionOf</name>
<name>dct:source</name>
<name>dct:spatial</name>
<name>dct:accrualPeriodicity</name>
<name>foaf:Document</name>
<name>foaf:primaryTopic</name>
<name>owl:versionInfo</name>
<name>prov:atTime</name>
<name>spdx:checksum</name>
<name>vcard:hasEmail</name>
<name>vcard:hasTelephone</name>
<name>vcard:postal-code</name>
<name>vcard:fn</name>
<name>skos:inScheme</name>
<name>dcat:version</name>
<name>dcat:hasVersion</name>
<name>dcat:isVersionOf</name>

<!-- DCAT-AP v2 compatibility -->
<name>owl:versionInfo</name>
<name>dct:hasVersion</name>
<name>dct:isVersionOf</name>
</exclude>
</multilingualFields>

Expand Down Expand Up @@ -669,15 +696,20 @@
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
</section>
<section name="versionInformation">
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/owl:versionInfo"
or="versionInfo"
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dcat:version"
or="version"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:modified"
or="modified"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:issued"
or="issued"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>

<!-- DCAT-AP v2 compatibility -->
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/owl:versionInfo"
or="versionInfo"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
</section>
<section name="usageInformation">
<section xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dcat:contactPoint"/>
Expand Down Expand Up @@ -893,6 +925,10 @@
<field xpath="/rdf:RDF/dcat:Catalog/dcat:record/dcat:CatalogRecord/dct:conformsTo/dct:Standard/dct:title"/>
<field
xpath="/rdf:RDF/dcat:Catalog/dcat:record/dcat:CatalogRecord/dct:conformsTo/dct:Standard/dct:description"/>
<field
xpath="/rdf:RDF/dcat:Catalog/dcat:record/dcat:CatalogRecord/dct:conformsTo/dct:Standard/dcat:version"/>

<!-- DCAT-AP v2 compatibility -->
<field
xpath="/rdf:RDF/dcat:Catalog/dcat:record/dcat:CatalogRecord/dct:conformsTo/dct:Standard/owl:versionInfo"/>
</section>
Expand All @@ -905,6 +941,7 @@
<for name="dcat:keyword"/>
<for name="dcat:theme"/>
<!-- Version info -->
<for name="dcat:version"/>
<for name="owl:versionInfo"/>
<for name="dct:created"/>
<for name="dct:modified"/>
Expand Down Expand Up @@ -981,7 +1018,7 @@
</section>

<section name="versionInformation">
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/owl:versionInfo" or="versionInfo"
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dcat:version" or="version"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/adms:versionNotes" or="versionNotes"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
Expand All @@ -993,6 +1030,10 @@
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:issued" or="issued"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>

<!-- DCAT-AP v2 compatibility -->
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/owl:versionInfo" or="versionInfo"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
</section>

<section name="usageInformation">
Expand Down Expand Up @@ -1034,6 +1075,12 @@
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:source" or="source"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dcat:isVersionOf" or="isVersionOf"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dcat:hasVersion" or="hasVersion"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>

<!-- DCAT-AP v2 compatibility -->
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:isVersionOf" or="isVersionOf"
in="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset"/>
<field xpath="/rdf:RDF/dcat:Catalog/dcat:dataset/dcat:Dataset/dct:hasVersion" or="hasVersion"
Expand Down
22 changes: 19 additions & 3 deletions src/main/plugin/dcat-ap/loc/eng/labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<description>The file format, physical medium, or dimensions of the resource.</description>
<btnLabel>Format</btnLabel>
</element>
<element name="dct:hasVersion">
<element name="dcat:hasVersion">
<label>Has version</label>
<description>A related resource that is a version, edition, or adaptation of the described resource.</description>
<btnLabel>Has version</btnLabel>
Expand All @@ -230,7 +230,7 @@
<description>A related resource, such as a publication, that references, cites, or otherwise points to the cataloged resource.</description>
<btnLabel>Is referenced by</btnLabel>
</element>
<element name="dct:isVersionOf">
<element name="dcat:isVersionOf">
<label>Is a version of</label>
<description>A related resource of which the described resource is a version, edition, or adaptation.</description>
<btnLabel>Is a version of</btnLabel>
Expand Down Expand Up @@ -345,7 +345,7 @@
<description>Geometry</description>
<btnLabel>Geometry</btnLabel>
</element>
<element name="owl:versionInfo">
<element name="dcat:version">
<label>Version</label>
<description>Version</description>
<btnLabel>Version</btnLabel>
Expand Down Expand Up @@ -972,4 +972,20 @@
Examples of such services include “location search”, which is based on a datasets with address identifiers, or “trip plan computation”, which is based on datasets about a road network.</description>
</element>

<!-- DCAT-AP v2 compatibility -->
<element name="dct:hasVersion">
<label>Has version</label>
<description>A related resource that is a version, edition, or adaptation of the described resource.</description>
<btnLabel>Has version</btnLabel>
</element>
<element name="dct:isVersionOf">
<label>Is a version of</label>
<description>A related resource of which the described resource is a version, edition, or adaptation.</description>
<btnLabel>Is a version of</btnLabel>
</element>
<element name="owl:versionInfo">
<label>Version</label>
<description>Version</description>
<btnLabel>Version</btnLabel>
</element>
</labels>
5 changes: 3 additions & 2 deletions src/main/plugin/dcat-ap/process/dataset-add.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
dcat:contactPoint|
dcat:keyword|
dct:language|
owl:versionInfo|
dcat:version|
adms:identifier|
mdcat:landingspaginaVoorAuthenticatie|
mdcat:landingspaginaVoorStatusinformatie|
Expand All @@ -68,7 +68,8 @@
dct:modified|
dct:relation|
dct:rights|
dct:type"/>
dct:type|
owl:versionInfo"/> <!-- DCAT-AP v2 compatibility -->
</xsl:copy>
</xsl:template>

Expand Down
13 changes: 8 additions & 5 deletions src/main/plugin/dcat-ap/process/onlinesrc-add.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ Stylesheet used to update metadata adding a reference to a parent record.
dct:conformsTo|
foaf:page|
dct:accrualPeriodicity|
dct:hasVersion|
dct:isVersionOf|
dcat:hasVersion|
dcat:isVersionOf|
dcat:landingPage|
dct:language|
adms:identifier|
dct:provenance"/>
dct:provenance|
dct:hasVersion|
dct:isVersionOf"/> <!-- DCAT-AP v2 compatibility -->

<xsl:copy-of select="dct:relation[@rdf:resource != $url]"/>
<dct:relation rdf:resource="{$url}"/>
Expand All @@ -74,15 +76,16 @@ Stylesheet used to update metadata adding a reference to a parent record.
dct:spatial|
dct:temporal|
dct:type|
owl:versionInfo|
dcat:version|
adms:versionNotes|
dcat:extension|
dcat:distribution|
adms:sample|
dcat:qualifiedRelation|
dct:creator|
dct:isReferencedBy|
dct:rights"/>
dct:rights|
owl:versionInfo"/> <!-- DCAT-AP v2 compatibility -->
</xsl:copy>
</xsl:template>

Expand Down
9 changes: 6 additions & 3 deletions src/main/plugin/dcat-ap/process/source-add.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,22 @@ Stylesheet used to update metadata adding a reference to a source record.
dcat:landingPage|
dct:language|
adms:identifier|
dct:provenance"/>
dct:provenance|
dct:hasVersion|
dct:isVersionOf"/> <!-- DCAT-AP v2 compatibility -->
<xsl:variable name="rdfResource" select="replace(@rdf:about,'([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}',$sourceUuid)"/>
<xsl:copy-of select="dct:relation[@rdf:resource!= $rdfResource]"/>
<dct:relation rdf:resource="{$rdfResource}"/>
<xsl:apply-templates select="dct:source|
dct:spatial|
dct:temporal|
dct:type|
owl:versionInfo|
dcat:version|
adms:versionNotes|
dcat:extension|
dcat:distribution|
adms:sample"/>
adms:sample|
owl:versionInfo"/> <!-- DCAT-AP v2 compatibility -->

<xsl:apply-templates select="dcat:landingPage|
dcat:qualifiedRelation|
Expand Down
Loading