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

Update the validation checker to accommodate new properties #53

Merged
merged 8 commits into from
Feb 8, 2024
158 changes: 127 additions & 31 deletions ogdch.shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,22 @@
sh:path skos:inScheme ;
] .

:ThemeRestriction
a sh:NodeShape ;
rdfs:comment "Theme Restriction" ;
rdfs:label "Theme Restriction" ;
sh:property [
sh:hasValue <http://publications.europa.eu/resource/authority/data-theme> ;
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 ;
Expand All @@ -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 ;
Expand All @@ -47,15 +58,15 @@
"""@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.
See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-dcat
"""@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.
Expand All @@ -77,40 +88,95 @@
"""@en ;
] ;
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: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.
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: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 a publisher for the dataset.
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
"""@en ;
for Details on this change."""@en ;
] ;
sh:property [
sh:path dct:publisher ;
sh:path dct:identifier ; # mandatory property
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
for Details on this change."""@en ;
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: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.
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 [
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://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://handbook.opendata.swiss/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 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 ;
] ;
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://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:property [
sh:path dct:accrualPeriodicity ;
sh:path dct:accrualPeriodicity ; # optional property
sh:node :FrequencyRestriction ;
sh:nodeKind sh:IRI ;
sh:severity sh:Warning ;
Expand All @@ -123,20 +189,50 @@

:DistributionShape
rdf:type sh:NodeShape ;
sh:targetClass dcat:Distribution;
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 ;
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 ; # conditional property
sh:minCount 1 ;
sh:or
([
sh:hasValue <http://publications.europa.eu/resource/authority/file-type> ;
]
[
sh:hasValue <https://www.iana.org/assignments/media-types> ;
]) ;
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 (
<https://opendata.swiss/terms-of-use#terms_open>
<https://opendata.swiss/terms-of-use#terms_by>
<https://opendata.swiss/terms-of-use#terms_ask>
<https://opendata.swiss/terms-of-use#terms_by_ask>
) ;
sh:severity sh:Violation ;
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
] .
Loading