Skip to content

Commit 37200d4

Browse files
EttoreMelichad
authored andcommitted
Merged 4_sign_off.tll files.
1 parent cd58c3c commit 37200d4

3 files changed

Lines changed: 130 additions & 149 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: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +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:name "SignOffPhase" ;
30101
sh:targetClass ro-crate:RootDataEntity ;
31102
sh:description "Check the Sign-Off Phase" ;
32103
sh:severity sh:Warning ;
33-
104+
34105
sh:sparql [
35106
sh:select """
36107
PREFIX schema: <http://schema.org/>
@@ -112,6 +183,25 @@ five-safes-crate:SignOffPhaseProperties
112183
sh:minCount 1 ;
113184
sh:severity sh:Warning ;
114185
sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with a human-readable name" ;
186+
] .
187+
188+
189+
five-safes-crate:SignOffPhaseProperties2
190+
a sh:NodeShape ;
191+
sh:description "Check Sign-Off Phase Properties" ;
192+
sh:severity sh:Warning ;
193+
sh:name "SignOffPhaseProperties" ;
194+
195+
sh:target [
196+
a sh:SPARQLTarget ;
197+
sh:select """
198+
PREFIX schema: <http://schema.org/>
199+
PREFIX shp: <https://w3id.org/shp#>
200+
SELECT ?this
201+
WHERE {
202+
?this schema:additionalType shp:SignOff .
203+
}
204+
"""
115205
] ;
116206

117207
sh:sparql [
@@ -157,6 +247,7 @@ five-safes-crate:SignOffPhaseEndTime
157247
a sh:NodeShape ;
158248
sh:name "SignOffPhaseEndTime" ;
159249
sh:description "Sign Off end time check" ;
250+
sh:name "SignOffPhaseEndTime" ;
160251

161252
sh:target [
162253
a sh:SPARQLTarget ;
@@ -185,3 +276,40 @@ five-safes-crate:SignOffPhaseEndTime
185276
sh:description "Sign Off object SHOULD have endTime property if action completed or failed." ;
186277
sh:message "Sign Off object SHOULD have endTime property if action completed or failed." ;
187278
] .
279+
280+
281+
#=== MAY shapes ===#
282+
283+
five-safes-crate:SignOffPhaseStartTime
284+
a sh:NodeShape ;
285+
sh:name "SignOffPhaseStartTime" ;
286+
287+
sh:target [
288+
a sh:SPARQLTarget ;
289+
sh:select """
290+
PREFIX schema: <http://schema.org/>
291+
PREFIX shp: <https://w3id.org/shp#>
292+
SELECT ?this
293+
WHERE {
294+
?this schema:additionalType shp:SignOff ;
295+
schema:actionStatus ?status .
296+
FILTER(?status IN (
297+
"http://schema.org/ActiveActionStatus",
298+
"http://schema.org/CompletedActionStatus",
299+
"http://schema.org/FailedActionStatus"
300+
))
301+
}
302+
""" ;
303+
] ;
304+
305+
sh:property [
306+
a sh:PropertyShape ;
307+
sh:name "StartTime" ;
308+
sh:path schema:startTime ;
309+
sh:minCount 1 ;
310+
sh:maxCount 1 ;
311+
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})$" ;
312+
sh:severity sh:Info ;
313+
sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
314+
sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
315+
] .

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)