crim-ca / weaver

Weaver: Workflow Execution Management Service (EMS); Application, Deployment and Execution Service (ADES); OGC API - Processes; WPS; CWL Application Package
https://pavics-weaver.readthedocs.io
Apache License 2.0
24 stars 6 forks source link

Handle various representations of "multiple" I/O values #579

Open fmigneault opened 11 months ago

fmigneault commented 11 months ago

Description

The minOccurs/maxOccurs are used in inputs/outputs OGC API definitions to indicate the cardinality of an input "item". This "item" can then itself be a single literal value, an array, or a complex object, which is represented by schema.

Therefore, a minOccurs: 1/maxOccurs: 1 (default) with a schema defining a type: array needs to be passed to remote processes as a single-value "complex data" represented by a JSON array. In CWL, that would be mapped to a File containing the JSON array.

If minOccurs >= 2 and schema has type: array, that input must have at least 2 "item" values, each being an array on its own. In order words, something like [ [1,2], [3,4] ]. In CWL, that would be represented as File[], each respectively containing [1,2] and [3,4]. In a remote WPS, the input would be provide twice, with the same respective complex data arrays.

The tricky portion is that WPS does not support "multiple outputs". No "cadinality" can be defined by minOccurs. In contrast, OGC API and CWL can support multiple outputs without any problem. In order to somewhat support them, the schema has been loosely updated using a oneOf representation of the single value vs multi-value representation when minOccurs >= 2 was detected.

All of this needs to be sorted out according to recommendations and future discussions from OGC API.

References