enums as URIs: enhance documentation, fix behaviour
mr-c opened this issue · comments
CWL v1.0 - v1.2 define the type enum
as a specialization of the Salad type EnumSchema
which means that each of the symbols
are either full URIs or the ending parts of URIs built from the base URI for the document [0].
The text of the standards does not directly say how to serialize type: enum
s on the command line, but the conformance tests[1] show that a short name is computed and used. Short names are mentioned in the v1.0 version of the CWL standards but not defined explicitly until v1.1: https://www.commonwl.org/v1.1/SchemaSalad.html#Short_names
enum
s being a URI might make them attractive for use in specifying the output format
of File
types, but currently cwltool
only outputs the short name[2]. So the utility of the URI is lost in this circumstance.
-
CWL v1.2.1: Add an explicit explanation to https://www.commonwl.org/v1.2/CommandLineTool.html#CommandLineBinding on how to render
enum
s on the command line (compute the short name and use it) -
CWL v1.3+: Decide if/how the full URI of a
type: enum
is accessible in theformat
field and elsewhere
[0] v1.0 Schema (the same for v1.1 and v1.2):
common-workflow-language/v1.0/Process.yml
Line 571 in c8041aa
[1]
https://github.com/common-workflow-language/common-workflow-language/blob/main/v1.0/v1.0/anon_enum_inside_array.cwl
https://github.com/common-workflow-language/common-workflow-language/blob/main/v1.0/v1.0/anon_enum_inside_array.yml
The correct result is
first mus_musculus second homo_sapiens
not
first […]v1.0/v1.0/anon_enum_inside_array.cwl#second/mus_musculus second […]v1.0/v1.0/anon_enum_inside_array.cwl#second/homo_sapiens
[2] https://cwl.discourse.group/t/set-tool-output-format-string-from-workflow-inputs/524/10?u=mrc
Related issue here: #568
Related discussions:
- common-workflow-language/schema_salad#506
- https://cwl.discourse.group/t/set-tool-output-format-string-from-workflow-inputs/524/9
- https://matrix.to/#/!RQMxrGNGkeDmWHOaEs:gitter.im/$pvFcTFhyTSnFES2oZ6e8iZA2uFae_9RayIvBvWf5LZc (a.k.a https://gitter.im/common-workflow-language/common-workflow-language?at=61e9531ce1a1264f0a66ce1d )