Skip to content

Commit 1c6b29e

Browse files
committed
Merge branch 'develop' into upstream-develop
2 parents 3fcaf92 + 68a6a3b commit 1c6b29e

53 files changed

Lines changed: 8644 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ extend-ignore-re = ["[0-9a-f]{7,40}"] # Ignore long hexadecimal strings, which a
133133
[tool.typos.files]
134134
extend-exclude = ["tests/data", "docs/diagrams", "*.json", "*.html", "*__init__.py"]
135135

136+
[tool.typos.default.extend-words]
137+
TRE = "TRE"
138+
136139
# Pylint configuration.
137140
# Ruff (see ruff.toml) is the primary linter/formatter; this section keeps
138141
# pylint consistent with it so the two tools do not disagree on style or on
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
16+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
17+
@prefix schema: <http://schema.org/> .
18+
@prefix sh: <http://www.w3.org/ns/shacl#> .
19+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
20+
21+
22+
ro-crate:FindWorkflowRunAction a sh:NodeShape, validator:HiddenShape;
23+
sh:order 1 ; # load this check after ro-crate:FindRootDataEntity; pySHACL sorts rules by sh:order before execution
24+
sh:name "Identify the CreateAction Entity that corresponds to the Workflow run" ;
25+
sh:description """The Workflow Run is the CreateAction entity that refers to Workflow run.
26+
This is identified by checking that the CreateAction entity has an `instrument` property
27+
that references the same entity as the `mainEntity` property of the Root Data Entity.""" ;
28+
sh:target [
29+
a sh:SPARQLTarget ;
30+
sh:prefixes ro-crate:sparqlPrefixes ;
31+
sh:select """
32+
SELECT ?this
33+
WHERE {
34+
?this a schema:CreateAction ;
35+
schema:instrument ?instrument .
36+
?root a ro-crate:RootDataEntity ;
37+
schema:mainEntity ?instrument .
38+
}
39+
"""
40+
] ;
41+
42+
sh:rule [
43+
a sh:TripleRule ;
44+
sh:subject sh:this ;
45+
sh:predicate rdf:type ;
46+
sh:object ro-crate:WorkflowRunAction ;
47+
] .
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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+
#=== MUST shapes ===#
26+
# (none)
27+
28+
29+
#=== SHOULD shapes ===#
30+
31+
five-safes-crate:CreateActionHasResultIfActionCompleted
32+
a sh:NodeShape ;
33+
sh:name "WorkflowRunAction" ;
34+
sh:description "The `CreateAction` corresponding to the workflow run, with CompletedActionStatus, SHOULD have the `schema:result` property." ;
35+
36+
sh:target [
37+
a sh:SPARQLTarget ;
38+
sh:name "WorkflowRunAction" ;
39+
sh:description "The `CreateAction` corresponding to the workflow run, with CompletedActionStatus, SHOULD have the `result` property." ;
40+
sh:prefixes ro-crate:sparqlPrefixes ;
41+
sh:select """
42+
SELECT ?this WHERE {
43+
?this a ro-crate:WorkflowRunAction ;
44+
schema:actionStatus "http://schema.org/CompletedActionStatus" .
45+
}
46+
"""
47+
] ;
48+
49+
50+
sh:property [
51+
a sh:PropertyShape ;
52+
sh:name "Result" ;
53+
sh:path schema:result ;
54+
sh:minCount 1 ;
55+
sh:severity sh:Warning ;
56+
sh:message "The `CreateAction` corresponding to the workflow run, with CompletedActionStatus, SHOULD have the `result` property." ;
57+
] .
58+
59+
60+
five-safes-crate:WorkflowRunActionResultOutputsHaveAllowedTypes
61+
a sh:NodeShape ;
62+
sh:name "Output" ;
63+
sh:description "Result SHOULD have a `@type` among an allowed set of values." ;
64+
sh:target [
65+
a sh:SPARQLTarget ;
66+
sh:prefixes ro-crate:sparqlPrefixes ;
67+
sh:select """
68+
SELECT ?this
69+
WHERE {
70+
?workflowRunAction a ro-crate:WorkflowRunAction .
71+
?workflowRunAction schema:result ?this .
72+
}
73+
""" ;
74+
] ;
75+
sh:message "Result SHOULD have a `@type` among an allowed set of values." ;
76+
sh:severity sh:Warning ;
77+
sh:or (
78+
[
79+
sh:class schema:MediaObject;
80+
]
81+
[
82+
sh:class schema:Dataset;
83+
]
84+
[
85+
sh:class schema:Collection;
86+
]
87+
[
88+
sh:class schema:DigitalDocument;
89+
]
90+
[
91+
sh:class schema:PropertyValue;
92+
]
93+
) .
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+
] .

0 commit comments

Comments
 (0)