common-workflow-language / common-workflow-language

Repository for the CWL standards. Use https://cwl.discourse.group/ for support 😊

Home Page:https://www.commonwl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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: enums 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

enums 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.

[0] v1.0 Schema (the same for v1.1 and v1.2):

- name: InputEnumSchema

[1]

- tool: 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.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: