Skip to content

Commit 3fb9340

Browse files
author
Peter Amstutz
committed
Get rid of Dirent. Update spec for basename. Add contents field to File spec.
1 parent d5b2627 commit 3fb9340

File tree

2 files changed

+44
-80
lines changed

2 files changed

+44
-80
lines changed

draft-4/CommandLineTool.yml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -630,48 +630,6 @@ $graph:
630630
IRI such as an [RRID](http://www.identifiers.org/rrid/SCR_001156).
631631
Example: `http://identifiers.org/rrid/RRID:SCR_001156`
632632
633-
- name: DirentExt
634-
type: record
635-
doc: |
636-
Define a file or subdirectory that must be placed in the designated output
637-
directory prior to executing the command line tool. May be the result of
638-
executing an expression, such as building a configuration file from a
639-
template.
640-
fields:
641-
- name: entryname
642-
type: [string, Expression]
643-
jsonldPredicate:
644-
_id: cwl:entryname
645-
doc: |
646-
The name of the file or subdirectory to create in the output directory.
647-
- name: entry
648-
type: [string, Expression]
649-
jsonldPredicate:
650-
_id: cwl:entry
651-
doc: |
652-
If the value is a string literal or an expression which evaluates to a
653-
string, a new file must be created with the string as the file contents.
654-
655-
If the value is an expression that evaluates to a `File` object, this
656-
indicates the referenced file should be added to the designated output
657-
directory prior to executing the tool.
658-
659-
If the value is an expression that evaluates to a `Dirent` object, this
660-
indicates that the File or Directory in `entry` should be added to the
661-
designated output directory with the name in `entryname`.
662-
663-
If `writable` is false, the file may be made available using a bind
664-
mount or file system link to avoid unnecessary copying of the input
665-
file.
666-
- name: writable
667-
type: boolean?
668-
doc: |
669-
If true, the file or directory must be writable by the tool. Changes
670-
to the file or directory must be isolated and not visible by any other
671-
CommandLineTool process. This may be implemented by making a copy of
672-
the original file or directory. Default false (files and directories
673-
read-only by default).
674-
675633
- name: InitialWorkDirRequirement
676634
type: record
677635
extends: ProcessRequirement
@@ -683,7 +641,7 @@ $graph:
683641
- name: listing
684642
type:
685643
- type: array
686-
items: [File, DirentExt]
644+
items: [File, Directory]
687645
- string
688646
- Expression
689647
jsonldPredicate:
@@ -695,7 +653,7 @@ $graph:
695653
designated output directory prior to executing the command line tool.
696654
697655
May be an expression. If so, the expression return value must validate
698-
as `{type: array, items: [File, Dirent]}`.
656+
as `{type: array, items: [File, Directory]}`.
699657
700658
- name: EnvVarRequirement
701659
type: record

draft-4/Process.yml

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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,33 @@ $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
96-
type: string?
105+
type: string
97106
doc: |
98-
The base name of the file, that is, the path component following the
99-
final slash in the path.
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 `/`.
100109
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.
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`.
105118
- name: dirname
106119
type: string?
107120
doc: |
@@ -121,10 +134,8 @@ $graph:
121134
period. Leading periods on the basename are ignored; a basename of
122135
`.cshrc` will have a nameroot of `.cshrc`.
123136
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.
137+
The implementation must set this field automatically based on the value
138+
of `basename` prior to evaluating parameter references or expressions.
128139
- name: nameext
129140
type: string?
130141
doc: |
@@ -133,10 +144,8 @@ $graph:
133144
period. Leading periods on the basename are ignored; a basename of
134145
`.cshrc` will have an empty `nameext`.
135146
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.
147+
The implementation must set this field automatically based on the value
148+
of `basename` prior to evaluating parameter references or expressions.
140149
- name: checksum
141150
type: ["null", string]
142151
doc: |
@@ -149,7 +158,7 @@ $graph:
149158
type:
150159
- "null"
151160
- type: array
152-
items: [File, Dirent]
161+
items: [File, Directory]
153162
jsonldPredicate: "cwl:secondaryFiles"
154163
doc: |
155164
A list of additional files that are associated with the primary file
@@ -179,26 +188,16 @@ $graph:
179188
File format ontologies may be provided in the "$schema" metadata at the
180189
root of the document. If no ontologies are specified in `$schema`, the
181190
runtime may perform exact file format matches.
182-
183-
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
191+
- name: contents
192+
type: string?
193+
doc: |
194+
content
195195
196196
- name: Directory
197197
type: record
198198
docParent: "#CWLType"
199199
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.
200+
Represents a directory to present to a command line tool.
202201
fields:
203202
- name: class
204203
type:
@@ -223,7 +222,7 @@ $graph:
223222
error.
224223
225224
If the `location' field is not provided, the `listing` field must be
226-
provided. The implementation must generate an internal identifier for
225+
provided. The implementation must assign a unique identifier for
227226
the `location` field.
228227
229228
If the `path` field is provided but the `location` field is not, an
@@ -247,8 +246,15 @@ $graph:
247246
type:
248247
- "null"
249248
- type: array
250-
items: [File, Dirent]
251-
doc: List of files or subdirectories contained in this directory
249+
items: [File, Directory]
250+
doc: |
251+
List of files or subdirectories contained in this directory. The name
252+
of each file or subdirectory is determined by the `basename` field of
253+
each `File` or `Directory` object. It is an error if a `File` shares a
254+
`basename` with any other entry in `listing`. If two or more
255+
`Directory` object share the same `basename`, this must be treated as
256+
equivalent to a single subdirectory with the listings recursively
257+
merged.
252258
jsonldPredicate:
253259
_id: "cwl:listing"
254260
mapSubject: entryname

0 commit comments

Comments
 (0)