|
23 | 23 | @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
24 | 24 |
|
25 | 25 |
|
26 | | -five-safes-crate:RootDataEntityShouldMentionCheckValueObject |
| 26 | +#=== MUST shapes ===# |
| 27 | + |
| 28 | +five-safes-crate:CheckValueObjectHasDescriptiveNameAndIsAssessAction |
27 | 29 | a sh:NodeShape ; |
28 | | - sh:name "RootDataEntity" ; |
29 | | - sh:targetClass ro-crate:RootDataEntity ; |
| 30 | + sh:name "CheckValue" ; |
30 | 31 | sh:description "" ; |
31 | 32 |
|
32 | | - sh:sparql [ |
33 | | - a sh:SPARQLConstraint ; |
34 | | - sh:name "mentions" ; |
35 | | - sh:description "RootDataEntity SHOULD mention a check value object." ; |
| 33 | + sh:target [ |
| 34 | + a sh:SPARQLTarget ; |
36 | 35 | sh:select """ |
37 | 36 | PREFIX schema: <http://schema.org/> |
38 | | - PREFIX shp: <https://w3id.org/shp#> |
39 | | - SELECT $this |
| 37 | + PREFIX shp: <https://w3id.org/shp#> |
| 38 | +
|
| 39 | + SELECT ?this |
40 | 40 | WHERE { |
41 | | - FILTER NOT EXISTS{ |
42 | | - $this schema:mentions ?action . |
43 | | - ?action schema:additionalType shp:CheckValue . |
44 | | - } |
| 41 | + ?this schema:additionalType shp:CheckValue . |
45 | 42 | } |
46 | 43 | """ ; |
47 | | - sh:severity sh:Warning ; |
48 | | - sh:message "RootDataEntity SHOULD mention a check value object." ; |
| 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 "CheckValue MUST be a `AssessAction`." ; |
| 52 | + ] ; |
| 53 | + |
| 54 | + sh:property [ |
| 55 | + sh:a sh:PropertyShape ; |
| 56 | + sh:name "name" ; |
| 57 | + sh:description "CheckValue 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 "CheckValue MUST have a human readable name string." ; |
| 62 | + ] . |
| 63 | + |
| 64 | +five-safes-crate:CheckValueActionStatusMustHaveAllowedValues |
| 65 | + a sh:NodeShape ; |
| 66 | + sh:name "CheckValue" ; |
| 67 | + sh:description "" ; |
| 68 | + |
| 69 | + sh:target [ |
| 70 | + a sh:SPARQLTarget ; |
| 71 | + sh:select """ |
| 72 | + PREFIX schema: <http://schema.org/> |
| 73 | + PREFIX shp: <https://w3id.org/shp#> |
| 74 | +
|
| 75 | + SELECT ?this |
| 76 | + WHERE { |
| 77 | + ?this schema:additionalType shp:CheckValue ; |
| 78 | + schema:actionStatus ?status . |
| 79 | + } |
| 80 | + """ ; |
| 81 | + ] ; |
| 82 | + |
| 83 | + sh:property [ |
| 84 | + a sh:PropertyShape ; |
| 85 | + sh:name "ActionStatus" ; |
| 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 "`CheckValue` --> `actionStatus` MUST have one of the allowed values." ; |
49 | 95 | ] . |
50 | 96 |
|
51 | 97 |
|
| 98 | +#=== SHOULD shapes ===# |
| 99 | + |
| 100 | +#--- THIS NEEDS FURTHER CHECKS ---# |
| 101 | + |
| 102 | +# five-safes-crate:RootDataEntityShouldMentionCheckValueObject |
| 103 | +# a sh:NodeShape ; |
| 104 | +# sh:name "RootDataEntity" ; |
| 105 | +# sh:targetClass ro-crate:RootDataEntity ; |
| 106 | +# sh:description "" ; |
| 107 | + |
| 108 | +# sh:sparql [ |
| 109 | +# a sh:SPARQLConstraint ; |
| 110 | +# sh:name "mentions" ; |
| 111 | +# sh:description "RootDataEntity SHOULD mention a check value object." ; |
| 112 | +# sh:select """ |
| 113 | +# PREFIX schema: <http://schema.org/> |
| 114 | +# PREFIX shp: <https://w3id.org/shp#> |
| 115 | +# SELECT $this |
| 116 | +# WHERE { |
| 117 | +# FILTER NOT EXISTS{ |
| 118 | +# $this schema:mentions ?action . |
| 119 | +# ?action schema:additionalType shp:CheckValue . |
| 120 | +# } |
| 121 | +# } |
| 122 | +# """ ; |
| 123 | +# sh:severity sh:Warning ; |
| 124 | +# sh:message "RootDataEntity SHOULD mention a check value object." ; |
| 125 | +# ] . |
| 126 | + |
| 127 | + |
52 | 128 | five-safes-crate:CheckValueObjectShouldPointToRootDataEntity |
53 | 129 | a sh:NodeShape ; |
54 | 130 | sh:name "CheckValue" ; |
@@ -188,3 +264,38 @@ five-safes-crate:CheckValueShouldHaveActionStatus |
188 | 264 | sh:severity sh:Warning ; |
189 | 265 | sh:message "CheckValue SHOULD have actionStatus property." ; |
190 | 266 | ] . |
| 267 | + |
| 268 | + |
| 269 | +#=== MAY shapes ===# |
| 270 | + |
| 271 | +five-safes-crate:CheckValueMayHaveStartTime |
| 272 | + a sh:NodeShape ; |
| 273 | + sh:name "CheckValue" ; |
| 274 | + sh:description "" ; |
| 275 | + sh:target [ |
| 276 | + a sh:SPARQLTarget ; |
| 277 | + sh:select """ |
| 278 | + PREFIX schema: <http://schema.org/> |
| 279 | + PREFIX shp: <https://w3id.org/shp#> |
| 280 | + SELECT ?this |
| 281 | + WHERE { |
| 282 | + ?this schema:additionalType shp:CheckValue ; |
| 283 | + schema:actionStatus ?status . |
| 284 | + FILTER(?status IN ( |
| 285 | + "http://schema.org/CompletedActionStatus", |
| 286 | + "http://schema.org/FailedActionStatus", |
| 287 | + "http://schema.org/ActiveActionStatus" |
| 288 | + )) |
| 289 | + } |
| 290 | + """ ; |
| 291 | + ] ; |
| 292 | + |
| 293 | + sh:property [ |
| 294 | + a sh:PropertyShape ; |
| 295 | + sh:name "StartTime" ; |
| 296 | + sh:path schema:startTime ; |
| 297 | + sh:minCount 1 ; |
| 298 | + sh:maxCount 1 ; |
| 299 | + sh:severity sh:Info ; |
| 300 | + sh:message "`CheckValue` MAY have the `startTime` property." ; |
| 301 | + ] . |
0 commit comments