Exclusive Input Parameters with Expressions¶
Exclusive Input Parameters with Expressions refers to the 2.4.3.1. Exclusive Input Parameters with Expressions paragraph of the 2.4. Inputs chapter of the Common Workflow Language User Guide.
1. Parsing¶
In this sample we'll show the access from a remote public URL.
In [1]:
Copied!
from cwl2ogc import load_converter_from_location
cwl_coverter = load_converter_from_location('https://raw.githubusercontent.com/eoap/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/exclusive-parameter-expressions.cwl')
from cwl2ogc import load_converter_from_location
cwl_coverter = load_converter_from_location('https://raw.githubusercontent.com/eoap/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/exclusive-parameter-expressions.cwl')
2. Inputs conversion¶
Once the document is parsed, invoke the cwl2ogc
APIs to convert the CWL inputs to the OGC JSON format:
In [2]:
Copied!
import sys
cwl_coverter.dump_inputs(stream=sys.stdout, pretty_print=True)
import sys
cwl_coverter.dump_inputs(stream=sys.stdout, pretty_print=True)
{ "file_format": { "schema": { "nullable": true, "type": "string", "enum": [ "auto", "fasta", "fastq", "fasta.gz", "fastq.gz" ] }, "metadata": [ { "title": "cwl:type", "value": "[ null, enum[ auto, fasta, fastq, fasta.gz, fastq.gz ] ]" } ], "minOccurs": 0, "maxOccurs": 1, "valuePassing": "byValue", "title": "file_format label", "description": "file_format doc" } }
3. Outputs conversion¶
Users can reuse the BaseCWLtypes2OGCConverter
instance to convert the CWL outputs to the OGC JSON format:
In [3]:
Copied!
cwl_coverter.dump_outputs(stream=sys.stdout, pretty_print=True)
cwl_coverter.dump_outputs(stream=sys.stdout, pretty_print=True)
{ "text_output": { "schema": { "type": "string" }, "metadata": [ { "title": "cwl:type", "value": "string" } ] } }