Skip to content

Commit 7c02afb

Browse files
committed
better examples
1 parent bad80ac commit 7c02afb

File tree

3 files changed

+56
-21
lines changed

3 files changed

+56
-21
lines changed

CommandLineTool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ $graph:
100100
* [Added](#LoadListingRequirement) `LoadListingRequirement`
101101
and [loadListing](#LoadContents) to control whether and how
102102
`Directory` listings should be loaded for use in expressions.
103-
* [Better explain](#map) the `map<…>` notation that has existing since v1.0.
103+
* [Better explain](#map) the `map<…>` notation that has existed since v1.0.
104104
* Fixed schema error where the `type` field inside the `inputs` and
105105
`outputs` field was incorrectly listed as optional.
106106

Workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ $graph:
8787
* [Added](#LoadListingRequirement) `LoadListingRequirement`
8888
and [loadListing](#LoadContents) to control whether and how
8989
`Directory` listings should be loaded for use in expressions.
90-
* [Better explain](#map) the `map<…>` notation that has existing since v1.0.
90+
* [Better explain](#map) the `map<…>` notation that has existed since v1.0.
9191
* Fixed schema error where the `type` field inside the `inputs` and
9292
`outputs` fields for both `Workflow` and `ExpressionTool` was
9393
incorrectly listed as optional.

concepts.md

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,8 @@ Note: This section is non-normative.
100100
The above syntax in the CWL specifications means there are two or more ways to write the given value.
101101

102102
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:
111105
```
112106
some_cwl_field:
113107
- key_field: a_complex_type1
@@ -119,7 +113,7 @@ some_cwl_field:
119113
- key_field: a_complex_type3
120114
```
121115

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):
123117
> array&lt;InputParameter&gt; |
124118
> map&lt;`id`, `type` | InputParameter&gt;
125119
@@ -131,7 +125,6 @@ inputs:
131125
- id: workflow_input02
132126
type: File
133127
format: http://edamontology.org/format_2572
134-
- id: workflow_input03
135128
```
136129

137130
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
141134
optional and unneeded, then we can indicate this with an empty mapping as the
142135
value: `a_complex_type3: {}`
143136

144-
A generic example:
137+
Option two generic example:
145138
```
146139
some_cwl_field:
147140
a_complex_type1: # this was the "key_field" from above
@@ -153,7 +146,7 @@ some_cwl_field:
153146
a_complex_type3: {} # we accept the defualt values for "field2" and "field3"
154147
```
155148

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):
157150
> array&lt;InputParameter&gt; |
158151
> map&lt;`id`, `type` | InputParameter&gt;
159152
@@ -165,9 +158,24 @@ inputs:
165158
workflow_input02:
166159
type: File
167160
format: http://edamontology.org/format_2572
168-
workflow_input03: {} # we accept the default value for "type"
169161
```
170162

163+
Option two specific example using [SoftwareRequirement](#SoftwareRequirement).[packages](#SoftwarePackage):
164+
> array&lt;SoftwarePackage&gt; |
165+
> map&lt;`package`, `specs` | SoftwarePackage&gt;
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+
`
171179
Sometimes we have a third and even more compact option denoted like this:
172180
> type: array&lt;ComplexType&gt; |
173181
> map&lt;`key_field`, `field2` | ComplexType&gt;
@@ -176,15 +184,15 @@ For this example, if we only need the `key_field` and `field2` when specifying
176184
our `ComplexType`s (because the other fields are optional and we are fine with
177185
their default values) then we can abbreviate.
178186

179-
A generic example:
187+
Option three generic example:
180188
```
181189
some_cwl_field:
182190
a_complex_type1: foo # we accept the default value for field3
183191
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"
185193
```
186194

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):
188196
> array&lt;InputParameter&gt; |
189197
> map&lt;`id`, `type` | InputParameter&gt;
190198
@@ -193,13 +201,25 @@ A specific example using [Workflow](Workflow.html#Workflow).[inputs](Workflow.ht
193201
inputs:
194202
workflow_input01: string
195203
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&lt;SoftwarePackage&gt; |
208+
> map&lt;`package`, `specs` | SoftwarePackage&gt;
209+
210+
211+
```
212+
hints:
213+
SoftwareRequirement:
214+
packages:
215+
sourmash: [ https://doi.org/10.21105/joss.00027 ]
216+
python: {}
197217
```
198218

199219

200220
What if some entries we want to mix the option 2 and 3? You can!
201221

202-
A generic example:
222+
Mixed option 2 and 3 generic example:
203223
```
204224
some_cwl_field:
205225
my_complex_type1: foo # we accept the default value for field3
@@ -211,7 +231,7 @@ some_cwl_field:
211231
# "field2" and "field3"
212232
```
213233

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):
215235
> array&lt;InputParameter&gt; |
216236
> map&lt;`id`, `type` | InputParameter&gt;
217237
@@ -227,6 +247,21 @@ inputs:
227247
# examples
228248
```
229249

250+
Mixed option 2 and 3 specific example using [SoftwareRequirement](#SoftwareRequirement).[packages](#SoftwarePackage):
251+
> array&lt;SoftwarePackage&gt; |
252+
> map&lt;`package`, `specs` | SoftwarePackage&gt;
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+
```
230265

231266
Note: The `map<…>` (compact) versions are optional, the verbose option #1 is
232267
always allowed, but for presentation reasons option 3 and 2 may be preferred

0 commit comments

Comments
 (0)