From c6236af71e2452d163d3ec0ea3965d5fc1c383cc Mon Sep 17 00:00:00 2001 From: kovalch Date: Thu, 25 Jan 2024 13:07:22 +0100 Subject: [PATCH 1/8] feat: Add shacl checker for mandatory properties of a dataset --- ogdch.shacl.ttl | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index c142117..13d7fb7 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -76,30 +76,59 @@ See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-contactpoint-dcat """@en ; ] ; - sh:property [ + sh:property [ sh:path dct:publisher ; - sh:class foaf:Organization ; - sh:severity sh:Warning ; - sh:message """The publisher needs to be provided as foaf:Organization. + sh:minCount 1 ; + sh:severity sh:Violation ; + sh:message """This dataset does not provide a publisher. Please add a publisher for the dataset. See https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher """@en ; ] ; sh:property [ sh:path dct:publisher ; - sh:minCount 1 ; + sh:class foaf:Organization ; sh:severity sh:Warning ; - sh:message """Please provide a publisher for the dataset. + sh:message """The publisher needs to be provided as foaf:Organization. See https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher """@en ; ] ; sh:property [ sh:path dct:publisher ; - sh:maxCount 1 ; + sh:node [ + sh:property [ + sh:path rdf:about ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path foaf:name ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; sh:severity sh:Warning ; - sh:message """Please provide only one publisher for the dataset. - See https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher + sh:message """Ensure that there is only one valid publisher specified for the dataset. + Refer to the documentation at https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher for Details on this change."""@en ; ] ; + sh:identifier [ + sh:path dct:identifier ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:severity sh:Violation ; + sh:message """This dataset does not provide an identifier. Please add an identifier for the dataset. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-identifier-dcat + """@en ; + ] ; + sh:distribution [ + sh:path dcat:distribution ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:severity sh:Violation ; + sh:message """This dataset does not have any distribution. Please add at least one distribution for the dataset. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-dcat + """@en ; + ] ; sh:property [ sh:path dcat:landingPage ; sh:nodeKind sh:IRI ; From 9b4ced634654a9837601d9f5bcc97e2cb01382ca Mon Sep 17 00:00:00 2001 From: kovalch Date: Thu, 25 Jan 2024 13:19:27 +0100 Subject: [PATCH 2/8] feat: Add shacl checker for relation of a dataset --- ogdch.shacl.ttl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 13d7fb7..4b6d566 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -76,7 +76,7 @@ See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-contactpoint-dcat """@en ; ] ; - sh:property [ + sh:property [ sh:path dct:publisher ; sh:minCount 1 ; sh:severity sh:Violation ; @@ -138,6 +138,27 @@ https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-landingpage-dcat """@en ; ] ; + sh:property [ + sh:path dct:relation ; + sh:node [ + sh:property [ + sh:path rdf:about ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path rdfs:label ; + sh:nodeKind sh:Literal ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + ] ; + sh:severity sh:Warning ; + sh:message """This dataset does not provide a valid relation. + Please add a valid relation for the dataset. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-relation-dcat + for details."""@en ; + ] ; sh:property [ sh:path dct:accrualPeriodicity ; sh:node :FrequencyRestriction ; From 74a66395585dab639d7cb38c083ab8393ed3327e Mon Sep 17 00:00:00 2001 From: kovalch Date: Thu, 25 Jan 2024 13:40:24 +0100 Subject: [PATCH 3/8] feat: Add shacl checker for mandatory properties of a distribution --- ogdch.shacl.ttl | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 4b6d566..9fa4ad2 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -123,9 +123,8 @@ sh:distribution [ sh:path dcat:distribution ; sh:minCount 1 ; - sh:maxCount 1 ; sh:severity sh:Violation ; - sh:message """This dataset does not have any distribution. Please add at least one distribution for the dataset. + sh:message """This dataset does not provide any distributions. Please add at least one distribution for the dataset. See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-dcat """@en ; ] ; @@ -173,7 +172,7 @@ :DistributionShape rdf:type sh:NodeShape ; - sh:targetClass dcat:Distribution; + sh:targetClass dcat:Distribution ; sh:property [ sh:path dcat:accessURL ; sh:minCount 1 ; @@ -181,12 +180,37 @@ sh:message """Please provide an access url for the distribution. See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat """@en ; - ] ; + ] ; sh:property [ sh:path dcat:accessURL ; - sh:nodeKind sh:IRI ; + sh:nodeKind sh:IRI ; # to enforce that accessURL is an IRI sh:severity sh:Violation ; sh:message """The accessURL must be provided as IRI not as a string. For Details see https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat """@en ; - ] . + ] ; + sh:property [ + sh:path dct:issued ; + sh:minCount 1 ; + sh:severity sh:Violation ; + sh:message """Please provide the date of the publication of this distribution. See + https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-issued + """@en ; + ] ; + sh:property [ + sh:path dct:issued ; + sh:datatype xsd:dateTime ; # to enforce that issued is a dateTime + sh:severity sh:Violation ; + sh:message """The publication date must be provided as a date and time in ISO-8601 format. For Details see + https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat + """@en ; + ] ; + sh:property [ + sh:path dct:license ; + sh:minCount 1 ; + sh:severity sh:Violation ; + sh:message """Please provide a valid license for the distribution. See + https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat + """@en ; + sh:nodeKind sh:IRI ; # to enforce that license is an IRI + ] . From 55839740082ac9040f327189f8f257f794ed3f83 Mon Sep 17 00:00:00 2001 From: kovalch Date: Thu, 25 Jan 2024 13:53:30 +0100 Subject: [PATCH 4/8] feat: Add shacl checker for modified property of dataset --- ogdch.shacl.ttl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 9fa4ad2..6626fa0 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -111,7 +111,7 @@ Refer to the documentation at https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher for Details on this change."""@en ; ] ; - sh:identifier [ + sh:property [ sh:path dct:identifier ; sh:minCount 1 ; sh:maxCount 1 ; @@ -120,14 +120,6 @@ See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-identifier-dcat """@en ; ] ; - sh:distribution [ - sh:path dcat:distribution ; - sh:minCount 1 ; - sh:severity sh:Violation ; - sh:message """This dataset does not provide any distributions. Please add at least one distribution for the dataset. - See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-dcat - """@en ; - ] ; sh:property [ sh:path dcat:landingPage ; sh:nodeKind sh:IRI ; @@ -158,6 +150,14 @@ See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-relation-dcat for details."""@en ; ] ; + sh:property [ + sh:path dct:modified ; + sh:severity sh:Violation ; + sh:message """If provided, the modification date should be in ISO-8601 format. See + https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-modified-dcat + """@en ; + sh:datatype xsd:dateTime ; + ] ; sh:property [ sh:path dct:accrualPeriodicity ; sh:node :FrequencyRestriction ; From bb782299b9b6918165c090e6fd48df4786048b5b Mon Sep 17 00:00:00 2001 From: kovalch Date: Mon, 29 Jan 2024 12:42:41 +0100 Subject: [PATCH 5/8] feat: Add qualifiedRelation to the validation --- ogdch.shacl.ttl | 113 ++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 6626fa0..3fc8662 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -25,11 +25,22 @@ sh:path skos:inScheme ; ] . +:ThemeRestriction + a sh:NodeShape ; + rdfs:comment "Theme Restriction" ; + rdfs:label "Theme Restriction" ; + sh:property [ + sh:hasValue ; + sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path skos:inScheme ; + ] . + :DatasetShape rdf:type sh:NodeShape ; sh:targetClass dcat:Dataset ; sh:property [ - sh:path dct:description ; + sh:path dct:description ; # mandatory property sh:minCount 1 ; sh:nodeKind sh:Literal ; sh:severity sh:Violation ; @@ -38,7 +49,7 @@ """@en ; ] ; sh:property [ - sh:path dct:title ; + sh:path dct:title ; # mandatory property sh:minCount 1 ; sh:nodeKind sh:Literal ; sh:severity sh:Violation ; @@ -47,7 +58,7 @@ """@en ; ] ; sh:property [ - sh:path dcat:distribution ; + sh:path dcat:distribution ; # mandatory property sh:minCount 1 ; sh:severity sh:Violation ; sh:message """This dataset does not have any distributions. Please add a distribution for the dataset. @@ -55,7 +66,7 @@ """@en ; ] ; sh:property [ - sh:path dcat:contactPoint ; + sh:path dcat:contactPoint ; # mandatory property sh:minCount 1 ; sh:severity sh:Violation ; sh:message """This dataset does not provide a contact point. Please add a contact point for the dataset. @@ -77,7 +88,7 @@ """@en ; ] ; sh:property [ - sh:path dct:publisher ; + sh:path dct:publisher ; # mandatory property sh:minCount 1 ; sh:severity sh:Violation ; sh:message """This dataset does not provide a publisher. Please add a publisher for the dataset. @@ -87,13 +98,6 @@ sh:property [ sh:path dct:publisher ; sh:class foaf:Organization ; - sh:severity sh:Warning ; - sh:message """The publisher needs to be provided as foaf:Organization. - See https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher - """@en ; - ] ; - sh:property [ - sh:path dct:publisher ; sh:node [ sh:property [ sh:path rdf:about ; @@ -106,13 +110,14 @@ sh:minCount 1 ; sh:maxCount 1 ; ] ; + ] ; sh:severity sh:Warning ; - sh:message """Ensure that there is only one valid publisher specified for the dataset. - Refer to the documentation at https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher + sh:message """Ensure that there is only one valid publisher specified for the dataset, provided as foaf:Organization. + See https://handbook.opendata.swiss/content/glossar/bibliothek/dcat-ap-ch.html#dcat-dataset-publisher for Details on this change."""@en ; ] ; sh:property [ - sh:path dct:identifier ; + sh:path dct:identifier ; # mandatory property sh:minCount 1 ; sh:maxCount 1 ; sh:severity sh:Violation ; @@ -121,7 +126,7 @@ """@en ; ] ; sh:property [ - sh:path dcat:landingPage ; + sh:path dcat:landingPage ; # conditional property sh:nodeKind sh:IRI ; sh:severity sh:Warning ; sh:message """The landing page must to be provided as IRI and not as a string. @@ -130,33 +135,45 @@ """@en ; ] ; sh:property [ - sh:path dct:relation ; - sh:node [ - sh:property [ - sh:path rdf:about ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path rdfs:label ; - sh:nodeKind sh:Literal ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - ] ; - sh:severity sh:Warning ; - sh:message """This dataset does not provide a valid relation. - Please add a valid relation for the dataset. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-relation-dcat - for details."""@en ; + sh:path dct:modified ; # conditional property + sh:datatype xsd:dateTime ; + sh:severity sh:Warning ; + sh:message """The modification date should be in ISO-8601 format. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-modified-dcat + """@en ; ] ; sh:property [ - sh:path dct:modified ; - sh:severity sh:Violation ; - sh:message """If provided, the modification date should be in ISO-8601 format. See - https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-modified-dcat - """@en ; + sh:path dct:issued ; # conditional property sh:datatype xsd:dateTime ; + sh:severity sh:Warning ; + sh:message """The issued date should be in ISO-8601 format. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-issued-dcat + """@en ; + ] ; + sh:property [ + sh:path dcat:theme ; # conditional property + sh:node :ThemeRestriction ; + sh:nodeKind sh:IRI ; + sh:severity sh:Warning ; + sh:message """The theme is expected from the controlled vocabulary http://publications.europa.eu/resource/authority/data-theme. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-theme-dcat + """@en ; + ] ; + sh:property [ + sh:path dcat:qualifiedRelation ; # optional property + sh:nodeKind sh:IRI ; + sh:severity sh:Warning ; + sh:message """The qualified relation replaces the seeAlso property. + Please use dcat:qualifiedRelation instead rdfs:seeAlso. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-qualifiedrelation-dcat + """@en ; + sh:property [ + sh:path dcat:Relationship ; + sh:nodeKind sh:BlankNode ; + sh:property [ + sh:path dct:relation ; + sh:nodeKind sh:IRI ; + ] ; ] ; sh:property [ sh:path dct:accrualPeriodicity ; @@ -189,22 +206,6 @@ https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat """@en ; ] ; - sh:property [ - sh:path dct:issued ; - sh:minCount 1 ; - sh:severity sh:Violation ; - sh:message """Please provide the date of the publication of this distribution. See - https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-issued - """@en ; - ] ; - sh:property [ - sh:path dct:issued ; - sh:datatype xsd:dateTime ; # to enforce that issued is a dateTime - sh:severity sh:Violation ; - sh:message """The publication date must be provided as a date and time in ISO-8601 format. For Details see - https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat - """@en ; - ] ; sh:property [ sh:path dct:license ; sh:minCount 1 ; From 8c7344aa1f3c703ec78ba4591ea17439b05bd6fc Mon Sep 17 00:00:00 2001 From: kovalch Date: Mon, 29 Jan 2024 13:35:23 +0100 Subject: [PATCH 6/8] feat: Add checker for format and license --- ogdch.shacl.ttl | 50 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 3fc8662..3df6967 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -207,11 +207,47 @@ """@en ; ] ; sh:property [ - sh:path dct:license ; - sh:minCount 1 ; + sh:path dct:format ; + sh:minCount 1 ; + sh:or + ([ + sh:hasValue ; + ] + [ + sh:hasValue ; + ]) ; sh:severity sh:Violation ; - sh:message """Please provide a valid license for the distribution. See - https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat - """@en ; - sh:nodeKind sh:IRI ; # to enforce that license is an IRI - ] . + sh:message """Please use a valid distribution format. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-format-dcat + """@en ; + ] + ) ; + ] ; + sh:property [ + sh:path dct:license ; + sh:minCount 1 ; + sh:in ( + + + + + ) ; + sh:severity sh:Warning ; + sh:message """Please provide a valid license for the distribution. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat + """@en ; + sh:nodeKind sh:IRI ; # to enforce that license is an IRI + ] ; + sh:property [ + sh:path dct:rights ; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message """Please use license instead of rights for the distribution. + See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-rights-dcat + """@en ; + sh:condition [ + sh:predicate sh:severity ; + sh:value sh:Warning ; + sh:sourceShape :DistributionShape ; + ] ; + ] . \ No newline at end of file From cbf2a60e6259e6f8016d1eac84f4a9028dfcee80 Mon Sep 17 00:00:00 2001 From: kovalch Date: Tue, 6 Feb 2024 10:32:11 +0100 Subject: [PATCH 7/8] fix: Remove check on rights and use correct links --- ogdch.shacl.ttl | 104 ++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 60 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index 3df6967..af9ae15 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -130,8 +130,7 @@ sh:nodeKind sh:IRI ; sh:severity sh:Warning ; sh:message """The landing page must to be provided as IRI and not as a string. - For Details see - https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-landingpage-dcat + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-landingpage-dcat """@en ; ] ; sh:property [ @@ -139,15 +138,15 @@ sh:datatype xsd:dateTime ; sh:severity sh:Warning ; sh:message """The modification date should be in ISO-8601 format. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-modified-dcat - """@en ; + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-modified-dcat + """@en ; ] ; sh:property [ sh:path dct:issued ; # conditional property sh:datatype xsd:dateTime ; sh:severity sh:Warning ; sh:message """The issued date should be in ISO-8601 format. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-issued-dcat + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-issued-dcat """@en ; ] ; sh:property [ @@ -156,27 +155,27 @@ sh:nodeKind sh:IRI ; sh:severity sh:Warning ; sh:message """The theme is expected from the controlled vocabulary http://publications.europa.eu/resource/authority/data-theme. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-theme-dcat + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-theme-dcat """@en ; ] ; - sh:property [ + sh:property [ sh:path dcat:qualifiedRelation ; # optional property sh:nodeKind sh:IRI ; sh:severity sh:Warning ; sh:message """The qualified relation replaces the seeAlso property. Please use dcat:qualifiedRelation instead rdfs:seeAlso. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-qualifiedrelation-dcat + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-qualifiedrelation-dcat """@en ; sh:property [ sh:path dcat:Relationship ; sh:nodeKind sh:BlankNode ; sh:property [ - sh:path dct:relation ; - sh:nodeKind sh:IRI ; + sh:path dct:relation ; + sh:nodeKind sh:IRI ; ] ; ] ; sh:property [ - sh:path dct:accrualPeriodicity ; + sh:path dct:accrualPeriodicity ; # optional property sh:node :FrequencyRestriction ; sh:nodeKind sh:IRI ; sh:severity sh:Warning ; @@ -191,63 +190,48 @@ rdf:type sh:NodeShape ; sh:targetClass dcat:Distribution ; sh:property [ - sh:path dcat:accessURL ; + sh:path dcat:accessURL ; # mandatory property sh:minCount 1 ; sh:severity sh:Violation ; - sh:message """Please provide an access url for the distribution. See - https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat - """@en ; + sh:message """Please provide an access url for the distribution. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat + """@en ; ] ; sh:property [ sh:path dcat:accessURL ; sh:nodeKind sh:IRI ; # to enforce that accessURL is an IRI sh:severity sh:Violation ; - sh:message """The accessURL must be provided as IRI not as a string. For Details see - https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat - """@en ; + sh:message """The accessURL must be provided as IRI not as a string. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-accessurl-dcat + """@en ; ] ; sh:property [ - sh:path dct:format ; - sh:minCount 1 ; - sh:or - ([ - sh:hasValue ; - ] - [ - sh:hasValue ; - ]) ; + sh:path dct:format ; # conditional property + sh:minCount 1 ; + sh:or + ([ + sh:hasValue ; + ] + [ + sh:hasValue ; + ]) ; + sh:severity sh:Warning ; + sh:message """Please use a valid distribution format. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-format-dcat + """@en ; + ] ; + sh:property [ + sh:path dct:license ; # mandatory property + sh:minCount 1 ; + sh:in ( + + + + + ) ; sh:severity sh:Violation ; - sh:message """Please use a valid distribution format. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-format-dcat - """@en ; - ] - ) ; - ] ; - sh:property [ - sh:path dct:license ; - sh:minCount 1 ; - sh:in ( - - - - - ) ; - sh:severity sh:Warning ; - sh:message """Please provide a valid license for the distribution. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat - """@en ; - sh:nodeKind sh:IRI ; # to enforce that license is an IRI - ] ; - sh:property [ - sh:path dct:rights ; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message """Please use license instead of rights for the distribution. - See https://ogdch-new-handbook.clients.liip.ch/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-rights-dcat - """@en ; - sh:condition [ - sh:predicate sh:severity ; - sh:value sh:Warning ; - sh:sourceShape :DistributionShape ; - ] ; + sh:message """Please provide a valid license for the distribution. + See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat + """@en ; + sh:nodeKind sh:IRI ; # to enforce that license is an IRI ] . \ No newline at end of file From e2fce4051a08e4ecd0a3d95c9c615eeac4f7defc Mon Sep 17 00:00:00 2001 From: kovalch Date: Tue, 6 Feb 2024 12:42:10 +0100 Subject: [PATCH 8/8] fix: Correct the message for the theme --- ogdch.shacl.ttl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ogdch.shacl.ttl b/ogdch.shacl.ttl index af9ae15..01ec518 100644 --- a/ogdch.shacl.ttl +++ b/ogdch.shacl.ttl @@ -154,7 +154,8 @@ sh:node :ThemeRestriction ; sh:nodeKind sh:IRI ; sh:severity sh:Warning ; - sh:message """The theme is expected from the controlled vocabulary http://publications.europa.eu/resource/authority/data-theme. + sh:message """The controlled vocabulary for dcat:theme has changed. + Please use the new one http://publications.europa.eu/resource/authority/data-theme. See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-theme-dcat """@en ; ] ; @@ -234,4 +235,4 @@ See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dct-license-dcat """@en ; sh:nodeKind sh:IRI ; # to enforce that license is an IRI - ] . \ No newline at end of file + ] .