|
23 | 23 | @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
24 | 24 |
|
25 | 25 |
|
| 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 `schema: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 | +#=== SHOULD shapes ===# |
| 131 | + |
26 | 132 | five-safes-crate:RootDataEntityShouldMentionValidationCheckObject |
27 | 133 | a sh:NodeShape ; |
28 | 134 | sh:name "RootDataEntity" ; |
@@ -163,3 +269,38 @@ five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun |
163 | 269 | sh:description "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; |
164 | 270 | sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; |
165 | 271 | ] . |
| 272 | + |
| 273 | +#=== MAYBE shapes ===# |
| 274 | + |
| 275 | +five-safes-crate:DownloadActionMayHaveStartTimeIfBegun |
| 276 | + a sh:NodeShape ; |
| 277 | + sh:name "ValidationCheck" ; |
| 278 | + sh:description "" ; |
| 279 | + sh:target [ |
| 280 | + a sh:SPARQLTarget ; |
| 281 | + sh:select """ |
| 282 | + PREFIX schema: <http://schema.org/> |
| 283 | + PREFIX shp: <https://w3id.org/shp#> |
| 284 | + SELECT ?this |
| 285 | + WHERE { |
| 286 | + ?this schema:additionalType shp:ValidationCheck ; |
| 287 | + schema:actionStatus ?status . |
| 288 | + FILTER(?status IN ( |
| 289 | + "http://schema.org/CompletedActionStatus", |
| 290 | + "http://schema.org/FailedActionStatus", |
| 291 | + "http://schema.org/ActiveActionStatus" |
| 292 | + )) |
| 293 | + } |
| 294 | + """ ; |
| 295 | + ] ; |
| 296 | + |
| 297 | + sh:property [ |
| 298 | + a sh:PropertyShape ; |
| 299 | + sh:name "StartTime" ; |
| 300 | + sh:path schema:startTime ; |
| 301 | + sh:minCount 1 ; |
| 302 | + sh:maxCount 1 ; |
| 303 | + sh:severity sh:Info ; |
| 304 | + sh:description "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; |
| 305 | + sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; |
| 306 | + ] . |
0 commit comments