2323@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424
2525
26+ # === MUST shapes ===#
27+
28+ five-safes-crate:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction
29+ a sh:NodeShape ;
30+ sh:name " ValidationCheck" ;
31+ sh:description " " ;
32+
33+ sh:target [
34+ a sh:SPARQLTarget ;
35+ sh:select """
36+ PREFIX schema: <http://schema.org/>
37+ PREFIX shp: <https://w3id.org/shp#>
38+
39+ SELECT ?this
40+ WHERE {
41+ ?this schema:additionalType shp:ValidationCheck .
42+ }
43+ """ ;
44+ ] ;
45+
46+ sh:property [
47+ sh:path rdf:type ;
48+ sh:minCount 1 ;
49+ sh:hasValue schema:AssessAction;
50+ sh:severity sh:Violation ;
51+ sh:message " ValidationCheck MUST be a `AssessAction`." ;
52+ ] ;
53+
54+ sh:property [
55+ sh:a sh:PropertyShape ;
56+ sh:name " name" ;
57+ sh:description " ValidationCheck MUST have a human readable name string." ;
58+ sh:path schema:name ;
59+ sh:datatype xsd:string ;
60+ sh:severity sh:Violation ;
61+ sh:message " ValidationCheck MUST have a human readable name string." ;
62+ ] .
63+
64+
65+ five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue
66+ a sh:NodeShape ;
67+ sh:name " ValidationCheck" ;
68+ sh:target [
69+ a sh:SPARQLTarget ;
70+ sh:select """
71+ PREFIX schema: <http://schema.org/>
72+ PREFIX shp: <https://w3id.org/shp#>
73+
74+ SELECT ?this
75+ WHERE {
76+ ?this schema:additionalType shp:ValidationCheck ;
77+ schema:actionStatus ?status .
78+ }
79+ """ ;
80+ ] ;
81+
82+ sh:property [
83+ a sh:PropertyShape ;
84+ sh:name " actionStatus" ;
85+ sh:description " The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ;
86+ sh:path schema:actionStatus ;
87+ sh:in (
88+ " http://schema.org/PotentialActionStatus"
89+ " http://schema.org/ActiveActionStatus"
90+ " http://schema.org/CompletedActionStatus"
91+ " http://schema.org/FailedActionStatus"
92+ ) ;
93+ sh:severity sh:Violation ;
94+ sh:message " The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ;
95+ ] .
96+
97+
98+ five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue
99+ a sh:NodeShape ;
100+ sh:name " ValidationCheck" ;
101+ sh:target [
102+ a sh:SPARQLTarget ;
103+ sh:select """
104+ PREFIX schema: <http://schema.org/>
105+ PREFIX shp: <https://w3id.org/shp#>
106+
107+ SELECT ?this
108+ WHERE {
109+ ?this schema:additionalType shp:ValidationCheck .
110+ }
111+ """ ;
112+ ] ;
113+
114+ sh:property [
115+ a sh:PropertyShape ;
116+ sh:minCount 1 ;
117+ sh:name " actionStatus" ;
118+ sh:description " actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ;
119+ sh:path schema:actionStatus ;
120+ sh:in (
121+ " http://schema.org/PotentialActionStatus"
122+ " http://schema.org/ActiveActionStatus"
123+ " http://schema.org/CompletedActionStatus"
124+ " http://schema.org/FailedActionStatus"
125+ ) ;
126+ sh:severity sh:Violation ;
127+ sh:message " actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ;
128+ ] .
129+
130+
131+ # === SHOULD shapes ===#
132+
26133five-safes-crate:RootDataEntityShouldMentionValidationCheckObject
27134 a sh:NodeShape ;
28135 sh:name " RootDataEntity" ;
29136 sh:targetClass ro-crate:RootDataEntity ;
30137 sh:description " " ;
138+ sh:severity sh:Warning ;
31139
32140 sh:sparql [
33141 a sh:SPARQLConstraint ;
@@ -44,7 +152,6 @@ five-safes-crate:RootDataEntityShouldMentionValidationCheckObject
44152 }
45153 }
46154 """ ;
47- sh:severity sh:Warning ;
48155 sh:message " RootDataEntity SHOULD mention a ValidationCheck object." ;
49156 ] .
50157
@@ -163,3 +270,39 @@ five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun
163270 sh:description " ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
164271 sh:message " ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
165272 ] .
273+
274+
275+ # === MAY shapes ===#
276+
277+ five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
278+ a sh:NodeShape ;
279+ sh:name " ValidationCheck" ;
280+ sh:description " " ;
281+ sh:target [
282+ a sh:SPARQLTarget ;
283+ sh:select """
284+ PREFIX schema: <http://schema.org/>
285+ PREFIX shp: <https://w3id.org/shp#>
286+ SELECT ?this
287+ WHERE {
288+ ?this schema:additionalType shp:ValidationCheck ;
289+ schema:actionStatus ?status .
290+ FILTER(?status IN (
291+ "http://schema.org/CompletedActionStatus",
292+ "http://schema.org/FailedActionStatus",
293+ "http://schema.org/ActiveActionStatus"
294+ ))
295+ }
296+ """ ;
297+ ] ;
298+
299+ sh:property [
300+ a sh:PropertyShape ;
301+ sh:name " StartTime" ;
302+ sh:path schema:startTime ;
303+ sh:minCount 1 ;
304+ sh:maxCount 1 ;
305+ sh:severity sh:Info ;
306+ sh:description " ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
307+ sh:message " ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
308+ ] .
0 commit comments