@@ -65,7 +65,7 @@ $graph:
6565 _type : " @vocab"
6666 doc : Must be `File` to indicate this object describes a file.
6767 - name : location
68- type : string
68+ type : string?
6969 doc : |
7070 A URI that identifies the file resource. This may be a relative
7171 reference, in which case it must be resolved using the base URI of the
@@ -75,6 +75,10 @@ $graph:
7575 remote resource (due to unsupported protocol, access denied, or other
7676 issue) it must signal an error.
7777
78+ If the `location' field is not provided, the `contents` field must be
79+ provided. The implementation must assign a unique identifier for
80+ the `location` field.
81+
7882 If the `path` field is provided but the `location` field is not, an
7983 implementation may assign the value of the `path` field to `location`,
8084 then follow the rules above.
@@ -84,24 +88,34 @@ $graph:
8488 - name : path
8589 type : string?
8690 doc : |
87- The local path where the File is made available prior to executing a
88- CommandLineTool. This must be set by the implementation. This field
91+ The local host path where the File is available when a CommandLineTool is
92+ executed. This field must be set by the implementation. The final
93+ path component must match the value of `basename`. This field
8994 must not be used in any other context. The command line tool being
9095 executed must be able to to access the file at `path` using the POSIX
9196 `open(2)` syscall.
97+
98+ As a special case, if the `path` field is provided but the `location`
99+ field is not, an implementation may assign the value of the `path`
100+ field to `location`, and remove the `path` field.
92101 jsonldPredicate :
93102 " _id " : " cwl:path"
94103 " _type " : " @id"
95104 - name : basename
96105 type : string?
97106 doc : |
98- The base name of the file, that is, the path component following the
99- final slash in the path.
100-
101- The implementation must set this field based on the value of `path`
102- prior to evaluating parameter references or expressions in a
103- CommandLineTool document. This field must not be used in any other
104- context.
107+ The base name of the file, that is, the name of the file without any
108+ leading directory path. The base name must not contain a slash `/`.
109+
110+ If not provided, the implementation must set this field based on the
111+ `location` field by taking the final path component after parsing
112+ `location` as an IRI. If `basename` is provided, it is not required to
113+ match the value from `location`.
114+
115+ When this file is made available to a CommandLineTool, it must be named
116+ with `basename`, i.e. the final component of the `path` field must match
117+ `basename`.
118+ jsonldPredicate : " cwl:basename"
105119 - name : dirname
106120 type : string?
107121 doc : |
@@ -121,10 +135,8 @@ $graph:
121135 period. Leading periods on the basename are ignored; a basename of
122136 `.cshrc` will have a nameroot of `.cshrc`.
123137
124- The implementation must set this field based on the value of `path`
125- prior to evaluating parameter references or expressions in a
126- CommandLineTool document. This field must not be used in any other
127- context.
138+ The implementation must set this field automatically based on the value
139+ of `basename` prior to evaluating parameter references or expressions.
128140 - name : nameext
129141 type : string?
130142 doc : |
@@ -133,10 +145,8 @@ $graph:
133145 period. Leading periods on the basename are ignored; a basename of
134146 `.cshrc` will have an empty `nameext`.
135147
136- The implementation must set this field based on the value of `path`
137- prior to evaluating parameter references or expressions in a
138- CommandLineTool document. This field must not be used in any other
139- context.
148+ The implementation must set this field automatically based on the value
149+ of `basename` prior to evaluating parameter references or expressions.
140150 - name : checksum
141151 type : ["null", string]
142152 doc : |
@@ -149,7 +159,7 @@ $graph:
149159 type :
150160 - " null"
151161 - type : array
152- items : [File, Dirent ]
162+ items : [File, Directory ]
153163 jsonldPredicate : " cwl:secondaryFiles"
154164 doc : |
155165 A list of additional files that are associated with the primary file
@@ -179,26 +189,26 @@ $graph:
179189 File format ontologies may be provided in the "$schema" metadata at the
180190 root of the document. If no ontologies are specified in `$schema`, the
181191 runtime may perform exact file format matches.
192+ - name : contents
193+ type : string?
194+ doc : |
195+ File contents literal. Maximum of 64 KiB.
182196
197+ If neither `location` nor `path` is provided, `contents` must be
198+ non-null. The implementation must assign a unique identifier for the
199+ `location` field. When the file is staged as input to CommandLineTool,
200+ the value of `contents` must be written to a file.
201+
202+ If `loadContents` of `inputBinding` or `outputBinding` is true and
203+ `location` is valid, the implementation must read up to the first 64
204+ KiB of text from the file and place it in the "contents" field.
183205
184- - name : Dirent
185- type : record
186- fields :
187- - name : entryname
188- type : string
189- jsonldPredicate :
190- " _id " : cwl:entryname
191- - name : entry
192- type : [File, Directory]
193- jsonldPredicate :
194- " _id " : cwl:entry
195206
196207 - name : Directory
197208 type : record
198209 docParent : " #CWLType"
199210 doc : |
200- Represents a directory to present to a command line tool. This could be a virtual
201- directory, made of files assembled from multiple locations.
211+ Represents a directory to present to a command line tool.
202212 fields :
203213 - name : class
204214 type :
@@ -211,7 +221,7 @@ $graph:
211221 _type : " @vocab"
212222 doc : Must be `Directory` to indicate this object describes a Directory.
213223 - name : location
214- type : string
224+ type : string?
215225 doc : |
216226 A URI that identifies the directory resource. This may be a relative
217227 reference, in which case it must be resolved using the base URI of the
@@ -222,6 +232,10 @@ $graph:
222232 unsupported protocol, access denied, or other issue) it must signal an
223233 error.
224234
235+ If the `location' field is not provided, the `listing` field must be
236+ provided. The implementation must assign a unique identifier for
237+ the `location` field.
238+
225239 If the `path` field is provided but the `location` field is not, an
226240 implementation may assign the value of the `path` field to `location`,
227241 then follow the rules above.
@@ -239,16 +253,36 @@ $graph:
239253 jsonldPredicate :
240254 _id : " cwl:path"
241255 _type : " @id"
256+ - name : basename
257+ type : string?
258+ doc : |
259+ The base name of the directory, that is, the name of the file without any
260+ leading directory path. The base name must not contain a slash `/`.
261+
262+ If not provided, the implementation must set this field based on the
263+ `location` field by taking the final path component after parsing
264+ `location` as an IRI. If `basename` is provided, it is not required to
265+ match the value from `location`.
266+
267+ When this file is made available to a CommandLineTool, it must be named
268+ with `basename`, i.e. the final component of the `path` field must match
269+ `basename`.
270+ jsonldPredicate : " cwl:basename"
242271 - name : listing
243272 type :
244273 - " null"
245274 - type : array
246- items : [File, Dirent]
247- doc : List of files or subdirectories contained in this directory
275+ items : [File, Directory]
276+ doc : |
277+ List of files or subdirectories contained in this directory. The name
278+ of each file or subdirectory is determined by the `basename` field of
279+ each `File` or `Directory` object. It is an error if a `File` shares a
280+ `basename` with any other entry in `listing`. If two or more
281+ `Directory` object share the same `basename`, this must be treated as
282+ equivalent to a single subdirectory with the listings recursively
283+ merged.
248284 jsonldPredicate :
249285 _id : " cwl:listing"
250- mapSubject : entryname
251- mapPredicate : entry
252286
253287- name : SchemaBase
254288 type : record
0 commit comments