common-workflow-language / common-workflow-language/cwl-v1.3

[Proposal] Support `format` per respective `type: File`

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Common Workflow Language
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

At the moment, it is possible to do the following:

```cwl
inputs:
features:
type:
- "File"
- type: array
items: "File"
format:
- "ogc:FeatureCollection"
- "iana:application/geo+json"
$namespaces:
iana: "https://www.iana.org/assignments/media-types/"
ogc: "http://www.opengis.net/def/glossary/term/"
```

However, it is *NOT* possible to do something like the following:

```cwl
inputs:
features:
type:
- type: "File"
format: "ogc:FeatureCollection"
- type: array
items:
type: "File"
format: "iana:application/geo+json"
$namespaces:
iana: "https://www.iana.org/assignments/media-types/"
ogc: "http://www.opengis.net/def/glossary/term/"
```

The reasoning of the above is that the application receiving this `features` input can either receive a single document embedding of a "FeatureCollection" (a specific type of GeoJSON: https://geojson.org/schema/FeatureCollection.json), or an array of "single feature" GeoJSON (eg: https://geojson.org/schema/Feature.json).

The current limitation of `format` permitted only directly under the input makes it such that some combinations of formats are inconsistent with the desired use. In the first example, a single "Feature" GeoJSON could be submitted, or an array of "FeatureCollection" (resulting in a 2D array of features) could be submitted, both of which are invalid for the application that expect a "list of features".

Allowing to nest `format` under the specific `type` would allow to adequately narrow the structure to the valid combinations.

Contributor guide

No contributing guide indexed for this repository

Research direction

Begin with the two CWL input examples in the issue and compare the currently accepted top-level format with the requested nested format on each union branch. Done means the specification and its validation behavior permit format constraints under the relevant File types while rejecting the inconsistent combinations described.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.