@@ -100,14 +100,8 @@ Note: This section is non-normative.
100
100
The above syntax in the CWL specifications means there are two or more ways to write the given value.
101
101
102
102
Option one is a array and is the most verbose option.
103
- In our example here we use the generic` ComplexType ` , but
104
- in reality it would be one of ` InputRecordField ` , ` OutputRecordField ` ,
105
- ` CommandInputRecordField ` , ` SoftwarePackage ` , ` CommandInputParameter ` ,
106
- ` CommandOutputParamter ` , ` EnvironmentDef ` , ` WorkflowStepInput ` ,
107
- ` WorkflowInputParameter ` , ` WorkflowOutputParameter ` , ` WorkflowStep ` ,
108
- ` ExpressionToolOutputParameter ` , or a specific ` *Requirement ` entry.
109
-
110
- A generic example:
103
+
104
+ Option one generic example:
111
105
```
112
106
some_cwl_field:
113
107
- key_field: a_complex_type1
@@ -119,7 +113,7 @@ some_cwl_field:
119
113
- key_field: a_complex_type3
120
114
```
121
115
122
- A specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
116
+ Option one specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
123
117
> array< ; InputParameter> ; |
124
118
> map< ; ` id ` , ` type ` | InputParameter> ;
125
119
@@ -131,7 +125,6 @@ inputs:
131
125
- id: workflow_input02
132
126
type: File
133
127
format: http://edamontology.org/format_2572
134
- - id: workflow_input03
135
128
```
136
129
137
130
Option two is enabled by the ` map<…> ` syntax. Instead of an array of entries we
@@ -141,7 +134,7 @@ without the key field. If all of the other fields of the `ComplexType` are
141
134
optional and unneeded, then we can indicate this with an empty mapping as the
142
135
value: ` a_complex_type3: {} `
143
136
144
- A generic example:
137
+ Option two generic example:
145
138
```
146
139
some_cwl_field:
147
140
a_complex_type1: # this was the "key_field" from above
@@ -153,7 +146,7 @@ some_cwl_field:
153
146
a_complex_type3: {} # we accept the defualt values for "field2" and "field3"
154
147
```
155
148
156
- A specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
149
+ Option two specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
157
150
> array< ; InputParameter> ; |
158
151
> map< ; ` id ` , ` type ` | InputParameter> ;
159
152
@@ -165,9 +158,24 @@ inputs:
165
158
workflow_input02:
166
159
type: File
167
160
format: http://edamontology.org/format_2572
168
- workflow_input03: {} # we accept the default value for "type"
169
161
```
170
162
163
+ Option two specific example using [ SoftwareRequirement] ( #SoftwareRequirement ) .[ packages] ( #SoftwarePackage ) :
164
+ > array< ; SoftwarePackage> ; |
165
+ > map< ; ` package ` , ` specs ` | SoftwarePackage> ;
166
+
167
+
168
+ ```
169
+ hints:
170
+ SoftwareRequirement:
171
+ packages:
172
+ sourmash:
173
+ specs: [ https://doi.org/10.21105/joss.00027 ]
174
+ screed:
175
+ version: [ "1.0" ]
176
+ python: {}
177
+ ```
178
+ `
171
179
Sometimes we have a third and even more compact option denoted like this:
172
180
> type: array< ; ComplexType> ; |
173
181
> map< ; ` key_field ` , ` field2 ` | ComplexType> ;
@@ -176,15 +184,15 @@ For this example, if we only need the `key_field` and `field2` when specifying
176
184
our ` ComplexType ` s (because the other fields are optional and we are fine with
177
185
their default values) then we can abbreviate.
178
186
179
- A generic example:
187
+ Option three generic example:
180
188
```
181
189
some_cwl_field:
182
190
a_complex_type1: foo # we accept the default value for field3
183
191
a_complex_type2: foo2 # we accept the default value for field3
184
- a_complex_type3: {} # we accept the defualt values for "field2" and "field3"
192
+ a_complex_type3: {} # we accept the default values for "field2" and "field3"
185
193
```
186
194
187
- A specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
195
+ Option three specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
188
196
> array< ; InputParameter> ; |
189
197
> map< ; ` id ` , ` type ` | InputParameter> ;
190
198
@@ -193,13 +201,25 @@ A specific example using [Workflow](Workflow.html#Workflow).[inputs](Workflow.ht
193
201
inputs:
194
202
workflow_input01: string
195
203
workflow_input02: File # we accept the default of no File format
196
- workflow_input03: {} # we accept the default of no "type"
204
+ ```
205
+
206
+ Option three specific example using [ SoftwareRequirement] ( #SoftwareRequirement ) .[ packages] ( #SoftwarePackage ) :
207
+ > array< ; SoftwarePackage> ; |
208
+ > map< ; ` package ` , ` specs ` | SoftwarePackage> ;
209
+
210
+
211
+ ```
212
+ hints:
213
+ SoftwareRequirement:
214
+ packages:
215
+ sourmash: [ https://doi.org/10.21105/joss.00027 ]
216
+ python: {}
197
217
```
198
218
199
219
200
220
What if some entries we want to mix the option 2 and 3? You can!
201
221
202
- A generic example:
222
+ Mixed option 2 and 3 generic example:
203
223
```
204
224
some_cwl_field:
205
225
my_complex_type1: foo # we accept the default value for field3
@@ -211,7 +231,7 @@ some_cwl_field:
211
231
# "field2" and "field3"
212
232
```
213
233
214
- A specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
234
+ Mixed option 2 and 3 specific example using [ Workflow] ( Workflow.html#Workflow ) .[ inputs] ( Workflow.html#WorkflowInputParameter ) :
215
235
> array< ; InputParameter> ; |
216
236
> map< ; ` id ` , ` type ` | InputParameter> ;
217
237
@@ -227,6 +247,21 @@ inputs:
227
247
# examples
228
248
```
229
249
250
+ Mixed option 2 and 3 specific example using [ SoftwareRequirement] ( #SoftwareRequirement ) .[ packages] ( #SoftwarePackage ) :
251
+ > array< ; SoftwarePackage> ; |
252
+ > map< ; ` package ` , ` specs ` | SoftwarePackage> ;
253
+
254
+
255
+ ```
256
+ hints:
257
+ SoftwareRequirement:
258
+ packages:
259
+ sourmash: [ https://doi.org/10.21105/joss.00027 ]
260
+ screed:
261
+ specs: [ https://github.com/dib-lab/screed ]
262
+ version: [ "1.0" ]
263
+ python: {}
264
+ ```
230
265
231
266
Note: The ` map<…> ` (compact) versions are optional, the verbose option #1 is
232
267
always allowed, but for presentation reasons option 3 and 2 may be preferred
0 commit comments