@@ -91,14 +91,13 @@ An implementation may formally validate the structure of a CWL document using
91
91
SALAD schemas located at
92
92
https://github.com/common-workflow-language/common-workflow-language/tree/master/v1.1.0-dev1
93
93
94
- ### < a name = " map " > ` map<> ` </ a >
94
+ ### map
95
95
96
96
Note: This section is non-normative.
97
+ > type: array< ; ComplexType> ; |
98
+ > map< ; ` key_field ` , ComplexType> ;
97
99
98
- The
99
- > type: array<ComplexType > |
100
- > map<` key_field ` , ComplexType>
101
- syntax in the CWL specifications means there are two or more ways to write the given value.
100
+ The above syntax in the CWL specifications means there are two or more ways to write the given value.
102
101
103
102
Option one is a array and is the most verbose option.
104
103
In our example here we use the generic` ComplexType ` , but
@@ -108,7 +107,7 @@ in reality it would be one of `InputRecordField`, `OutputRecordField`,
108
107
` WorkflowInputParameter ` , ` WorkflowOutputParameter ` , ` WorkflowStep ` ,
109
108
` ExpressionToolOutputParameter ` , or a specific ` *Requirement ` entry.
110
109
111
- Generic example:
110
+ A generic example:
112
111
```
113
112
some_cwl_field:
114
113
- key_field: a_complex_type1
@@ -120,9 +119,9 @@ some_cwl_field:
120
119
- key_field: a_complex_type3
121
120
```
122
121
123
- Specific example using [ Workflow. inputs] ( Workflow.html#InputParameter ) :
124
- > array< InputParameter > |
125
- > map< ` id ` , ` type ` | InputParameter>
122
+ A specific example using [ Workflow] ( Workflow.html#Workflow ) . [ inputs] ( Workflow.html#WorkflowInputParameter ) :
123
+ > array& lt ; InputParameter& gt ; |
124
+ > map& lt ; ` id ` , ` type ` | InputParameter& gt ;
126
125
127
126
128
127
```
@@ -142,7 +141,7 @@ without the key field. If all of the other fields of the `ComplexType` are
142
141
optional and unneeded, then we can indicate this with an empty mapping as the
143
142
value: ` a_complex_type3: {} `
144
143
145
- Generic example:
144
+ A generic example:
146
145
```
147
146
some_cwl_field:
148
147
a_complex_type1: # this was the "key_field" from above
@@ -154,9 +153,9 @@ some_cwl_field:
154
153
a_complex_type3: {} # we accept the defualt values for "field2" and "field3"
155
154
```
156
155
157
- Specific example using [ Workflow. inputs] ( Workflow.html#InputParameter ) :
158
- > array< InputParameter > |
159
- > map< ` id ` , ` type ` | InputParameter>
156
+ A specific example using [ Workflow] ( Workflow.html#Workflow ) . [ inputs] ( Workflow.html#WorkflowInputParameter ) :
157
+ > array& lt ; InputParameter& gt ; |
158
+ > map& lt ; ` id ` , ` type ` | InputParameter& gt ;
160
159
161
160
162
161
```
@@ -170,23 +169,24 @@ inputs:
170
169
```
171
170
172
171
Sometimes we have a third and even more compact option denoted like this:
173
- "type: ` array<ComplexType> | map<key_field, field2 | ComplexType> ` "
172
+ > type: array< ; ComplexType> ; |
173
+ > map< ; ` key_field ` , ` field2 ` | ComplexType> ;
174
174
175
175
For this example, if we only need the ` key_field ` and ` field2 ` when specifying
176
176
our ` ComplexType ` s (because the other fields are optional and we are fine with
177
177
their default values) then we can abbreviate.
178
178
179
- Here's the generic example:
179
+ A generic example:
180
180
```
181
181
some_cwl_field:
182
182
a_complex_type1: foo # we accept the default value for field3
183
183
a_complex_type2: foo2 # we accept the default value for field3
184
184
a_complex_type3: {} # we accept the defualt values for "field2" and "field3"
185
185
```
186
186
187
- Specific example using [ Workflow. inputs] ( Workflow.html#InputParameter ) :
188
- > array< InputParameter > |
189
- > map< ` id ` , ` type ` | InputParameter>
187
+ A specific example using [ Workflow] ( Workflow.html#Workflow ) . [ inputs] ( Workflow.html#WorkflowInputParameter ) :
188
+ > array& lt ; InputParameter& gt ; |
189
+ > map& lt ; ` id ` , ` type ` | InputParameter& gt ;
190
190
191
191
192
192
```
@@ -199,7 +199,7 @@ inputs:
199
199
200
200
What if some entries we want to mix the option 2 and 3? You can!
201
201
202
- Generic example:
202
+ A generic example:
203
203
```
204
204
some_cwl_field:
205
205
my_complex_type1: foo # we accept the default value for field3
@@ -211,9 +211,9 @@ some_cwl_field:
211
211
# "field2" and "field3"
212
212
```
213
213
214
- Specific example using [ Workflow. inputs] ( Workflow.html#InputParameter ) :
215
- > array< InputParameter > |
216
- > map< ` id ` , ` type ` | InputParameter>
214
+ A specific example using [ Workflow] ( Workflow.html#Workflow ) . [ inputs] ( Workflow.html#WorkflowInputParameter ) :
215
+ > array& lt ; InputParameter& gt ; |
216
+ > map& lt ; ` id ` , ` type ` | InputParameter& gt ;
217
217
218
218
219
219
```
@@ -228,8 +228,9 @@ inputs:
228
228
```
229
229
230
230
231
- Note: The ` map<…> ` version is optional, the verbose option #1 is always allowed,
232
- but for presentation reasons option 3 and 2 may be preferred by human readers.
231
+ Note: The ` map<…> ` (compact) versions are optional, the verbose option #1 is
232
+ always allowed, but for presentation reasons option 3 and 2 may be preferred
233
+ by human readers.
233
234
234
235
The normative explanation for these variations, aimed at implementors, is in the
235
236
[ Schema Salad specification] ( SchemaSalad.html#Identifier_maps ) .
0 commit comments