Logo
  • Introduction

Supported conversions

  • Essential Input Parameters
    • 1. Parsing
  • Array Inputs
  • Inclusive and Exclusive Inputs
  • Exclusive Input Parameters with Expressions
  • Document graph
  • More examples
    • Complex CWL types
    • Imported CWL types
    • String formats
    • JSON Schema generation
  • Transpiler-Mate plugin
  • API doc
CWL to OGC
  • Supported conversions
  • Essential Input Parameters
  • Edit on transpiler-mate/cwl2ogc

Essential Input Parameters¶

Essential Input Parameters refers to the 2.4.1. Essential Input Parameters 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 cwl_loader import load_cwl_from_location
from cwl2ogc import BaseCWLtypes2OGCConverter

cwl_document = load_cwl_from_location(
    "https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/inp.cwl"
)
cwl_converter = BaseCWLtypes2OGCConverter(cwl_document)
from cwl_loader import load_cwl_from_location from cwl2ogc import BaseCWLtypes2OGCConverter cwl_document = load_cwl_from_location( "https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/inp.cwl" ) cwl_converter = BaseCWLtypes2OGCConverter(cwl_document)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 2
      1 from cwl_loader import load_cwl_from_location
----> 2 from cwl2ogc import BaseCWLtypes2OGCConverter
      3 
      4 cwl_document = load_cwl_from_location(
      5     "https://raw.githubusercontent.com/transpiler-mate/cwl2ogc/refs/heads/develop/tests/artifacts/cwl-types/inp.cwl"

ModuleNotFoundError: No module named 'cwl2ogc'

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_converter.dump_inputs(stream=sys.stdout, pretty_print=True)
import sys cwl_converter.dump_inputs(stream=sys.stdout, pretty_print=True)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[2], line 3
      1 import sys
      2 
----> 3 cwl_converter.dump_inputs(stream=sys.stdout, pretty_print=True)

NameError: name 'cwl_converter' is not defined

3. Outputs conversion¶

Users can reuse the BaseCWLtypes2OGCConverter instance to convert the CWL outputs to the OGC JSON format:

In [3]:
Copied!
cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True)
cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 cwl_converter.dump_outputs(stream=sys.stdout, pretty_print=True)

NameError: name 'cwl_converter' is not defined
Previous Next

Apache License, Version 2.0

Built with MkDocs using a theme provided by Read the Docs.
transpiler-mate/cwl2ogc « Previous Next »