Skip to content

Commit 5133d57

Browse files
committed
Removed MUST/SHOULD/MAY folder structure from process-run-crate profile.
1 parent 81ce91e commit 5133d57

File tree

9 files changed

+228
-222
lines changed

9 files changed

+228
-222
lines changed

rocrate_validator/profiles/process-run-crate/should/0_software-application.ttl renamed to rocrate_validator/profiles/process-run-crate/0_software-application.ttl

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
@prefix bioschemas: <https://bioschemas.org/> .
2121
@prefix sh: <http://www.w3.org/ns/shacl#> .
2222

23+
24+
#=== MUST shapes ===#
25+
# (none)
26+
27+
28+
#=== SHOULD shapes ===#
29+
2330
process-run-crate:ProcRCApplication a sh:NodeShape ;
2431
sh:name "ProcRC Application" ;
2532
sh:description "Properties of a Process Run Crate Application" ;
@@ -33,6 +40,7 @@ process-run-crate:ProcRCApplication a sh:NodeShape ;
3340
sh:path schema:name ;
3441
sh:minCount 1 ;
3542
sh:message "The Application SHOULD have a name" ;
43+
sh:severity sh:Warning ;
3644
] ;
3745
sh:property [
3846
a sh:PropertyShape ;
@@ -41,6 +49,7 @@ process-run-crate:ProcRCApplication a sh:NodeShape ;
4149
sh:path schema:url ;
4250
sh:minCount 1 ;
4351
sh:message "The Application SHOULD have a url" ;
52+
sh:severity sh:Warning ;
4453
] .
4554

4655
process-run-crate:ProcRCSoftwareSourceCodeComputationalWorkflow a sh:NodeShape ;
@@ -55,6 +64,7 @@ process-run-crate:ProcRCSoftwareSourceCodeComputationalWorkflow a sh:NodeShape ;
5564
sh:path schema:version ;
5665
sh:minCount 1 ;
5766
sh:message "The SoftwareSourceCode or ComputationalWorkflow SHOULD have a version" ;
67+
sh:severity sh:Warning ;
5868
] .
5969

6070
process-run-crate:ProcRCSoftwareApplication a sh:NodeShape ;
@@ -65,12 +75,13 @@ process-run-crate:ProcRCSoftwareApplication a sh:NodeShape ;
6575
a sh:PropertyShape ;
6676
sh:name "version or softwareVersion" ;
6777
sh:description "The SoftwareApplication SHOULD have a version or softwareVersion" ;
68-
sh:message "The SoftwareApplication SHOULD have a version or softwareVersion" ;
6978
sh:path [
7079
sh:alternativePath ( schema:version schema:softwareVersion ) ;
7180
] ;
7281
sh:minLength 1 ;
7382
sh:minCount 1 ;
83+
sh:message "The SoftwareApplication SHOULD have a version or softwareVersion" ;
84+
sh:severity sh:Warning ;
7485
] .
7586

7687

@@ -92,6 +103,7 @@ process-run-crate:ProcRCSoftwareApplicationSingleVersion a sh:NodeShape ;
92103
sh:minCount 1 ;
93104
]]
94105
) ;
106+
sh:severity sh:Warning ;
95107
] .
96108

97109

@@ -108,4 +120,35 @@ process-run-crate:ProcRCSoftwareApplicationID a sh:NodeShape ;
108120
sh:path [ sh:inversePath rdf:type ] ;
109121
sh:pattern "^http.*" ;
110122
sh:message "The SoftwareApplication id SHOULD be an absolute URI" ;
123+
sh:severity sh:Warning ;
111124
] .
125+
126+
127+
#=== MAY shapes ===#
128+
129+
process-run-crate:ProcRCSoftwareApplicationOptional a sh:NodeShape ;
130+
sh:name "ProcRC SoftwareApplication MAY" ;
131+
sh:description "Optional properties of a Process Run Crate SoftwareApplication" ;
132+
# Avoid performing checks on dependencies
133+
sh:target [
134+
a sh:SPARQLTarget ;
135+
sh:prefixes ro-crate:sparqlPrefixes ;
136+
sh:select """
137+
SELECT ?this
138+
WHERE {
139+
?this a schema:SoftwareApplication .
140+
FILTER NOT EXISTS { ?other schema:softwareRequirements ?this } .
141+
}
142+
"""
143+
] ;
144+
sh:property [
145+
a sh:PropertyShape ;
146+
sh:name "SoftwareApplication softwareRequirements" ;
147+
sh:description "The SoftwareApplication MAY have a softwareRequirements that points to a SoftwareApplication" ;
148+
sh:message "The SoftwareApplication MAY have a softwareRequirements that points to a SoftwareApplication" ;
149+
sh:path schema:softwareRequirements ;
150+
sh:class schema:SoftwareApplication ;
151+
sh:minCount 1 ;
152+
sh:severity sh:Info ;
153+
] .
154+

rocrate_validator/profiles/process-run-crate/should/1_create_action.ttl renamed to rocrate_validator/profiles/process-run-crate/1_create_action.ttl

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,35 @@
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

2349
process-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

130166
process-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
] .

rocrate_validator/profiles/process-run-crate/should/2_collection.ttl renamed to rocrate_validator/profiles/process-run-crate/2_collection.ttl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
@prefix sh: <http://www.w3.org/ns/shacl#> .
2121
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
2222

23+
24+
#=== MUST shapes ===#
25+
# (none)
26+
27+
28+
#=== SHOULD shapes ===#
29+
2330
process-run-crate:ProcRCCollectionRecommended a sh:NodeShape ;
2431
sh:name "Process Run Crate Collection SHOULD" ;
2532
sh:description "Recommended properties of the Process Run Crate Collection" ;
@@ -46,6 +53,7 @@ process-run-crate:ProcRCCollectionRecommended a sh:NodeShape ;
4653
sh:node ro-crate:RootDataEntity ;
4754
sh:minCount 1 ;
4855
sh:message "The Collection SHOULD be referenced from the Root Data Entity via mentions" ;
56+
sh:severity sh:Warning ;
4957
] ;
5058
sh:property [
5159
a sh:PropertyShape ;
@@ -54,6 +62,7 @@ process-run-crate:ProcRCCollectionRecommended a sh:NodeShape ;
5462
sh:path schema:hasPart ;
5563
sh:minCount 1 ;
5664
sh:message "The Collection SHOULD have a hasPart" ;
65+
sh:severity sh:Warning ;
5766
] ;
5867
sh:property [
5968
a sh:PropertyShape ;
@@ -62,4 +71,8 @@ process-run-crate:ProcRCCollectionRecommended a sh:NodeShape ;
6271
sh:path schema:mainEntity ;
6372
sh:minCount 1 ;
6473
sh:message "The Collection SHOULD have a mainEntity" ;
74+
sh:severity sh:Warning ;
6575
] .
76+
77+
#=== MAY shapes ===#
78+
# (none)

rocrate_validator/profiles/process-run-crate/must/2_root_data_entity_metadata.ttl renamed to rocrate_validator/profiles/process-run-crate/2_root_data_entity_metadata.ttl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
@prefix schema: <http://schema.org/> .
2020
@prefix sh: <http://www.w3.org/ns/shacl#> .
2121

22+
23+
#=== MUST shapes ===#
24+
2225
process-run-crate:ProcRCRootDataEntityMetadata a sh:NodeShape ;
2326
sh:name "Root Data Entity Metadata" ;
2427
sh:description "Properties of the Root Data Entity" ;
@@ -36,4 +39,14 @@ process-run-crate:ProcRCRootDataEntityMetadata a sh:NodeShape ;
3639
sh:qualifiedMinCount 1 ;
3740
sh:minCount 1 ;
3841
sh:message "The Root Data Entity MUST reference a CreativeWork entity with an @id URI that is consistent with the versioned permalink of the profile" ;
42+
sh:severity sh:Violation ;
3943
] .
44+
45+
46+
#=== SHOULD shapes ===#
47+
# (none)
48+
49+
50+
#=== MAY shapes ===#
51+
# (none)
52+

0 commit comments

Comments
 (0)