Skip to content

Commit 73a92db

Browse files
authored
Merge pull request #123 from eScienceLab/staging
Merging all changes about flattening the ttl files for 5-safes profile
2 parents fcd6ff1 + c0400ea commit 73a92db

38 files changed

Lines changed: 1229 additions & 1409 deletions

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

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

2424

25-
five-safes-crate:WorkflowRunActionHasResultIfActionCompleted
25+
#=== MUST shapes ===#
26+
# (none)
27+
28+
29+
#=== SHOULD shapes ===#
30+
31+
five-safes-crate:CreateActionHasResultIfActionCompleted
2632
a sh:NodeShape ;
2733
sh:name "WorkflowRunAction" ;
2834
sh:description "The `CreateAction` corresponding to the workflow run, with CompletedActionStatus, SHOULD have the `schema:result` property." ;
@@ -85,3 +91,7 @@ five-safes-crate:WorkflowRunActionResultOutputsHaveAllowedTypes
8591
sh:class schema:PropertyValue;
8692
]
8793
) .
94+
95+
96+
#=== MAY shapes ===#
97+
# (none)
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix purl: <http://purl.org/dc/terms/> .
21+
@prefix sh: <http://www.w3.org/ns/shacl#> .
22+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
23+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
24+
25+
26+
#=== MUST shapes ===#
27+
28+
five-safes-crate:WorkflowMustHaveDescriptiveName
29+
a sh:NodeShape ;
30+
sh:name "WorkflowExecution" ;
31+
sh:targetClass ro-crate:WorkflowRunAction ;
32+
33+
sh:property [
34+
a sh:PropertyShape ;
35+
sh:name "name" ;
36+
sh:minCount 1 ;
37+
sh:description "The `CreateAction` corresponding to the workflow run 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 "The `CreateAction` corresponding to the workflow run 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 ro-crate:WorkflowRunAction ;
50+
sh:property [
51+
a sh:PropertyShape ;
52+
sh:minCount 1 ;
53+
sh:name "actionStatus" ;
54+
sh:description "`CreateAction` 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 "`CreateAction` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ;
64+
] .
65+
66+
67+
#=== SHOULD shapes ===#
68+
69+
five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
70+
a sh:NodeShape ;
71+
sh:name "WorkflowExecution" ;
72+
sh:description "The workflow run object SHOULD have an endTime property if it has ended." ;
73+
74+
sh:target [
75+
a sh:SPARQLTarget ;
76+
sh:select """
77+
PREFIX schema: <http://schema.org/>
78+
PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/>
79+
80+
SELECT ?this
81+
WHERE {
82+
?this a rocrate:WorkflowRunAction ;
83+
schema:actionStatus ?status .
84+
FILTER(?status IN (
85+
"http://schema.org/CompletedActionStatus",
86+
"http://schema.org/FailedActionStatus"
87+
))
88+
}
89+
""" ;
90+
] ;
91+
92+
sh:property [
93+
a sh:PropertyShape ;
94+
sh:name "EndTime" ;
95+
sh:path schema:endTime ;
96+
sh:minCount 1 ;
97+
sh:maxCount 1 ;
98+
sh:severity sh:Warning ;
99+
sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ;
100+
sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ;
101+
] .
102+
103+
104+
#=== MAY shapes ===#
105+
106+
five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
107+
a sh:NodeShape ;
108+
sh:name "WorkflowExecution" ;
109+
sh:description (
110+
"The workflow execution object MAY have a startTime if actionStatus is "
111+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
112+
) ;
113+
114+
sh:target [
115+
a sh:SPARQLTarget ;
116+
sh:select """
117+
PREFIX schema: <http://schema.org/>
118+
PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/>
119+
120+
SELECT ?this
121+
WHERE {
122+
?this a rocrate:WorkflowRunAction ;
123+
schema:actionStatus ?status .
124+
FILTER(?status IN (
125+
"http://schema.org/CompletedActionStatus",
126+
"http://schema.org/FailedActionStatus",
127+
"http://schema.org/ActiveActionStatus"
128+
))
129+
}
130+
""" ;
131+
] ;
132+
133+
sh:property [
134+
a sh:PropertyShape ;
135+
sh:name "StartTime" ;
136+
sh:path schema:startTime ;
137+
sh:minCount 1 ;
138+
sh:maxCount 1 ;
139+
sh:severity sh:Info ;
140+
sh:description (
141+
"The workflow execution object MAY have a startTime if actionStatus is "
142+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
143+
) ;
144+
sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
145+
] .

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: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,86 @@
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" ;
29103
sh:targetClass ro-crate:RootDataEntity ;
30104
sh:description "" ;
105+
sh:severity sh:Warning ;
31106

32107
sh:sparql [
33108
a sh:SPARQLConstraint ;
@@ -44,7 +119,6 @@ five-safes-crate:RootDataEntityShouldMentionCheckValueObject
44119
}
45120
}
46121
""" ;
47-
sh:severity sh:Warning ;
48122
sh:message "RootDataEntity SHOULD mention a check value object." ;
49123
] .
50124

@@ -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+
] .

0 commit comments

Comments
 (0)