Skip to content

Commit 3cdebda

Browse files
committed
Merged 4_sign_off.tll files.
1 parent 8fc209e commit 3cdebda

3 files changed

Lines changed: 135 additions & 152 deletions

File tree

rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl renamed to rocrate_validator/profiles/five-safes-crate/4_sign_off.ttl

Lines changed: 135 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,91 @@
1717
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
1818
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
1919
@prefix schema: <http://schema.org/> .
20+
@prefix purl: <http://purl.org/dc/terms/> .
2021
@prefix sh: <http://www.w3.org/ns/shacl#> .
2122
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
2223
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
23-
@prefix shp: <https://w3id.org/shp#> .
2424

2525

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+
2697
# There SHOULD be a Sign-Off Phase
2798
five-safes-crate:SignOffPhase
2899
a sh:NodeShape ;
29100
sh:targetClass ro-crate:RootDataEntity ;
30101
sh:description "Check the Sign-Off Phase" ;
102+
sh:severity sh:Warning ;
103+
sh:name "SignOffPhase" ;
104+
31105
sh:sparql [
32106
sh:select """
33107
PREFIX schema: <http://schema.org/>
@@ -39,7 +113,6 @@ five-safes-crate:SignOffPhase
39113
}
40114
}
41115
""" ;
42-
sh:severity sh:Warning ;
43116
sh:message "There SHOULD be a Sign-Off Phase in the Final RO-Crate" ;
44117
] ;
45118
sh:sparql [
@@ -54,14 +127,14 @@ five-safes-crate:SignOffPhase
54127
}
55128
}
56129
""" ;
57-
sh:severity sh:Warning ;
58130
sh:message "The Root Data Entity SHOULD mention a Sign-Off Phase Object" ;
59131
] .
60132

61133

62134
five-safes-crate:SignOffPhaseProperties
63135
a sh:NodeShape ;
64136
sh:description "Check Sign-Off Phase Properties" ;
137+
sh:name "SignOffPhaseProperties" ;
65138
sh:target [
66139
a sh:SPARQLTarget ;
67140
sh:select """
@@ -103,7 +176,27 @@ five-safes-crate:SignOffPhaseProperties
103176
sh:minCount 1 ;
104177
sh:severity sh:Warning ;
105178
sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with a human-readable name" ;
179+
] .
180+
181+
182+
five-safes-crate:SignOffPhaseProperties2
183+
a sh:NodeShape ;
184+
sh:description "Check Sign-Off Phase Properties" ;
185+
sh:severity sh:Warning ;
186+
sh:name "SignOffPhaseProperties" ;
187+
188+
sh:target [
189+
a sh:SPARQLTarget ;
190+
sh:select """
191+
PREFIX schema: <http://schema.org/>
192+
PREFIX shp: <https://w3id.org/shp#>
193+
SELECT ?this
194+
WHERE {
195+
?this schema:additionalType shp:SignOff .
196+
}
197+
"""
106198
] ;
199+
107200
sh:sparql [
108201
a sh:SPARQLConstraint ;
109202
sh:description "Check if the Sign Off phase lists the workflow as an object" ;
@@ -120,9 +213,9 @@ five-safes-crate:SignOffPhaseProperties
120213
}
121214
}
122215
""" ;
123-
sh:severity sh:Warning ;
124216
sh:message "The Sign-Off Phase SHOULD list the workflow (mainEntity) as an object" ;
125217
];
218+
126219
sh:sparql [
127220
a sh:SPARQLConstraint ;
128221
sh:description "Check if the Sign Off phase lists the Responsible Project as an object" ;
@@ -139,14 +232,14 @@ five-safes-crate:SignOffPhaseProperties
139232
}
140233
}
141234
""" ;
142-
sh:severity sh:Warning ;
143235
sh:message "The Sign-Off Phase SHOULD list the Responsible Project (sourceOrganization) as an object" ;
144236
].
145237

146238

147239
five-safes-crate:SignOffPhaseEndTime
148240
a sh:NodeShape ;
149241
sh:description "Sign Off end time check" ;
242+
sh:name "SignOffPhaseEndTime" ;
150243

151244
sh:target [
152245
a sh:SPARQLTarget ;
@@ -175,3 +268,40 @@ five-safes-crate:SignOffPhaseEndTime
175268
sh:description "Sign Off object SHOULD have endTime property if action completed or failed." ;
176269
sh:message "Sign Off object SHOULD have endTime property if action completed or failed." ;
177270
] .
271+
272+
273+
#=== MAY shapes ===#
274+
275+
five-safes-crate:SignOffPhaseStartTime
276+
a sh:NodeShape ;
277+
sh:name "SignOffPhaseStartTime" ;
278+
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:SignOff ;
287+
schema:actionStatus ?status .
288+
FILTER(?status IN (
289+
"http://schema.org/ActiveActionStatus",
290+
"http://schema.org/CompletedActionStatus",
291+
"http://schema.org/FailedActionStatus"
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: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})$" ;
304+
sh:severity sh:Info ;
305+
sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
306+
sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
307+
] .

rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl

Lines changed: 0 additions & 58 deletions
This file was deleted.

rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)