Skip to content

Commit 81ce91e

Browse files
committed
Removed MUST/SHOULD/MAY folder structure from five-safes-crate profile.
1 parent dc26c17 commit 81ce91e

37 files changed

+1131
-1452
lines changed

rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl renamed to rocrate_validator/profiles/five-safes-crate/10_outputs.ttl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2323

2424

25+
#=== MUST shapes ===#
26+
# (none)
27+
28+
29+
#=== SHOULD shapes ===#
2530

2631
five-safes-crate:CreateActionHasResultIfActionCompleted
2732
a sh:NodeShape ;
@@ -87,3 +92,5 @@ five-safes-crate:CreateActionResultOutputsHaveAllowedTypes
8792
]
8893
) .
8994

95+
#=== MAY shapes ===#
96+
# (none)

rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl renamed to rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,47 @@
2323
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424

2525

26+
#=== MUST shapes ===#
27+
28+
five-safes-crate:WorkflowMustHaveDescriptiveName
29+
a sh:NodeShape ;
30+
sh:name "WorkflowExecution" ;
31+
sh:targetClass schema:CreateAction ;
32+
33+
sh:property [
34+
a sh:PropertyShape ;
35+
sh:name "name" ;
36+
sh:minCount 1 ;
37+
sh:description "Workflow (CreateAction) MUST have a name string of at least 10 characters." ;
38+
sh:path schema:name ;
39+
sh:datatype xsd:string ;
40+
sh:minLength 10 ;
41+
sh:severity sh:Violation ;
42+
sh:message "Workflow (CreateAction) MUST have a name string of at least 10 characters." ;
43+
] .
44+
45+
46+
five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
47+
a sh:NodeShape ;
48+
sh:name "WorkflowExecution" ;
49+
sh:targetClass schema:CreateAction ;
50+
sh:property [
51+
a sh:PropertyShape ;
52+
sh:minCount 1 ;
53+
sh:name "actionStatus" ;
54+
sh:description "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ;
55+
sh:path schema:actionStatus ;
56+
sh:in (
57+
"http://schema.org/PotentialActionStatus"
58+
"http://schema.org/ActiveActionStatus"
59+
"http://schema.org/CompletedActionStatus"
60+
"http://schema.org/FailedActionStatus"
61+
) ;
62+
sh:severity sh:Violation ;
63+
sh:message "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ;
64+
] .
65+
66+
#=== SHOULD shapes ===#
2667

2768
five-safes-crate:RootDataEntityShouldMentionWorkflow
2869
a sh:NodeShape ;
@@ -49,7 +90,6 @@ five-safes-crate:RootDataEntityShouldMentionWorkflow
4990
] .
5091

5192

52-
5393
five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
5494
a sh:NodeShape ;
5595
sh:name "WorkflowExecution" ;
@@ -82,4 +122,47 @@ five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
82122
sh:severity sh:Warning ;
83123
sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ;
84124
sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ;
85-
] .
125+
] .
126+
127+
#=== MAY shapes ===#
128+
129+
five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
130+
a sh:NodeShape ;
131+
sh:name "WorkflowExecution" ;
132+
sh:description (
133+
"The workflow execution object MAY have a startTime if actionStatus is "
134+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
135+
) ;
136+
137+
sh:target [
138+
a sh:SPARQLTarget ;
139+
sh:select """
140+
PREFIX schema: <http://schema.org/>
141+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
142+
143+
SELECT ?this
144+
WHERE {
145+
?this rdf:type schema:CreateAction ;
146+
schema:actionStatus ?status .
147+
FILTER(?status IN (
148+
"http://schema.org/CompletedActionStatus",
149+
"http://schema.org/FailedActionStatus",
150+
"http://schema.org/ActiveActionStatus"
151+
))
152+
}
153+
""" ;
154+
] ;
155+
156+
sh:property [
157+
a sh:PropertyShape ;
158+
sh:name "StartTime" ;
159+
sh:path schema:startTime ;
160+
sh:minCount 1 ;
161+
sh:maxCount 1 ;
162+
sh:severity sh:Info ;
163+
sh:description (
164+
"The workflow execution object MAY have a startTime if actionStatus is "
165+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
166+
) ;
167+
sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
168+
] .

rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl renamed to rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,79 @@
2323
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424

2525

26+
#=== MUST shapes ===#
27+
28+
five-safes-crate:CheckValueObjectHasDescriptiveNameAndIsAssessAction
29+
a sh:NodeShape ;
30+
sh:name "CheckValue" ;
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:CheckValue .
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 "CheckValue MUST be a `schema: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." ;
95+
] .
96+
97+
#=== SHOULD shapes ===#
98+
2699
five-safes-crate:RootDataEntityShouldMentionCheckValueObject
27100
a sh:NodeShape ;
28101
sh:name "RootDataEntity" ;
@@ -188,3 +261,37 @@ five-safes-crate:CheckValueShouldHaveActionStatus
188261
sh:severity sh:Warning ;
189262
sh:message "CheckValue SHOULD have actionStatus property." ;
190263
] .
264+
265+
#=== MAY shapes ===#
266+
267+
five-safes-crate:CheckValueMayHaveStartTime
268+
a sh:NodeShape ;
269+
sh:name "CheckValue" ;
270+
sh:description "" ;
271+
sh:target [
272+
a sh:SPARQLTarget ;
273+
sh:select """
274+
PREFIX schema: <http://schema.org/>
275+
PREFIX shp: <https://w3id.org/shp#>
276+
SELECT ?this
277+
WHERE {
278+
?this schema:additionalType shp:CheckValue ;
279+
schema:actionStatus ?status .
280+
FILTER(?status IN (
281+
"http://schema.org/CompletedActionStatus",
282+
"http://schema.org/FailedActionStatus",
283+
"http://schema.org/ActiveActionStatus"
284+
))
285+
}
286+
""" ;
287+
] ;
288+
289+
sh:property [
290+
a sh:PropertyShape ;
291+
sh:name "StartTime" ;
292+
sh:path schema:startTime ;
293+
sh:minCount 1 ;
294+
sh:maxCount 1 ;
295+
sh:severity sh:Info ;
296+
sh:message "`CheckValue` MAY have the `startTime` property." ;
297+
] .

rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl renamed to rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,112 @@
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 `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+
26132
five-safes-crate:RootDataEntityShouldMentionValidationCheckObject
27133
a sh:NodeShape ;
28134
sh:name "RootDataEntity" ;
@@ -163,3 +269,38 @@ five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun
163269
sh:description "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
164270
sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
165271
] .
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

Comments
 (0)