Skip to content
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ For example:
* enabling Health DCAT-AP validation using the following XPath:

```
./dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-7/' and dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/PUBLIC']
//dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-8/' and (dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/PUBLIC' or count(dcat:dataset/*/dct:accessRights) = 0)]

./dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-7/' and dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/NON_PUBLIC']
./dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-8/' and dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/NON_PUBLIC']

./dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-7/' and dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/RESTRICTED']
./dcat:Catalog[dcat:record/*/dct:conformsTo/*/@rdf:about = 'https://healthdataeu.pages.code.europa.eu/healthdcat-ap/releases/release-8/' and dcat:dataset/*/dct:accessRights/*/@rdf:about = 'http://publications.europa.eu/resource/authority/access-right/RESTRICTED']
```


Expand Down
29 changes: 26 additions & 3 deletions src/main/plugin/dcat-ap/formatter/xsl-view/view.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
xmlns:healthdcatap="http://healthdataportal.eu/ns/health#"
xmlns:csvw="http://www.w3.org/ns/csvw#"
xmlns:dpv="https://w3id.org/dpv#"
xmlns:cv="http://data.europa.eu/m8g/"
xmlns:gn-fn-render="http://geonetwork-opensource.org/xsl/functions/render"
xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata"
xmlns:gn-fn-dcat-ap="http://geonetwork-opensource.org/xsl/functions/profiles/dcat-ap"
Expand All @@ -66,6 +67,7 @@
<xsl:include href="../../convert/functions.xsl" />
<xsl:include href="../../layout/evaluate.xsl" />
<xsl:include href="../../layout/utility-tpl.xsl" />
<xsl:include href="../../layout/layout-custom-fields-quantum.xsl" />

<!-- The core formatter XSL layout based on the editor configuration -->
<xsl:include href="sharedFormatterDir/xslt/render-layout.xsl" />
Expand Down Expand Up @@ -419,7 +421,7 @@
<xsl:template mode="render-view" match="section[not(@xpath) and not(@forEach)]">
<xsl:param name="base" select="$metadata"/>
<xsl:variable name="sectionContent">
<xsl:apply-templates mode="render-view" select="section|field">
<xsl:apply-templates mode="render-view" select="section|field|xsl">
<xsl:with-param name="base" select="$base"/>
</xsl:apply-templates>
</xsl:variable>
Expand All @@ -437,7 +439,7 @@
</xsl:if>

<xsl:choose>
<xsl:when test="$sectionContent/div/table">
<xsl:when test="$sectionContent/div/table or $sectionContent/div/div/table">
<xsl:copy-of select="$sectionContent"/>
</xsl:when>
<xsl:otherwise>
Expand Down Expand Up @@ -512,7 +514,7 @@
vcard:hasTelephone|vcard:fn|vcard:organization-name|skos:prefLabel|dcat:version|
adms:versionNotes|dcat:byteSize|dcat:hadRole|dcat:spatialResolutionInMeters|dcat:temporalResolution|mdcat:stars|owl:versionInfo|
locn:fullAddress|locn:poBox|locn:thoroughfare|locn:locatorDesignator|locn:locatorName|locn:postName|locn:postCode|locn:adminUnitL1|locn:adminUnitL2|locn:addressArea|
healthdcatap:numberOfRecords|healthdcatap:numberOfUniqueIndividuals|healthdcatap:maxTypicalAge|healthdcatap:minTypicalAge">
healthdcatap:numberOfRecords|healthdcatap:numberOfUniqueIndividuals|healthdcatap:maxTypicalAge|healthdcatap:minTypicalAge|healthdcatap:hasCodeValues|cv:email">
<xsl:param name="xpath"/>
<xsl:variable name="stringValue" select="string()"/>
<xsl:if test="normalize-space($stringValue) != ''">
Expand Down Expand Up @@ -965,6 +967,27 @@
<xsl:value-of select="$txt"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="render-form-field-control-remove">
<xsl:param name="editInfo"/>
</xsl:template>

<xsl:template mode="render-view" match="xsl[@xpath = '/rdf:RDF/dcat:Catalog/*/*/dqv:hasQualityMeasurement[1]']">
<xsl:param name="base" as="node()"/>
<xsl:variable name="originalNode"
select="$base/dcat:Catalog/*/*/dqv:hasQualityMeasurement[1]"/>

<xsl:variable name="mode" select="@mode"/>

<xsl:for-each select="$originalNode">
<saxon:call-template name="{$mode}">
<xsl:with-param name="isViewMode" select="true()"/>
</saxon:call-template>
</xsl:for-each>
</xsl:template>

<xsl:template mode="render-view" match="xsl">
<xsl:param name="base" as="node()"/>
</xsl:template>
</xsl:stylesheet>
2 changes: 1 addition & 1 deletion src/main/plugin/dcat-ap/layout/config-editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,7 @@
<dqv:computedOn rdf:resource=""/>
<dqv:isMeasurementOf>
<dqv:Metric rdf:about="http://quantumproject.eu/vocab-quantum/#Accessibility_metric1">
<skos:definition xml:lang="en">Availability of a data access &amp; usage policy at the time of release of the dataset</skos:definition>
<skos:definition xml:lang="">Availability of a data access &amp; usage policy at the time of release of the dataset</skos:definition>
<dqv:expectedDataType rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
<dqv:inDimension rdf:resource="http://quantumproject.eu/vocab-quantum/#Accessibility"/>
</dqv:Metric>
Expand Down
269 changes: 269 additions & 0 deletions src/main/plugin/dcat-ap/layout/layout-custom-fields-quantum.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
~ and United Nations Environment Programme (UNEP)
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or (at
~ your option) any later version.
~
~ This program is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
~
~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
~ Rome - Italy. email: geonetwork@osgeo.org
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:spdx="http://spdx.org/rdf/terms#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:adms="http://www.w3.org/ns/adms#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:dcat="http://www.w3.org/ns/dcat#"
xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:schema="http://schema.org/"
xmlns:dqv="http://www.w3.org/ns/dqv#"
xmlns:locn="http://www.w3.org/ns/locn#"
xmlns:gml="http://www.opengis.net/gml"
xmlns:gn="http://www.fao.org/geonetwork"
xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata"
xmlns:gn-fn-dcat-ap="http://geonetwork-opensource.org/xsl/functions/profiles/dcat-ap"
xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon"
version="2.0"
exclude-result-prefixes="#all">

<xsl:template name="health-dcat-ap">
<xsl:param name="isViewMode" select="false()"/>

<xsl:variable name="helper" as="node()*">
<list key="Availability of a data access &amp; usage policy at the time of release of the dataset">
<option value="0">No policy available</option>
<option value="1">Basic policy available</option>
<option value="2">Comprehensive policy available</option>
</list>
<list key="Average time from data access application to data release for a specific dataset">
<option value="0">
More than 6 months
</option>
<option value="1">
3 to 6 months
</option>
<option value="2">
1 to 3 months
</option>
<option value="3">
Less than 1 month
</option>
</list>
<list key="Coverage Rate (percentage of the eligible population represented in the dataset)">
<option value="0">
&lt;80%: Limited coverage
</option>
<option value="1">
80-90%: Good coverage
</option>
<option value="2">
90-95%: Very good coverage
</option>
<option value="3">
95-100%: Near-universal or universal coverage
</option>
</list>
<list key="How closely does the observed population represent the expected population?">
<option value="0">
No information on sampling methodology
</option>
<option value="1">
Sampling information does not demonstrate the sample representativity
</option>
<option value="2">
Sampling information demonstrates the sample representativity
</option>
<option value="3">
Dataset contains all expected population
</option>
</list>
<list key="Is there documentation of compliance with ethical standards, conventions, protocols or regulations?">
<option value="0">
No.
</option>
<option value="1">
Documentation of applicable ethical standards, conventions, protocols or regulations, but no documentation of deviations or compliance.
</option>
<option value="2">
Documentation of applicable ethical standards, conventions, protocols or regulations, as well as documentation of deviations or compliance.
</option>
</list>
<list key="Is the source of the dataset documented?">
<option value="0">
No source is documented
</option>
<option value="1">
Source is documented
</option>
</list>
<list key="Are the processes and operations on the data documented?">
<option value="0">
No documentation on data processes and operations
</option>
<option value="1">
Some documentation on data processes and operations but not complying with PROV-O standards
</option>
<option value="2">
Full documentation on data processes and operations complying with PROV-O standards
</option>
</list>
<list key="Existence of comprehensive standardised metadata">
<option value="0">
Non-standardised metadata
</option>
<option value="1">
Partially complying with standardised metadata model (e.g. HealthDCAT-AP)
</option>
<option value="2">
Fully complying with standardised metadata model (e.g. HealthDCAT-AP)
</option>
</list>
<list key="Existence of an exhaustive data dictionary at variable level">
<option value="0">
No data dictionary
</option>
<option value="1">
Partial data dictionary: some variables described with basic information (i.e., names and brief definitions)
</option>
<option value="2">
Complete data dictionary: all variables described with detailed information (i.e., names, definitions, units, allowed values, etc.)
</option>
</list>
<list key="Is accuracy of the dataset documented?">
<option value="0">
Accuracy not documented
</option>
<option value="1">
Information on the efforts to ensure accuracy is provided (non statistical information provided)
</option>
<option value="2">
Statistical information on accuracy is provided at variable and/or individual level
</option>
</list>
<list key="Is coherence of the dataset documented?">
<option value="0">
Coherence not documented
</option>
<option value="1">
Coherence documented for some entities, attributes and relations in the dataset
</option>
<option value="2">
Coherence documented for all entities, attributes and relations in the dataset
</option>
</list>
<list key="Is completeness of the dataset documented?">
<option value="0">
Completeness not documented
</option>
<option value="1">
Some variables are analysed for completeness
</option>
<option value="2">
All variables are analysed for completeness
</option>
</list>
<list key="Is consistency of the dataset documented?">
<option value="0">
Consistency not documented
</option>
<option value="1">
Consistency of some variables is documented
</option>
<option value="2">
Consistency of all variables is documented
</option>
</list>
<list key="Is precision of the dataset documented?">
<option value="0">
Precision not documented
</option>
<option value="1">
Precision of some variables is documented
</option>
<option value="2">
Precision of all variables is documented
</option>
</list>
<list key="Availability of a conformance report for the data model">
<option value="0">
No report available
</option>
<option value="1">
Report available for validity of some variables
</option>
<option value="2">
Report available for validity of all variables
</option>
</list>
</xsl:variable>

<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<xsl:for-each select="../dqv:hasQualityMeasurement">
<xsl:variable name="measure"
select="normalize-space(dqv:QualityMeasurement/dqv:isMeasurementOf/dqv:Metric/skos:definition)"/>
<xsl:variable name="id" select="dqv:QualityMeasurement/dqv:value/gn:element/@ref"/>
<xsl:variable name="value" select="dqv:QualityMeasurement/dqv:value"/>
<tr>
<td>
<xsl:value-of select="$measure"/>
</td>
<td>
<xsl:choose>
<xsl:when test="$isViewMode">
<xsl:variable name="valueLabel" select="$helper[@key = $measure]/option[@value = $value]"/>
<xsl:value-of select="$valueLabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="dqv:QualityMeasurement/dqv:value" mode="mode-dcat-ap"/>
</xsl:otherwise>
</xsl:choose>
</td>
<xsl:if test="not($isViewMode)">
<td>
<select onChange="$('#gn-field-{$id}').val(this.value)">
<option></option>
<xsl:for-each select="$helper[@key = $measure]/option">
<option>
<xsl:copy-of select="@*"/>
<xsl:if test="@value = $value">
<xsl:attribute name="selected" select="'selected'"/>
</xsl:if>
<xsl:value-of select="."/>
</option>
</xsl:for-each>
</select>
</td>
<td>
<xsl:call-template name="render-form-field-control-remove">
<xsl:with-param name="editInfo" select="gn:element"/>
</xsl:call-template>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
Loading
Loading