1616@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
1717@prefix process-run-crate: <https://github.com/crs4/rocrate-validator/profiles/process-run-crate/> .
1818@prefix schema: <http://schema.org/> .
19- @prefix bioschemas: <https://bioschemas.org/> .
2019@prefix sh: <http://www.w3.org/ns/shacl#> .
21- @prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .
20+ @prefix bioschemas: <https://bioschemas.org/> .
21+
22+
23+ # === MUST shapes ===#
24+
25+ process-run-crate:ProcRCActionRequired a sh:NodeShape ;
26+ sh:name " Process Run Crate Action" ;
27+ sh:description " Properties of the Process Run Crate Action" ;
28+ sh:targetClass schema:CreateAction ,
29+ schema:ActivateAction ,
30+ schema:UpdateAction ;
31+ sh:property [
32+ a sh:PropertyShape ;
33+ sh:name " Action instrument" ;
34+ sh:description " The Action MUST have an instrument property that references the executed tool" ;
35+ sh:path schema:instrument ;
36+ sh:or (
37+ [ sh:class schema:SoftwareApplication ; ]
38+ [ sh:class schema:SoftwareSourceCode ; ]
39+ [ sh:class bioschemas:ComputationalWorkflow ; ]
40+ ) ;
41+ sh:minCount 1 ;
42+ sh:message " The Action MUST have an instrument property that references the executed tool" ;
43+ sh:severity sh:Violation ;
44+ ] .
45+
46+
47+ # === SHOULD shapes ===#
2248
2349process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
2450 sh:name " Process Run Crate Action SHOULD" ;
@@ -34,6 +60,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
3460 sh:node ro-crate:RootDataEntity ;
3561 sh:minCount 1 ;
3662 sh:message " The Action SHOULD be referenced from the Root Data Entity via mentions" ;
63+ sh:severity sh:Warning ;
3764 ] ;
3865 sh:property [
3966 a sh:PropertyShape ;
@@ -42,6 +69,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
4269 sh:path schema:name ;
4370 sh:minCount 1 ;
4471 sh:message " The Action SHOULD have a name" ;
72+ sh:severity sh:Warning ;
4573 ] ;
4674 sh:property [
4775 a sh:PropertyShape ;
@@ -50,6 +78,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
5078 sh:path schema:description ;
5179 sh:minCount 1 ;
5280 sh:message " The Action SHOULD have a description" ;
81+ sh:severity sh:Warning ;
5382 ] ;
5483 sh:property [
5584 a sh:PropertyShape ;
@@ -59,6 +88,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
5988 sh:pattern " ^(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?\\+\\d{2}:\\d{2})?$" ;
6089 sh:minCount 1 ;
6190 sh:message " The Action SHOULD have an endTime in ISO 8601 format" ;
91+ sh:severity sh:Warning ;
6292 ] ;
6393 sh:property [
6494 a sh:PropertyShape ;
@@ -67,6 +97,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
6797 sh:path schema:startTime ;
6898 sh:pattern " ^(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?\\+\\d{2}:\\d{2})?$" ;
6999 sh:message " If present, the Action startTime SHOULD be in ISO 8601 format" ;
100+ sh:severity sh:Warning ;
70101 ] ;
71102 sh:property [
72103 a sh:PropertyShape ;
@@ -79,6 +110,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
79110 ) ;
80111 sh:minCount 1 ;
81112 sh:message " The Action SHOULD have an agent that is a Person or Organization" ;
113+ sh:severity sh:Warning ;
82114 ] ;
83115 sh:property [
84116 a sh:PropertyShape ;
@@ -90,6 +122,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
90122 " http://schema.org/FailedActionStatus"
91123 ) ;
92124 sh:message " If the Action has an actionStatus, it should be http://schema.org/CompletedActionStatus or http://schema.org/FailedActionStatus" ;
125+ sh:severity sh:Warning ;
93126 ] ;
94127 sh:property [
95128 a sh:PropertyShape ;
@@ -98,6 +131,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
98131 sh:path wfrun:environment ;
99132 sh:class schema:PropertyValue ;
100133 sh:message " If the Action has an environment, it should point to entities of type PropertyValue" ;
134+ sh:severity sh:Warning ;
101135 ] ;
102136 sh:property [
103137 a sh:PropertyShape ;
@@ -109,6 +143,7 @@ process-run-crate:ProcRCActionRecommended a sh:NodeShape ;
109143 [ sh:pattern " ^http.*" ; ]
110144 ) ;
111145 sh:message " If the Action has a containerImage, it should point to a ContainerImage or a URL" ;
146+ sh:severity sh:Warning ;
112147 ] .
113148
114149
@@ -124,13 +159,15 @@ process-run-crate:ProcRCCreateUpdateActionRecommended a sh:NodeShape ;
124159 sh:path schema:result ;
125160 sh:minCount 1 ;
126161 sh:message " The Action SHOULD have a result" ;
162+ sh:severity sh:Warning ;
127163 ] .
128164
129165
130166process-run-crate:ProcRCActionError a sh:NodeShape ;
131167 sh:name " Process Run Crate Action error" ;
132168 sh:description " error SHOULD NOT be specified unless actionStatus is set to FailedActionStatus" ;
133169 sh:message " error SHOULD NOT be specified unless actionStatus is set to FailedActionStatus" ;
170+ sh:severity sh:Warning ;
134171 sh:target [
135172 a sh:SPARQLTarget ;
136173 sh:prefixes ro-crate:sparqlPrefixes ;
@@ -172,4 +209,86 @@ process-run-crate:ProcRCActionObjectResultType a sh:NodeShape ;
172209 [ sh:class schema:PropertyValue ; ]
173210 );
174211 sh:message " object and result SHOULD point to entities of type MediaObject, Dataset, Collection, CreativeWork or PropertyValue" ;
212+ sh:severity sh:Warning ;
213+ ] .
214+
215+
216+ # === MAY shapes ===#
217+
218+ process-run-crate:ProcRCActionOptional a sh:NodeShape ;
219+ sh:name " Process Run Crate Action MAY" ;
220+ sh:description " Recommended properties of the Process Run Crate Action" ;
221+ sh:targetClass schema:CreateAction ,
222+ schema:ActivateAction ,
223+ schema:UpdateAction ;
224+ sh:property [
225+ a sh:PropertyShape ;
226+ sh:name " Action startTime" ;
227+ sh:description " The Action MAY have a startTime" ;
228+ sh:path schema:startTime ;
229+ sh:minCount 1 ;
230+ sh:message " The Action MAY have a startTime" ;
231+ sh:severity sh:Info ;
232+ ] ;
233+ sh:property [
234+ a sh:PropertyShape ;
235+ sh:name " Action object" ;
236+ sh:description " The Action MAY have an object" ;
237+ sh:path schema:object ;
238+ sh:minCount 1 ;
239+ sh:message " The Action MAY have an object" ;
240+ sh:severity sh:Info ;
241+ ] ;
242+ sh:property [
243+ a sh:PropertyShape ;
244+ sh:name " Action actionStatus" ;
245+ sh:description " The Action MAY have an actionStatus" ;
246+ sh:path schema:actionStatus ;
247+ sh:minCount 1 ;
248+ sh:message " The Action MAY have an actionStatus" ;
249+ sh:severity sh:Info ;
250+ ] ;
251+ sh:property [
252+ a sh:PropertyShape ;
253+ sh:name " Action environment" ;
254+ sh:description " The Action MAY have an environment" ;
255+ sh:path wfrun:environment ;
256+ sh:minCount 1 ;
257+ sh:message " The Action MAY have an environment" ;
258+ sh:severity sh:Info ;
259+ ] ;
260+ sh:property [
261+ a sh:PropertyShape ;
262+ sh:name " Action containerImage" ;
263+ sh:description " The Action MAY have a containerImage" ;
264+ sh:path wfrun:containerImage ;
265+ sh:minCount 1 ;
266+ sh:message " The Action MAY have a containerImage" ;
267+ sh:severity sh:Info ;
268+ ] .
269+
270+
271+ process-run-crate:ProcRCActionErrorMay a sh:NodeShape ;
272+ sh:name " Process Run Crate Action MAY have error" ;
273+ sh:description " error MAY be specified if actionStatus is set to FailedActionStatus" ;
274+ sh:target [
275+ a sh:SPARQLTarget ;
276+ sh:prefixes ro-crate:sparqlPrefixes ;
277+ sh:select """
278+ SELECT ?this
279+ WHERE {
280+ { ?this a schema:CreateAction } UNION
281+ { ?this a schema:ActivateAction } UNION
282+ { ?this a schema:UpdateAction } .
283+ ?this schema:actionStatus ?status .
284+ FILTER(?status = "http://schema.org/FailedActionStatus") .
285+ }
286+ """
287+ ] ;
288+ sh:property [
289+ a sh:PropertyShape ;
290+ sh:path schema:error ;
291+ sh:minCount 1 ;
292+ sh:message " error MAY be specified if actionStatus is set to FailedActionStatus" ;
293+ sh:severity sh:Info ;
175294 ] .
0 commit comments