@@ -237,7 +237,9 @@ $graph:
237
237
- " null"
238
238
- type : array
239
239
items : [File, Directory]
240
- jsonldPredicate : " cwl:secondaryFiles"
240
+ jsonldPredicate :
241
+ _id : " cwl:secondaryFiles"
242
+ secondaryFilesDSL : true
241
243
doc : |
242
244
A list of additional files or directories that are associated with the
243
245
primary file and must be transferred alongside the primary file.
@@ -458,20 +460,25 @@ $graph:
458
460
secondaryFiles :
459
461
type :
460
462
- " null"
461
- - string
462
- - Expression
463
+ - SecondaryFileSchema
463
464
- type : array
464
- items : [string, Expression]
465
- jsonldPredicate : " cwl:secondaryFiles"
465
+ items : SecondaryFileSchema
466
+ jsonldPredicate :
467
+ _id : " cwl:secondaryFiles"
468
+ secondaryFilesDSL : true
466
469
doc : |
467
470
Only valid when `type: File` or is an array of `items: File`.
468
471
469
- Provides a pattern or expression specifying files or directories that
470
- must be included alongside the primary file. An implementation must append
471
- these files/directories to the `secondaryFiles` property of the primary file.
472
- These files/directories must be transferred alongside the primary file.
473
- An implementation may fail workflow execution if an expected secondary file
474
- does not exist.
472
+ Provides a pattern or expression specifying files or
473
+ directories that should be included alongside the primary
474
+ file. Secondary files may be required or optional. When not
475
+ explicitly specified, secondary files specified for `inputs`
476
+ are required and `outputs` are optional. An implementation
477
+ must include matching Files and Directories in the
478
+ `secondaryFiles` property of the primary file. These Files
479
+ and Directories must be transferred and staged alongside the
480
+ primary file. An implementation may fail workflow execution
481
+ if a required secondary file does not exist.
475
482
476
483
If the value is an expression, the value of `self` in the expression
477
484
must be the primary input or output File object to which this binding
@@ -482,6 +489,8 @@ $graph:
482
489
`path` or `location` and `basename` fields set, or an array consisting
483
490
of strings or File or Directory objects. It is legal to reference an
484
491
unchanged File or Directory object taken from input as a secondaryFile.
492
+ The expression may return "null" in which case there is no secondaryFile
493
+ from that expression.
485
494
486
495
To work on non-filename-preserving storage systems, portable tool
487
496
descriptions should avoid constructing new values from `location`, but
@@ -492,11 +501,13 @@ $graph:
492
501
it specifies that the following pattern should be applied to the path
493
502
of the primary file to yield a filename relative to the primary File:
494
503
495
- 1. If string begins with one or more caret `^` characters, for each
504
+ 1. If string ends with `?` character, remove the last `?` and mark
505
+ the resulting secondary file as optional.
506
+ 2. If string begins with one or more caret `^` characters, for each
496
507
caret, remove the last file extension from the path (the last
497
508
period `.` and all following characters). If there are no file
498
509
extensions, the path is unchanged.
499
- 2 . Append the remainder of the string to the end of the file path.
510
+ 3 . Append the remainder of the string to the end of the file path.
500
511
501
512
streamable :
502
513
type : boolean?
@@ -856,3 +867,50 @@ $graph:
856
867
type : array
857
868
items : CommandInputSchema
858
869
doc : The list of type definitions.
870
+
871
+ - name : SecondaryFileSchema
872
+ type : record
873
+ fields :
874
+ - name : pattern
875
+ type :
876
+ - string
877
+ - Expression
878
+ doc : |
879
+ Provides a pattern or expression specifying files or directories that
880
+ should be included alongside the primary file.
881
+
882
+ If the value is an expression, the value of `self` in the expression
883
+ must be the primary input or output File object to which this binding
884
+ applies. The `basename`, `nameroot` and `nameext` fields must be
885
+ present in `self`. For `CommandLineTool` outputs the `path` field must
886
+ also be present. The expression must return a filename string relative
887
+ to the path to the primary File, a File or Directory object with either
888
+ `path` or `location` and `basename` fields set, or an array consisting
889
+ of strings or File or Directory objects. It is legal to reference an
890
+ unchanged File or Directory object taken from input as a secondaryFile.
891
+ The expression may return "null" in which case there is no secondaryFile
892
+ from that expression.
893
+
894
+ To work on non-filename-preserving storage systems, portable tool
895
+ descriptions should avoid constructing new values from `location`, but
896
+ should construct relative references using `basename` or `nameroot`
897
+ instead.
898
+
899
+ If a value in `secondaryFiles` is a string that is not an expression,
900
+ it specifies that the following pattern should be applied to the path
901
+ of the primary file to yield a filename relative to the primary File:
902
+
903
+ 1. If string begins with one or more caret `^` characters, for each
904
+ caret, remove the last file extension from the path (the last
905
+ period `.` and all following characters). If there are no file
906
+ extensions, the path is unchanged.
907
+ 2. If string ends with `?` character, remove the last `?` and mark
908
+ the resulting secondary file as optional.
909
+ 3. Append the remainder of the string to the end of the file path.
910
+ - name : required
911
+ type : ["null", boolean, string, Expression]
912
+ doc : |
913
+ An implementation must not fail workflow execution if `required` is
914
+ set to `false` and the expected secondary file does not exist.
915
+ Default value for `required` field is `true` for secondary files on
916
+ input and `false` for secondary files on output.
0 commit comments