|
17 | 17 | @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . |
18 | 18 | @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
19 | 19 | @prefix schema: <http://schema.org/> . |
| 20 | +@prefix purl: <http://purl.org/dc/terms/> . |
20 | 21 | @prefix sh: <http://www.w3.org/ns/shacl#> . |
21 | 22 | @prefix validator: <https://github.com/crs4/rocrate-validator/> . |
22 | 23 | @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
23 | | -@prefix shp: <https://w3id.org/shp#> . |
24 | 24 |
|
25 | 25 |
|
| 26 | +#=== MUST shapes ===# |
| 27 | + |
| 28 | +five-safes-crate:SignOffObjectActionAndName |
| 29 | + a sh:NodeShape ; |
| 30 | + sh:name "SignOff" ; |
| 31 | + sh:description "Sign Off phase" ; |
| 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 | + SELECT ?this |
| 39 | + WHERE { |
| 40 | + ?this schema:additionalType shp:SignOff . |
| 41 | + } |
| 42 | + """ ; |
| 43 | + ] ; |
| 44 | + |
| 45 | + sh:property [ |
| 46 | + sh:path schema:name ; |
| 47 | + sh:datatype xsd:string ; |
| 48 | + sh:minCount 1 ; |
| 49 | + sh:severity sh:Violation ; |
| 50 | + sh:message "Sign Off phase MUST have a human-readable name string." ; |
| 51 | + ] ; |
| 52 | + |
| 53 | + sh:property [ |
| 54 | + sh:path rdf:type ; |
| 55 | + sh:minCount 1 ; |
| 56 | + sh:hasValue schema:AssessAction; |
| 57 | + sh:severity sh:Violation ; |
| 58 | + sh:message "Sign Off phase MUST be a `AssessAction`." ; |
| 59 | + ] . |
| 60 | + |
| 61 | +five-safes-crate:SignOffObjectHasActionStatus |
| 62 | + a sh:NodeShape ; |
| 63 | + sh:name "SignOffStatus" ; |
| 64 | + sh:description "Sign Off Phase Action Status" ; |
| 65 | + |
| 66 | + sh:target [ |
| 67 | + a sh:SPARQLTarget ; |
| 68 | + sh:select """ |
| 69 | + PREFIX schema: <http://schema.org/> |
| 70 | + PREFIX shp: <https://w3id.org/shp#> |
| 71 | + SELECT ?this |
| 72 | + WHERE { |
| 73 | + ?this schema:additionalType shp:SignOff ; |
| 74 | + schema:actionStatus ?status . |
| 75 | + } |
| 76 | + """ ; |
| 77 | + ] ; |
| 78 | + |
| 79 | + sh:property [ |
| 80 | + a sh:PropertyShape ; |
| 81 | + sh:name "actionStatus" ; |
| 82 | + sh:description "The value of actionStatus MUST be one of the allowed values." ; |
| 83 | + sh:path schema:actionStatus ; |
| 84 | + sh:in ( |
| 85 | + "http://schema.org/PotentialActionStatus" |
| 86 | + "http://schema.org/ActiveActionStatus" |
| 87 | + "http://schema.org/CompletedActionStatus" |
| 88 | + "http://schema.org/FailedActionStatus" |
| 89 | + ) ; |
| 90 | + sh:severity sh:Violation ; |
| 91 | + sh:message "The value of actionStatus MUST be one of the allowed values: PotentialActionStatus; ActiveActionStatus; CompletedActionStatus; FailedActionStatus." ; |
| 92 | + ] . |
| 93 | + |
| 94 | + |
| 95 | +#=== SHOULD shapes ===# |
| 96 | + |
26 | 97 | # There SHOULD be a Sign-Off Phase |
27 | 98 | five-safes-crate:SignOffPhase |
28 | 99 | a sh:NodeShape ; |
@@ -185,3 +256,40 @@ five-safes-crate:SignOffPhaseEndTime |
185 | 256 | sh:description "Sign Off object SHOULD have endTime property if action completed or failed." ; |
186 | 257 | sh:message "Sign Off object SHOULD have endTime property if action completed or failed." ; |
187 | 258 | ] . |
| 259 | + |
| 260 | + |
| 261 | +#=== MAY shapes ===# |
| 262 | + |
| 263 | +five-safes-crate:SignOffPhaseStartTime |
| 264 | + a sh:NodeShape ; |
| 265 | + sh:name "SignOffPhaseStartTime" ; |
| 266 | + |
| 267 | + sh:target [ |
| 268 | + a sh:SPARQLTarget ; |
| 269 | + sh:select """ |
| 270 | + PREFIX schema: <http://schema.org/> |
| 271 | + PREFIX shp: <https://w3id.org/shp#> |
| 272 | + SELECT ?this |
| 273 | + WHERE { |
| 274 | + ?this schema:additionalType shp:SignOff ; |
| 275 | + schema:actionStatus ?status . |
| 276 | + FILTER(?status IN ( |
| 277 | + "http://schema.org/ActiveActionStatus", |
| 278 | + "http://schema.org/CompletedActionStatus", |
| 279 | + "http://schema.org/FailedActionStatus" |
| 280 | + )) |
| 281 | + } |
| 282 | + """ ; |
| 283 | + ] ; |
| 284 | + |
| 285 | + sh:property [ |
| 286 | + a sh:PropertyShape ; |
| 287 | + sh:name "StartTime" ; |
| 288 | + sh:path schema:startTime ; |
| 289 | + sh:minCount 1 ; |
| 290 | + sh:maxCount 1 ; |
| 291 | + sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ; |
| 292 | + sh:severity sh:Info ; |
| 293 | + sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed." ; |
| 294 | + sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed." ; |
| 295 | + ] . |
0 commit comments