Skip to content

Commit 620c5b5

Browse files
committed
Removed MUST/SHOULD/MAY folder structure from provenance-run-crate profile.
1 parent 5133d57 commit 620c5b5

21 files changed

+439
-511
lines changed

rocrate_validator/profiles/provenance-run-crate/must/0_computational_workflow.ttl renamed to rocrate_validator/profiles/provenance-run-crate/0_computational_workflow.ttl

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .
2424
@prefix provenance-run-crate: <https://github.com/crs4/rocrate-validator/profiles/provenance-run-crate/> .
2525

26+
27+
#=== MUST shapes ===#
28+
2629
provenance-run-crate:ProvRCComputationalWorkflowRequired a sh:NodeShape ;
2730
sh:name "Provenance Run Crate ComputationalWorkflow MUST" ;
2831
sh:description "Required properties of the Provenance Run Crate ComputationalWorkflow" ;
@@ -39,6 +42,7 @@ provenance-run-crate:ProvRCComputationalWorkflowRequired a sh:NodeShape ;
3942
) ;
4043
sh:minCount 1 ;
4144
sh:message "ComputationalWorkflow MUST refer to orchestrated tools via hasPart" ;
45+
sh:severity sh:Violation ;
4246
] ;
4347
sh:property [
4448
a sh:PropertyShape ;
@@ -47,6 +51,7 @@ provenance-run-crate:ProvRCComputationalWorkflowRequired a sh:NodeShape ;
4751
sh:path wfrun:connection ;
4852
sh:class wfrun:ParameterConnection ;
4953
sh:message "If the ComputationalWorkflow has a connection, it must point to a ParameterConnection" ;
54+
sh:severity sh:Violation ;
5055
] .
5156

5257

@@ -73,4 +78,68 @@ provenance-run-crate:ProvRCComputationalWorkflowWithSteps a sh:NodeShape ;
7378
sh:hasValue schema:HowTo;
7479
sh:minCount 1 ;
7580
sh:message "A ComputationalWorkflow that links to steps MUST have the HowTo type" ;
81+
sh:severity sh:Violation ;
82+
] .
83+
84+
85+
#=== SHOULD shapes ===#
86+
87+
provenance-run-crate:ProvRCComputationalWorkflowRecommended a sh:NodeShape ;
88+
sh:name "Provenance Run Crate ComputationalWorkflow SHOULD" ;
89+
sh:description "Recommended properties of the Provenance Run Crate ComputationalWorkflow" ;
90+
sh:targetClass bioschemas:ComputationalWorkflow ;
91+
sh:property [
92+
a sh:PropertyShape ;
93+
sh:name "ComputationalWorkflow step" ;
94+
sh:description "ComputationalWorkflow SHOULD refer to HowToStep instances via step" ;
95+
sh:path schema:step ;
96+
sh:class schema:HowToStep ;
97+
sh:minCount 1 ;
98+
sh:message "ComputationalWorkflow SHOULD refer to HowToStep instances via step" ;
99+
sh:severity sh:Warning ;
100+
] .
101+
102+
103+
#=== MAY shapes ===#
104+
105+
provenance-run-crate:ProvRCComputationalWorkflowOptional a sh:NodeShape ;
106+
sh:name "Provenance Run Crate ComputationalWorkflow MAY" ;
107+
sh:description "Optional properties of the Provenance Run Crate ComputationalWorkflow" ;
108+
sh:targetClass bioschemas:ComputationalWorkflow ;
109+
sh:property [
110+
a sh:PropertyShape ;
111+
sh:name "ComputationalWorkflow connection" ;
112+
sh:description "ComputationalWorkflow may have a connection property" ;
113+
sh:path wfrun:connection ;
114+
sh:minCount 1 ;
115+
sh:message "ComputationalWorkflow may have a connection property" ;
116+
sh:severity sh:Info ;
76117
] .
118+
119+
120+
provenance-run-crate:ProvRCComputationalWorkflowHowToOptional a sh:NodeShape ;
121+
sh:name "Provenance Run Crate ComputationalWorkflow / HowTo MAY" ;
122+
sh:description "Optional properties of a Provenance Run Crate ComputationalWorkflow that is also a HowTo" ;
123+
sh:target [
124+
a sh:SPARQLTarget ;
125+
sh:prefixes ro-crate:sparqlPrefixes ;
126+
sh:select """
127+
SELECT ?this
128+
WHERE {
129+
?this a bioschemas:ComputationalWorkflow .
130+
?this a schema:HowTo .
131+
}
132+
"""
133+
] ;
134+
sh:property [
135+
a sh:PropertyShape ;
136+
sh:name "ComputationalWorkflow buildInstructions" ;
137+
sh:description "A ComputationalWorkflow / HowTo MAY have a buildInstructions pointing to a File" ;
138+
sh:path codemeta:buildInstructions ;
139+
sh:class schema:MediaObject ;
140+
sh:minCount 1 ;
141+
sh:message "A ComputationalWorkflow / HowTo MAY have a buildInstructions pointing to a File" ;
142+
sh:severity sh:Info ;
143+
] .
144+
145+

rocrate_validator/profiles/provenance-run-crate/may/0_tool.ttl renamed to rocrate_validator/profiles/provenance-run-crate/0_tool.ttl

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,85 @@
2222
@prefix sh: <http://www.w3.org/ns/shacl#> .
2323
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .
2424

25+
26+
#=== MUST shapes ===#
27+
28+
provenance-run-crate:ProvRCToolRequired a sh:NodeShape ;
29+
sh:name "ProvRC tool MUST" ;
30+
sh:description "Required properties of a Provenance Run Crate tool" ;
31+
sh:target [
32+
a sh:SPARQLTarget ;
33+
sh:prefixes ro-crate:sparqlPrefixes ;
34+
sh:select """
35+
SELECT ?this
36+
WHERE {
37+
{ ?this a schema:SoftwareApplication } UNION
38+
{ ?this a schema:SoftwareSourceCode } UNION
39+
{ ?this a bioschemas:ComputationalWorkflow } .
40+
?workflow schema:hasPart ?this .
41+
?workflow a bioschemas:ComputationalWorkflow .
42+
}
43+
"""
44+
] ;
45+
sh:property [
46+
a sh:PropertyShape ;
47+
sh:name "tool input and output" ;
48+
sh:description "Tool input and output MUST point to FormalParameter entities" ;
49+
sh:path [
50+
sh:alternativePath (bioschemas-cw:input bioschemas-cw:output) ;
51+
] ;
52+
sh:class bioschemas:FormalParameter ;
53+
sh:message "Tool input and output MUST point to FormalParameter entities" ;
54+
sh:severity sh:Violation ;
55+
] ;
56+
sh:property [
57+
a sh:PropertyShape ;
58+
sh:name "Tool inverse instrument" ;
59+
sh:description "A tool must be referred to from an action via instrument" ;
60+
sh:path [ sh:inversePath schema:instrument ] ;
61+
sh:or (
62+
[ sh:class schema:CreateAction ; ]
63+
[ sh:class schema:ActivateAction ; ]
64+
[ sh:class schema:UpdateAction ; ]
65+
) ;
66+
sh:minCount 1 ;
67+
sh:message "A tool must be referred to from an action via instrument" ;
68+
sh:severity sh:Violation ;
69+
] .
70+
71+
72+
#=== SHOULD shapes ===#
73+
74+
provenance-run-crate:ProvRCToolRecommended a sh:NodeShape ;
75+
sh:name "ProvRC tool SHOULD" ;
76+
sh:description "Recommended properties of a Provenance Run Crate tool" ;
77+
sh:target [
78+
a sh:SPARQLTarget ;
79+
sh:prefixes ro-crate:sparqlPrefixes ;
80+
sh:select """
81+
SELECT ?this
82+
WHERE {
83+
{ ?this a schema:SoftwareApplication } UNION
84+
{ ?this a schema:SoftwareSourceCode } UNION
85+
{ ?this a bioschemas:ComputationalWorkflow } .
86+
?workflow schema:hasPart ?this .
87+
?workflow a bioschemas:ComputationalWorkflow .
88+
}
89+
"""
90+
] ;
91+
sh:property [
92+
a sh:PropertyShape ;
93+
sh:name "tool environment" ;
94+
sh:description "If the tool has an environment, it SHOULD point to entities of type FormalParameter" ;
95+
sh:path wfrun:environment ;
96+
sh:class bioschemas:FormalParameter ;
97+
sh:message "If the tool has an environment, it SHOULD point to entities of type FormalParameter" ;
98+
sh:severity sh:Warning ;
99+
] .
100+
101+
102+
#=== MAY shapes ===#
103+
25104
provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
26105
sh:name "ProvRC tool MAY" ;
27106
sh:description "Optional properties of a Provenance Run Crate tool" ;
@@ -46,6 +125,7 @@ provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
46125
sh:path bioschemas-cw:input ;
47126
sh:minCount 1 ;
48127
sh:message "A tool MAY have an input" ;
128+
sh:severity sh:Info ;
49129
] ;
50130
sh:property [
51131
a sh:PropertyShape ;
@@ -54,6 +134,7 @@ provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
54134
sh:path bioschemas-cw:output ;
55135
sh:minCount 1 ;
56136
sh:message "A tool MAY have an output" ;
137+
sh:severity sh:Info ;
57138
] ;
58139
sh:property [
59140
a sh:PropertyShape ;
@@ -62,6 +143,7 @@ provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
62143
sh:path wfrun:environment ;
63144
sh:minCount 1 ;
64145
sh:message "A tool MAY have an environment" ;
146+
sh:severity sh:Info ;
65147
] ;
66148
sh:property [
67149
a sh:PropertyShape ;
@@ -71,6 +153,7 @@ provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
71153
sh:path schema:softwareRequirements ;
72154
sh:class schema:SoftwareApplication ;
73155
sh:minCount 1 ;
156+
sh:severity sh:Info ;
74157
] ;
75158
sh:property [
76159
a sh:PropertyShape ;
@@ -80,4 +163,6 @@ provenance-run-crate:ProvRCToolOptional a sh:NodeShape ;
80163
sh:path schema:mainEntity ;
81164
sh:class schema:SoftwareApplication ;
82165
sh:minCount 1 ;
166+
sh:severity sh:Info ;
83167
] .
168+

rocrate_validator/profiles/provenance-run-crate/must/1_howtostep.ttl renamed to rocrate_validator/profiles/provenance-run-crate/1_howtostep.ttl

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .
2525

26+
27+
#=== MUST shapes ===#
28+
2629
provenance-run-crate:ProvRCHowToStepRequired a sh:NodeShape ;
2730
sh:name "ProvRC HowToStep MUST" ;
2831
sh:description "Required properties of a Provenance Run Crate HowToStep" ;
@@ -48,6 +51,7 @@ provenance-run-crate:ProvRCHowToStepRequired a sh:NodeShape ;
4851
) ;
4952
sh:minCount 1 ;
5053
sh:message "A HowToStep must refer to its corresponding tool via workExample" ;
54+
sh:severity sh:Violation ;
5155
] ;
5256
sh:property [
5357
a sh:PropertyShape ;
@@ -60,6 +64,7 @@ provenance-run-crate:ProvRCHowToStepRequired a sh:NodeShape ;
6064
) ;
6165
sh:pattern "\\d+" ;
6266
sh:message "If specified, position must be a string representing an integer" ;
67+
sh:severity sh:Violation ;
6368
] ;
6469
sh:property [
6570
a sh:PropertyShape ;
@@ -68,4 +73,45 @@ provenance-run-crate:ProvRCHowToStepRequired a sh:NodeShape ;
6873
sh:path wfrun:connection ;
6974
sh:class wfrun:ParameterConnection ;
7075
sh:message "If the HowToStep has a connection, it must point to a ParameterConnection" ;
76+
sh:severity sh:Violation ;
7177
] .
78+
79+
#=== SHOULD shapes ===#
80+
# (none)
81+
82+
83+
#=== MAY shapes ===#
84+
85+
provenance-run-crate:ProvRCHowToStepOptional a sh:NodeShape ;
86+
sh:name "ProvRC HowToStep MAY" ;
87+
sh:description "Optional properties of a Provenance Run Crate HowToStep" ;
88+
sh:targetClass schema:HowToStep ;
89+
sh:property [
90+
a sh:PropertyShape ;
91+
sh:name "HowToStep position" ;
92+
sh:description "A HowToStep may indicate its position in the execution order via position" ;
93+
sh:path schema:position ;
94+
sh:minCount 1 ;
95+
sh:message "A HowToStep may indicate its position in the execution order via position" ;
96+
sh:severity sh:Info ;
97+
] ;
98+
sh:property [
99+
a sh:PropertyShape ;
100+
sh:name "HowToStep connection" ;
101+
sh:description "HowToStep may have a connection property" ;
102+
sh:path wfrun:connection ;
103+
sh:minCount 1 ;
104+
sh:message "HowToStep may have a connection property" ;
105+
sh:severity sh:Info ;
106+
] ;
107+
sh:property [
108+
a sh:PropertyShape ;
109+
sh:name "HowToStep buildInstructions" ;
110+
sh:description "A HowToStep MAY have a buildInstructions pointing to a File" ;
111+
sh:path codemeta:buildInstructions ;
112+
sh:class schema:MediaObject ;
113+
sh:minCount 1 ;
114+
sh:message "A HowToStep MAY have a buildInstructions pointing to a File" ;
115+
sh:severity sh:Info ;
116+
] .
117+

rocrate_validator/profiles/provenance-run-crate/must/1_tool_action.ttl renamed to rocrate_validator/profiles/provenance-run-crate/1_tool_action.ttl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
@prefix sh: <http://www.w3.org/ns/shacl#> .
2121
@prefix wfrun: <https://w3id.org/ro/terms/workflow-run#> .
2222

23+
24+
#=== MUST shapes ===#
25+
2326
provenance-run-crate:ProvRCToolActionRequired a sh:NodeShape ;
2427
sh:name "Provenance Run Crate tool action MUST" ;
2528
sh:description "Required properties of a Provenance Run Crate action that represents a tool execution" ;
@@ -48,4 +51,43 @@ provenance-run-crate:ProvRCToolActionRequired a sh:NodeShape ;
4851
sh:path wfrun:resourceUsage ;
4952
sh:class schema:PropertyValue ;
5053
sh:message "If present, resourceUsage MUST point to PropertyValue" ;
54+
sh:severity sh:Violation ;
55+
] .
56+
57+
58+
#=== SHOULD shapes ===#
59+
# (none)
60+
61+
62+
#=== MAY shapes ===#
63+
64+
provenance-run-crate:ProvRCToolActionOptional a sh:NodeShape ;
65+
sh:name "Provenance Run Crate tool action MAY" ;
66+
sh:description "Optional properties of a Provenance Run Crate action that represents a tool execution" ;
67+
sh:target [
68+
a sh:SPARQLTarget ;
69+
sh:prefixes ro-crate:sparqlPrefixes ;
70+
sh:select """
71+
SELECT ?this
72+
WHERE {
73+
{ ?this a schema:CreateAction } UNION
74+
{ ?this a schema:ActivateAction } UNION
75+
{ ?this a schema:UpdateAction } .
76+
?this schema:instrument ?tool .
77+
{ ?tool a schema:SoftwareApplication } UNION
78+
{ ?tool a schema:SoftwareSourceCode } UNION
79+
{ ?tool a bioschemas:ComputationalWorkflow } .
80+
?workflow schema:hasPart ?tool .
81+
?workflow a bioschemas:ComputationalWorkflow .
82+
}
83+
"""
84+
] ;
85+
sh:property [
86+
a sh:PropertyShape ;
87+
sh:name "Tool action resourceUsage" ;
88+
sh:description "A tool action MAY have a resourceUsage" ;
89+
sh:path wfrun:resourceUsage ;
90+
sh:minCount 1 ;
91+
sh:message "A tool action MAY have a resourceUsage" ;
92+
sh:severity sh:Info ;
5193
] .

rocrate_validator/profiles/provenance-run-crate/should/2_root_data_entity_metadata.ttl renamed to rocrate_validator/profiles/provenance-run-crate/2_root_data_entity_metadata.ttl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,32 @@
1919
@prefix sh: <http://www.w3.org/ns/shacl#> .
2020
@prefix provenance-run-crate: <https://github.com/crs4/rocrate-validator/profiles/provenance-run-crate/> .
2121

22+
23+
#=== MUST shapes ===#
24+
25+
provenance-run-crate:ProvRCRootDataEntityMetadata a sh:NodeShape ;
26+
sh:name "Provenance Run Crate Root Data Entity" ;
27+
sh:description "Properties of the Provenance Run Crate Root Data Entity" ;
28+
sh:targetClass ro-crate:RootDataEntity ;
29+
sh:property [
30+
a sh:PropertyShape ;
31+
sh:name "Root Data Entity conformsTo" ;
32+
sh:description "The Root Data Entity MUST reference a CreativeWork entity with an @id URI that is consistent with the versioned permalink of the Provenance Run Crate profile" ;
33+
sh:path dct:conformsTo ;
34+
sh:class schema:CreativeWork;
35+
# At least one value of conformsTo must match the pattern
36+
sh:qualifiedValueShape [
37+
sh:pattern "^https://w3id.org/ro/wfrun/provenance/.*" ;
38+
] ;
39+
sh:qualifiedMinCount 1 ;
40+
sh:minCount 1 ;
41+
sh:message "The Root Data Entity MUST reference a CreativeWork entity with an @id URI that is consistent with the versioned permalink of the Provenance Run Crate profile" ;
42+
sh:severity sh:Violation ;
43+
] .
44+
45+
46+
#=== SHOULD shapes ===#
47+
2248
provenance-run-crate:ProvRCRootDataEntityRecommended a sh:NodeShape ;
2349
sh:name "Provenance Run Crate Root Data Entity SHOULD" ;
2450
sh:description "Recommended Properties of the Provenance Run Crate Root Data Entity" ;
@@ -36,4 +62,8 @@ provenance-run-crate:ProvRCRootDataEntityRecommended a sh:NodeShape ;
3662
sh:qualifiedMinCount 3 ;
3763
sh:minCount 1 ;
3864
sh:message "The Root Data Entity SHOULD reference CreativeWork entities corresponding to the Process Run Crate, Workflow Run Crate and Workflow RO-Crate profiles" ;
65+
sh:severity sh:Warning ;
3966
] .
67+
68+
#=== MAY shapes ===#
69+
# (none)

0 commit comments

Comments
 (0)