Skip to content

Commit

Permalink
feat: Add qualifiedRelation to the validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Jan 29, 2024
1 parent 5583974 commit bb78229
Showing 1 changed file with 57 additions and 56 deletions.
113 changes: 57 additions & 56 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,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.
Expand All @@ -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 ;
Expand All @@ -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 ;
Expand All @@ -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.
Expand All @@ -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 ;
Expand Down Expand Up @@ -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 ;
Expand Down

0 comments on commit bb78229

Please sign in to comment.