Skip to content

Commit 38bed9f

Browse files
authored
Merge pull request #89 from eScienceLab/72-flatten-4_sign_offttl-files
72 flatten `4_sign_off.ttl` files
2 parents 725d5cd + c02f08c commit 38bed9f

3 files changed

Lines changed: 109 additions & 148 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: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,83 @@
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 ;
@@ -185,3 +256,40 @@ five-safes-crate:SignOffPhaseEndTime
185256
sh:description "Sign Off object SHOULD have endTime property if action completed or failed." ;
186257
sh:message "Sign Off object SHOULD have endTime property if action completed or failed." ;
187258
] .
259+
260+
261+
#=== MAY shapes ===#
262+
263+
five-safes-crate:SignOffPhaseStartTime
264+
a sh:NodeShape ;
265+
sh:name "SignOffPhaseStartTime" ;
266+
267+
sh:target [
268+
a sh:SPARQLTarget ;
269+
sh:select """
270+
PREFIX schema: <http://schema.org/>
271+
PREFIX shp: <https://w3id.org/shp#>
272+
SELECT ?this
273+
WHERE {
274+
?this schema:additionalType shp:SignOff ;
275+
schema:actionStatus ?status .
276+
FILTER(?status IN (
277+
"http://schema.org/ActiveActionStatus",
278+
"http://schema.org/CompletedActionStatus",
279+
"http://schema.org/FailedActionStatus"
280+
))
281+
}
282+
""" ;
283+
] ;
284+
285+
sh:property [
286+
a sh:PropertyShape ;
287+
sh:name "StartTime" ;
288+
sh:path schema:startTime ;
289+
sh:minCount 1 ;
290+
sh:maxCount 1 ;
291+
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})$" ;
292+
sh:severity sh:Info ;
293+
sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
294+
sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
295+
] .

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)