Skip to content

Commit 4a4138f

Browse files
committed
Removed MUST/SHOULD/MAY folder structure from five-safes-crate profile.
1 parent 8fc209e commit 4a4138f

37 files changed

Lines changed: 1027 additions & 1490 deletions

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

Lines changed: 8 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,6 @@ five-safes-crate:CreateActionResultOutputsHaveAllowedTypes
8792
]
8893
) .
8994

95+
96+
#=== MAY shapes ===#
97+
# (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: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,48 @@
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+
67+
#=== SHOULD shapes ===#
2668

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

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: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,80 @@
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 `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+
98+
#=== SHOULD shapes ===#
99+
26100
five-safes-crate:RootDataEntityShouldMentionCheckValueObject
27101
a sh:NodeShape ;
28102
sh:name "RootDataEntity" ;
@@ -188,3 +262,38 @@ five-safes-crate:CheckValueShouldHaveActionStatus
188262
sh:severity sh:Warning ;
189263
sh:message "CheckValue SHOULD have actionStatus property." ;
190264
] .
265+
266+
267+
#=== MAY shapes ===#
268+
269+
five-safes-crate:CheckValueMayHaveStartTime
270+
a sh:NodeShape ;
271+
sh:name "CheckValue" ;
272+
sh:description "" ;
273+
sh:target [
274+
a sh:SPARQLTarget ;
275+
sh:select """
276+
PREFIX schema: <http://schema.org/>
277+
PREFIX shp: <https://w3id.org/shp#>
278+
SELECT ?this
279+
WHERE {
280+
?this schema:additionalType shp:CheckValue ;
281+
schema:actionStatus ?status .
282+
FILTER(?status IN (
283+
"http://schema.org/CompletedActionStatus",
284+
"http://schema.org/FailedActionStatus",
285+
"http://schema.org/ActiveActionStatus"
286+
))
287+
}
288+
""" ;
289+
] ;
290+
291+
sh:property [
292+
a sh:PropertyShape ;
293+
sh:name "StartTime" ;
294+
sh:path schema:startTime ;
295+
sh:minCount 1 ;
296+
sh:maxCount 1 ;
297+
sh:severity sh:Info ;
298+
sh:message "`CheckValue` MAY have the `startTime` property." ;
299+
] .

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

File renamed without changes.

0 commit comments

Comments
 (0)