Using the transpiler-mate plugin

Available since cwl2ogc 0.20.0

Since release 0.20.0, cwl2ogc is also available as a transpiler-mate plugin. The standalone cwl2ogc command was removed in 0.18.0; use transpiler-mate cwl2ogc for command-line conversion.

The plugin converts the inputs and outputs of the CWL processes loaded by transpiler-mate into OGC API - Processes I/O descriptions. The Python converter API remains available independently of the runtime.

Installation

Install the runtime and plugin in the same Python environment (Python 3.10 or later):

pip install transpiler-mate-runtime "cwl2ogc>=0.20.0"

The cwl2ogc package includes the plugin and depends on transpiler-mate-api. The separate transpiler-mate-runtime package provides the transpiler-mate command and discovers installed plugins automatically. No manual registration is needed.

Check that the command is available:

transpiler-mate --help
transpiler-mate cwl2ogc --help

Convert a CWL document

Replace workflow.cwl with the path to your CWL application package:

transpiler-mate cwl2ogc workflow.cwl

By default, this writes processes.json in the current working directory. Choose a destination with --output:

transpiler-mate cwl2ogc --output build/processes.json workflow.cwl

The plugin creates missing parent directories and overwrites an existing output file. Its plugin-specific option is:

Option Default Description
--output PATH processes.json Destination for the generated JSON document.

Source loading and application metadata validation are handled by the runtime before the plugin runs. The CWL document must satisfy the runtime's metadata requirements; a document accepted by the standalone Python converter may need additional application metadata for runtime use. The current runtime expects document-level metadata surrounding a $graph and validates it against its SoftwareApplication model. See the runtime documentation for source adapters, metadata requirements, and shared command options.

Generated output

The output is an indented JSON object containing the runtime's serialized application metadata plus a processes mapping. Each key is the CWL process ID as supplied by the loader, which may be a full URI including a fragment.

Each process entry contains:

  • class_, label, and doc, when present and non-empty on the loaded process;
  • inputs, generated by BaseCWLtypes2OGCConverter.get_inputs();
  • outputs, generated by BaseCWLtypes2OGCConverter.get_outputs().

The plugin converts every process in context.processes. For a document with a $graph, this can include both workflows and tools. A source fragment such as workflow.cwl#main selects a process in the runtime context but does not restrict this plugin's output to that process.

The generated document contains application metadata and process I/O schemas; it does not deploy a process to an OGC API server. For separate input/output JSON Schema documents, use the Python converter API.

Migrating from the former CLI

Replace the old cwl2ogc executable with transpiler-mate cwl2ogc and install the runtime alongside the plugin. The plugin accepts --output and a source location; it does not expose the former --workflow-id option. Update consumers to read the inputs and outputs under each ID in the processes mapping.

Plugin registration

The package declares the following Python entry point:

[project.entry-points."transpiler_mate.plugins"]
cwl2ogc = "cwl2ogc.plugin:cwl2ogc"

The plugin uses Cwl2OgcOptions for option validation and receives a TranspilerContext from the runtime. See the transpiler-mate API documentation for the shared plugin contract.