Skip to content

Commit 5b79884

Browse files
committed
Addressed Eli's comments to PR.
1 parent 86a1b71 commit 5b79884

5 files changed

Lines changed: 201 additions & 151 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 sh: <http://www.w3.org/ns/shacl#> .
21+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
22+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
23+
24+
25+
five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
26+
a sh:NodeShape ;
27+
sh:name "WorkflowExecution" ;
28+
sh:description "The workflow execution object MAY have a startTime if execution was initiated." ;
29+
30+
sh:target [
31+
a sh:SPARQLTarget ;
32+
sh:select """
33+
PREFIX schema: <http://schema.org/>
34+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
35+
36+
SELECT ?this
37+
WHERE {
38+
?this rdf:type schema:CreateAction ;
39+
schema:actionStatus ?status .
40+
FILTER(?status IN (
41+
"http://schema.org/CompletedActionStatus",
42+
"http://schema.org/FailedActionStatus",
43+
"http://schema.org/ActiveActionStatus"
44+
))
45+
}
46+
""" ;
47+
] ;
48+
49+
sh:property [
50+
a sh:PropertyShape ;
51+
sh:name "StartTime" ;
52+
sh:path schema:startTime ;
53+
sh:minCount 1 ;
54+
sh:maxCount 1 ;
55+
sh:severity sh:Info ;
56+
sh:description "The workflow execution object MAY have a startTime if execution was initiated." ;
57+
sh:message "The workflow execution object MAY have a startTime if execution was initiated." ;
58+
] .

rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ five-safes-crate:WorkflowMustHaveDescriptiveName
4141
] .
4242

4343

44-
five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
44+
five-safes-crate:WorkflowexecutionObjectHasCompliantStartTimeFormat
4545
a sh:NodeShape ;
4646
sh:name "WorkflowExecution" ;
47-
sh:description "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;
47+
sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
4848

4949
sh:target [
5050
a sh:SPARQLTarget ;
@@ -55,12 +55,7 @@ five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
5555
SELECT ?this
5656
WHERE {
5757
?this rdf:type schema:CreateAction ;
58-
schema:actionStatus ?status .
59-
FILTER(?status IN (
60-
"http://schema.org/CompletedActionStatus",
61-
"http://schema.org/FailedActionStatus",
62-
"http://schema.org/ActiveActionStatus"
63-
))
58+
schema:startTime ?time .
6459
}
6560
""" ;
6661
] ;
@@ -69,19 +64,17 @@ five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
6964
a sh:PropertyShape ;
7065
sh:name "StartTime" ;
7166
sh:path schema:startTime ;
72-
sh:minCount 1 ;
73-
sh:maxCount 1 ;
7467
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
7568
sh:severity sh:Violation ;
76-
sh:description "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;
77-
sh:message "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;
69+
sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
70+
sh:message "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
7871
] .
7972

8073

81-
five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
74+
five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat
8275
a sh:NodeShape ;
8376
sh:name "WorkflowExecution" ;
84-
sh:description "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;
77+
sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
8578

8679
sh:target [
8780
a sh:SPARQLTarget ;
@@ -92,11 +85,7 @@ five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
9285
SELECT ?this
9386
WHERE {
9487
?this rdf:type schema:CreateAction ;
95-
schema:actionStatus ?status .
96-
FILTER(?status IN (
97-
"http://schema.org/CompletedActionStatus",
98-
"http://schema.org/FailedActionStatus"
99-
))
88+
schema:endTime ?time .
10089
}
10190
""" ;
10291
] ;
@@ -105,12 +94,10 @@ five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
10594
a sh:PropertyShape ;
10695
sh:name "EndTime" ;
10796
sh:path schema:endTime ;
108-
sh:minCount 1 ;
109-
sh:maxCount 1 ;
11097
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
11198
sh:severity sh:Violation ;
112-
sh:description "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;
113-
sh:message "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;
99+
sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
100+
sh:message "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
114101
] .
115102

116103

@@ -122,7 +109,7 @@ five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
122109
a sh:PropertyShape ;
123110
sh:minCount 1 ;
124111
sh:name "actionStatus" ;
125-
sh:description "WorkflowExecution MUST have an actionStatus with an allowed value." ;
112+
sh:description "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ;
126113
sh:path schema:actionStatus ;
127114
sh:in (
128115
"http://schema.org/PotentialActionStatus"
@@ -131,5 +118,5 @@ five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
131118
"http://schema.org/FailedActionStatus"
132119
) ;
133120
sh:severity sh:Violation ;
134-
sh:message "WorkflowExecution MUST have an actionStatus with an allowed value." ;
121+
sh:message "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ;
135122
] .

rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
five-safes-crate:RootDataEntityShouldMentionWorkflow
2828
a sh:NodeShape ;
2929
sh:name "RootDataEntity" ;
30-
sh:description "The RootDataEntity SHOULD mention a workflow execution object typed as CreateAction." ;
30+
sh:description "RootDataEntity SHOULD mention workflow execution object (typed CreateAction)." ;
3131
sh:targetClass ro-crate:RootDataEntity ;
3232
sh:sparql [
3333
a sh:SPARQLConstraint ;
@@ -46,4 +46,40 @@ five-safes-crate:RootDataEntityShouldMentionWorkflow
4646
""" ;
4747
sh:severity sh:Warning ;
4848
sh:message "RootDataEntity SHOULD mention workflow execution object (typed CreateAction)." ;
49-
] .
49+
] .
50+
51+
52+
53+
five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
54+
a sh:NodeShape ;
55+
sh:name "WorkflowExecution" ;
56+
sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ;
57+
58+
sh:target [
59+
a sh:SPARQLTarget ;
60+
sh:select """
61+
PREFIX schema: <http://schema.org/>
62+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
63+
64+
SELECT ?this
65+
WHERE {
66+
?this rdf:type schema:CreateAction ;
67+
schema:actionStatus ?status .
68+
FILTER(?status IN (
69+
"http://schema.org/CompletedActionStatus",
70+
"http://schema.org/FailedActionStatus"
71+
))
72+
}
73+
""" ;
74+
] ;
75+
76+
sh:property [
77+
a sh:PropertyShape ;
78+
sh:name "EndTime" ;
79+
sh:path schema:endTime ;
80+
sh:minCount 1 ;
81+
sh:maxCount 1 ;
82+
sh:severity sh:Warning ;
83+
sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ;
84+
sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ;
85+
] .

0 commit comments

Comments
 (0)