Examples¶
The following examples show how to use the loader APIs:
1.1 Parsing a Workflow¶
This sample shows how to read a CWL document from a remote public URL:
In [1]:
Copied!
from cwl_loader import load_cwl_from_location
cwl_document = load_cwl_from_location('https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl')
from cwl_loader import load_cwl_from_location
cwl_document = load_cwl_from_location('https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl')
2025-09-24 07:17:28.337 | DEBUG | cwl_loader:load_cwl_from_location:231 - Loading CWL document from https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl...
2025-09-24 07:17:28.565 | DEBUG | cwl_loader:_load_cwl_from_stream:234 - Reading stream from https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl...
2025-09-24 07:17:28.615 | DEBUG | cwl_loader:load_cwl_from_stream:206 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2025-09-24 07:17:28.615 | DEBUG | cwl_loader:load_cwl_from_yaml:133 - Updating the model from version 'v1.0' to version 'v1.2'...
2025-09-24 07:17:28.616 | DEBUG | cwl_loader:load_cwl_from_yaml:144 - Raw CWL document successfully updated to v1.2!
2025-09-24 07:17:28.617 | DEBUG | cwl_loader:load_cwl_from_yaml:148 - Parsing the raw CWL document to the CWL Utils DOM...
2025-09-24 07:17:31.078 | DEBUG | cwl_loader:load_cwl_from_yaml:161 - Raw CWL document successfully parsed to the CWL Utils DOM!
2025-09-24 07:17:31.079 | DEBUG | cwl_loader:load_cwl_from_yaml:163 - Dereferencing the steps[].run...
2025-09-24 07:17:31.079 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/schemas/releases/download/0.2.0/stac-api-client.0.2.0.cwl must be externally imported...
2025-09-24 07:17:31.080 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/schemas/releases/download/0.2.0/stac-api-client.0.2.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.080 | DEBUG | cwl_loader:load_cwl_from_location:231 - Loading CWL document from https://github.com/eoap/schemas/releases/download/0.2.0/stac-api-client.0.2.0.cwl...
2025-09-24 07:17:31.194 | DEBUG | cwl_loader:_load_cwl_from_stream:234 - Reading stream from https://github.com/eoap/schemas/releases/download/0.2.0/stac-api-client.0.2.0.cwl...
2025-09-24 07:17:31.202 | DEBUG | cwl_loader:load_cwl_from_stream:206 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2025-09-24 07:17:31.203 | DEBUG | cwl_loader:load_cwl_from_yaml:146 - No needs to update the Raw CWL document since it targets already the v1.2
2025-09-24 07:17:31.204 | DEBUG | cwl_loader:load_cwl_from_yaml:148 - Parsing the raw CWL document to the CWL Utils DOM...
2025-09-24 07:17:31.950 | DEBUG | cwl_loader:load_cwl_from_yaml:161 - Raw CWL document successfully parsed to the CWL Utils DOM!
2025-09-24 07:17:31.951 | DEBUG | cwl_loader:load_cwl_from_yaml:163 - Dereferencing the steps[].run...
2025-09-24 07:17:31.952 | DEBUG | cwl_loader:load_cwl_from_yaml:170 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2025-09-24 07:17:31.953 | DEBUG | cwl_loader:load_cwl_from_yaml:174 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2025-09-24 07:17:31.953 | DEBUG | cwl_loader:load_cwl_from_yaml:178 - All steps[].run link are resolvable!
2025-09-24 07:17:31.954 | DEBUG | cwl_loader:load_cwl_from_yaml:181 - Sorting Process instances by dependencies....
2025-09-24 07:17:31.954 | DEBUG | cwl_loader:load_cwl_from_yaml:183 - Sorting process is over.
2025-09-24 07:17:31.955 | DEBUG | cwl_loader:_load_cwl_from_stream:243 - Stream from https://github.com/eoap/schemas/releases/download/0.2.0/stac-api-client.0.2.0.cwl successfully load!
2025-09-24 07:17:31.956 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#convert-search must be externally imported...
2025-09-24 07:17:31.957 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.957 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#detect_water_body must be externally imported...
2025-09-24 07:17:31.958 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.958 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#stac must be externally imported...
2025-09-24 07:17:31.959 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.959 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#stac-zarr must be externally imported...
2025-09-24 07:17:31.960 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.960 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#crop must be externally imported...
2025-09-24 07:17:31.961 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.961 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#norm_diff must be externally imported...
2025-09-24 07:17:31.961 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.962 | DEBUG | cwl_loader:_on_process:81 - Checking if https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl#otsu must be externally imported...
2025-09-24 07:17:31.962 | DEBUG | cwl_loader:_on_process:85 - run_url: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl - uri: https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl
2025-09-24 07:17:31.963 | DEBUG | cwl_loader:load_cwl_from_yaml:170 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2025-09-24 07:17:31.963 | DEBUG | cwl_loader:load_cwl_from_yaml:174 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2025-09-24 07:17:31.964 | DEBUG | cwl_loader:load_cwl_from_yaml:178 - All steps[].run link are resolvable!
2025-09-24 07:17:31.964 | DEBUG | cwl_loader:load_cwl_from_yaml:181 - Sorting Process instances by dependencies....
2025-09-24 07:17:31.965 | DEBUG | cwl_loader:load_cwl_from_yaml:183 - Sorting process is over.
2025-09-24 07:17:31.965 | DEBUG | cwl_loader:_load_cwl_from_stream:243 - Stream from https://github.com/eoap/zarr-cloud-native-format/releases/download/0.3.0/app-water-bodies.0.3.0.cwl successfully load!
1.2 Serializing¶
This sample shows how to write a CWL document to a stream (string, file, ...):
In [2]:
Copied!
from cwl_loader import dump_cwl
import sys
dump_cwl(process=cwl_document, stream=sys.stderr)
from cwl_loader import dump_cwl
import sys
dump_cwl(process=cwl_document, stream=sys.stderr)
cwlVersion: v1.2 $graph: - id: stac-zarr class: CommandLineTool inputs: - id: stac_catalog type: Directory inputBinding: prefix: --stac-catalog outputs: - id: zarr_stac_catalog type: Directory outputBinding: glob: . requirements: - class: InlineJavascriptRequirement - class: EnvVarRequirement envDef: - envName: PATH envValue: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - envName: PYTHONPATH envValue: /app - class: ResourceRequirement coresMax: 1 ramMax: 512 hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/zarr-cloud-native-format/stac-zarr@sha256:5d3522f67b6ee73276563e01b436772161fd8e1658149e38e64615d296170692 cwlVersion: v1.2 baseCommand: - python - -m - app arguments: [] $namespaces: &id001 s: https://schema.org/ - id: water-bodies class: Workflow label: Water bodies detection based on NDWI and otsu threshold doc: Water bodies detection based on NDWI and otsu threshold applied to Sentinel-2 COG STAC items inputs: - id: stac_api_endpoint label: STAC API endpoint doc: STAC API endpoint type: |- https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - id: search_request label: STAC search request doc: STAC search request type: |- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings - id: bands label: bands used for the NDWI doc: bands used for the NDWI default: - green - nir type: name: _:40c762a6-1b82-4e59-9699-b2a3673d2d29 items: string type: array outputs: - id: zarr_stac_catalog outputSource: - stac_zarr/zarr_stac_catalog type: Directory - id: stac_catalog outputSource: - stac/temp_stac_catalog type: Directory requirements: - class: ScatterFeatureRequirement - class: SubworkflowFeatureRequirement - class: SchemaDefRequirement types: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType/Point type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/coordinates type: name: _:179e9d0e-decb-4c50-90e3-0ee9b8def22c items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox type: name: _:71756cc4-7db0-487b-abfe-a6c44a6435bf items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType/LineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/coordinates type: name: _:0d6b107b-5c2b-4d10-be53-d090a32315c8 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox type: name: _:29cb1814-baee-45ef-8e6d-3755f44e4e8a items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType/Polygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/coordinates type: name: _:645e4c7d-0411-49dc-9e50-d6491e9fac8e items: name: _:bf742d25-3ecd-4c42-8157-3a0ea3597a22 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox type: name: _:5e23a304-1faa-4b56-b9f6-e5330a338576 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType/MultiPoint type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/coordinates type: name: _:a2688e1a-a234-42e6-b6ec-9a9bce39aa81 items: name: _:e2712abb-bbed-4dbb-8665-e97640357951 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox type: name: _:edcfa610-5388-48c7-9dab-ea3e1370e39e items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType/MultiLineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/coordinates type: name: _:31c75abe-0581-49f8-801e-4982e0a6c82c items: name: _:d99b06e1-0860-41b9-9eba-afa70c97a699 items: name: _:ef3a735f-5956-4f81-b056-587e2a561099 items: double type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox type: name: _:1a502b75-1e2d-431d-859d-6dcdd97f3fc4 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType/MultiPolygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/coordinates type: name: _:1f0c97fe-840f-44c0-9e51-5d151b509f48 items: name: _:744819b6-6164-401a-8163-f19594ccff6d items: name: _:0633c8a5-7d1b-46f5-a3e3-8979bd752459 items: name: _:29303098-3c43-4fa5-87de-80bca808b892 items: double type: array type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox type: name: _:657534ab-d704-4e77-976f-b3ecf7bca554 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType/Feature type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/id doc: "Identifier" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/geometry type: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/bbox type: name: _:ed2386fc-d35c-4e55-a341-d977a4326633 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType/GeometryCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/geometries type: name: _:ff744278-0efe-4fd7-a0b4-78857c8c2a11 items: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/bbox type: name: _:496831bd-351d-42e5-a0f8-00bc8cbcbdd5 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/href doc: "i.e. http://data.example.com/buildings/123" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/rel doc: "i.e. alternate" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/type doc: "i.e. application/geo+json" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/hreflang doc: "i.e. en" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/title doc: "i.e. Trierer Strasse 70, 53115 Bonn" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/length type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType/FeatureCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/features type: name: _:fda353e3-c12e-42c1-9ae9-092835ef07b9 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/links type: name: _:4adf378c-5447-426e-b7bb-6a0b998619c8 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/timeStamp type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberMatched type: int - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberReturned type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/key type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/url type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/headers type: - 'null' - name: _:0723a754-dfd6-44a2-a808-82e4bab1eb11 items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/start type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/end type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/include type: - 'null' - name: _:fcebe76f-ee86-4bb5-ba00-3a1042e63c8c items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude type: - 'null' - name: _:05559eee-b434-456f-9ca1-aea29078b9be items: string type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-text - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-json type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/asc - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/desc type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/field type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/direction type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/bbox type: - 'null' - name: _:9bd9a3d2-fdc3-4a3b-bd9c-677af132cdce items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime-interval type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/intersects type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/collections type: - 'null' - name: _:fc084504-ff41-4e65-b123-92844784d813 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids type: - 'null' - name: _:4c3ed8a1-960f-4f14-87d3-b8877d9d2712 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/limit type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/max-items type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/fields type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter type: - 'null' - Any - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-lang type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-crs type: - 'null' - name: _:53e26aee-e233-482e-a1a8-d962f429dadc items: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/sortby type: - 'null' - name: _:42f5f7d1-c15b-4351-828f-f46cb418aeba items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/api_endpoint type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/search_request type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings type: record cwlVersion: v1.2 steps: - id: discovery label: STAC API discovery doc: Discover STAC items from a STAC API endpoint based on a search request in: - id: api_endpoint source: stac_api_endpoint - id: search_request source: search_request out: - search_output run: '#stac-client' - id: convert_search label: Convert Search doc: Convert Search results to get the item self hrefs and the area of interest in: - id: search_results source: discovery/search_output - id: search_request source: search_request out: - items - aoi run: '#convert-search' - id: water_bodies label: Water bodies detection doc: Water bodies detection based on NDWI and otsu threshold applied to each STAC item (sub-workflow) in: - id: item source: convert_search/items - id: aoi source: convert_search/aoi - id: bands source: bands out: - detected_water_body run: '#detect_water_body' scatter: water_bodies/item scatterMethod: dotproduct - id: stac label: Create a STAC catalog with COG outputs doc: Create a STAC catalog with the detected water bodies COG outputs in: - id: item source: convert_search/items - id: rasters source: water_bodies/detected_water_body out: - temp_stac_catalog run: '#stac' - id: stac_zarr label: Create a STAC Catalog for the Zarr store doc: Create a STAC Catalog for the Zarr store from the STAC catalog with COG outputs in: - id: stac_catalog source: stac/temp_stac_catalog out: - zarr_stac_catalog run: '#stac-zarr' $namespaces: *id001 - id: otsu class: CommandLineTool inputs: - id: raster type: File inputBinding: position: 1 outputs: - id: binary_mask_item type: File outputBinding: glob: '*.tif' requirements: - class: InlineJavascriptRequirement - class: EnvVarRequirement envDef: - envName: PATH envValue: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - envName: PYTHONPATH envValue: /app - class: ResourceRequirement coresMax: 1 ramMax: 512 hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/mastering-app-package/otsu@sha256:45866d928037c38c1c0d90678bfeda885991e85dbc6edb2ecaba5873bf4a8d83 cwlVersion: v1.2 baseCommand: - python - -m - app arguments: [] $namespaces: *id001 - id: stac-client class: CommandLineTool label: STAC Client Tool doc: | This tool uses the STAC Client to search for STAC items inputs: - id: api_endpoint label: STAC API endpoint doc: STAC API endpoint for Landsat-9 data type: |- https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - id: search_request label: STAC API settings doc: STAC API settings for Landsat-9 data type: |- https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings outputs: - id: search_output type: File outputBinding: glob: discovery-output.json requirements: - class: InlineJavascriptRequirement - class: NetworkAccess networkAccess: true - class: SchemaDefRequirement types: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType/Point type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/coordinates type: name: _:ffcf301a-bdfd-45a9-9ece-891f1c687c29 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox type: name: _:2894daa9-fc89-47ac-94f3-ebc9914f4b24 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType/LineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/coordinates type: name: _:7856a1f1-c4fb-45c7-94f3-352a1392e584 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox type: name: _:bb4fd395-0711-485b-8e33-aa0cb1974810 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType/Polygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/coordinates type: name: _:e587f1fb-333c-4de9-b7a3-443cd2312d27 items: name: _:052daf53-5504-44f2-b7c9-ffa75321c096 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox type: name: _:25e494bf-9bff-4463-9e2e-64511284a53f items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType/MultiPoint type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/coordinates type: name: _:3fffdc34-322c-4d79-b3fd-e523e789cb7d items: name: _:48218983-29d1-4b26-8a5c-f60fb520fd8d items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox type: name: _:55f0036b-6bb4-40dd-8dca-364e2c1feffe items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType/MultiLineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/coordinates type: name: _:1e7a7807-2117-437d-839b-220a395a586c items: name: _:3c296134-70b3-4ec9-b2de-8482ed308076 items: name: _:bb16177a-8a95-4b05-9476-65bfa458e9e5 items: double type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox type: name: _:c6fb5a99-89ec-4192-8bc4-57963c896bda items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType/MultiPolygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/coordinates type: name: _:6681299a-c5ef-45f0-946b-f95614c80b1b items: name: _:1fe1a835-daeb-48a0-b295-8288635009bf items: name: _:7e2fbff7-825e-4715-bfae-6098adcbea25 items: name: _:a4c1a313-9b77-4d50-879d-7ba193ff05e5 items: double type: array type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox type: name: _:eb571325-6c8d-4faa-a9e3-c680aab55b95 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType/Feature type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/id doc: "Identifier" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/geometry type: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/bbox type: name: _:3a06b500-6a6a-4734-95e5-7837a4597931 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType/GeometryCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/geometries type: name: _:7e535eb9-d409-4840-819f-ac35f7ae6e8a items: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/bbox type: name: _:66423936-4d03-46e2-99dd-f50bc82b947e items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/href doc: "i.e. http://data.example.com/buildings/123" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/rel doc: "i.e. alternate" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/type doc: "i.e. application/geo+json" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/hreflang doc: "i.e. en" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/title doc: "i.e. Trierer Strasse 70, 53115 Bonn" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/length type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType/FeatureCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/features type: name: _:86efa16e-941a-46db-ab4a-2d905c8c4949 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/links type: name: _:79ce44d7-9d37-43a0-b7a7-bbe408305fe1 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/timeStamp type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberMatched type: int - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberReturned type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/key type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/url type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/headers type: - 'null' - name: _:2f7bdb57-770b-418c-ab98-a1fb42923d0f items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/start type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/end type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/include type: - 'null' - name: _:6701f600-cc40-4fe9-bfe8-7c00a47e2bf2 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude type: - 'null' - name: _:23691f6a-8add-406a-b6b2-a396bd58457d items: string type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-text - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-json type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/asc - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/desc type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/field type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/direction type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/bbox type: - 'null' - name: _:768a1d59-85d8-4a77-9346-940abeb0fd42 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime-interval type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/intersects type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/collections type: - 'null' - name: _:ed1979ef-63c7-4183-a74e-32456c0b2ec6 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids type: - 'null' - name: _:520624fd-84d7-4014-aaf8-695c8a738d19 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/limit type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/max-items type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/fields type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter type: - 'null' - Any - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-lang type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-crs type: - 'null' - name: _:03cdc224-3b36-49ab-ba54-c587e4ba8be2 items: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/sortby type: - 'null' - name: _:cdd97e7a-bd0c-4d4e-a452-5e9342972ff3 items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/api_endpoint type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/search_request type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings type: record hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/schemas/stac-api-client@sha256:a7e346f704836d07f5dabc6b29ee3359e7253f4a294d74f3899973b8920da6f7 cwlVersion: v1.2 baseCommand: - stac-client arguments: - search - $(inputs.api_endpoint.url.value) - ${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(",")); return args; } - ${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; } - ${ const args = []; const limit = inputs.search_request?.limit; args.push("--limit", (limit ?? 10).toString()); return args; } - ${ const maxItems = inputs.search_request?.['max-items']; return ['--max-items', (maxItems ?? 20).toString()]; } - ${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; } - ${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; } - ${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; } - ${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; } - --save - discovery-output.json - id: stac class: CommandLineTool inputs: - id: item type: name: _:7a9cacf0-3fd8-4552-9f4f-8cf6943176cc items: string type: array inputBinding: prefix: --input-item - id: rasters type: name: _:6af3cdba-0aa8-49a1-abec-14bdab0cd222 items: File type: array inputBinding: prefix: --water-body outputs: - id: temp_stac_catalog label: temporary STAC catalog with COG outputs type: Directory outputBinding: glob: . requirements: - class: InlineJavascriptRequirement - class: EnvVarRequirement envDef: - envName: PATH envValue: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - envName: PYTHONPATH envValue: /app - class: ResourceRequirement coresMax: 1 ramMax: 512 hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/mastering-app-package/stac@sha256:cb54ab738a7d6544f2037368604c1c40e3f5af3eac1250ed14d365e5acb0c6b5 cwlVersion: v1.2 baseCommand: - python - -m - app arguments: [] $namespaces: *id001 - id: detect_water_body class: Workflow label: Water body detection based on NDWI and otsu threshold doc: Water body detection based on NDWI and otsu threshold inputs: - id: aoi doc: area of interest as a bounding box type: string - id: epsg doc: EPSG code default: EPSG:4326 type: string - id: bands doc: bands used for the NDWI type: name: _:af637533-1416-44c8-9ac1-b48b73e446ef items: string type: array - id: item doc: STAC item type: string outputs: - id: detected_water_body outputSource: - otsu/binary_mask_item type: File requirements: - class: ScatterFeatureRequirement cwlVersion: v1.2 steps: - id: crop in: - id: item source: item - id: aoi source: aoi - id: epsg source: epsg - id: band source: bands out: - cropped run: '#crop' scatter: crop/band scatterMethod: dotproduct - id: normalized_difference in: - id: rasters source: crop/cropped out: - ndwi run: '#norm_diff' - id: otsu in: - id: raster source: normalized_difference/ndwi out: - binary_mask_item run: '#otsu' $namespaces: *id001 - id: norm_diff class: CommandLineTool inputs: - id: rasters type: name: _:2bdd4b9d-5269-48d4-b287-8f638462c6b7 items: File type: array inputBinding: position: 1 outputs: - id: ndwi type: File outputBinding: glob: '*.tif' requirements: - class: InlineJavascriptRequirement - class: EnvVarRequirement envDef: - envName: PATH envValue: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - envName: PYTHONPATH envValue: /app - class: ResourceRequirement coresMax: 1 ramMax: 512 hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/mastering-app-package/norm_diff@sha256:9332428544aec5d694c4834fcd286d60c5bd973aa96313998f5f5a8dd181ed56 cwlVersion: v1.2 baseCommand: - python - -m - app arguments: [] $namespaces: *id001 - id: crop class: CommandLineTool inputs: - id: item type: string inputBinding: prefix: --input-item - id: aoi type: string inputBinding: prefix: --aoi - id: epsg type: string inputBinding: prefix: --epsg - id: band type: string inputBinding: prefix: --band outputs: - id: cropped type: File outputBinding: glob: '*.tif' requirements: - class: InlineJavascriptRequirement - class: EnvVarRequirement envDef: - envName: PATH envValue: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - envName: PYTHONPATH envValue: /app - class: ResourceRequirement coresMax: 1 ramMax: 512 hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/mastering-app-package/crop@sha256:25985f43b299e12b8c476746c4b5edf328f4d0b0fea9d017c3dafd2f4f5116ba cwlVersion: v1.2 baseCommand: - python - -m - app arguments: [] $namespaces: *id001 - id: convert-search class: CommandLineTool label: Gets the item self hrefs doc: Gets the item self hrefs from a STAC search result inputs: - id: search_request label: Search Request doc: Search request from the discovery step type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings - id: search_results label: Search Results doc: Search results from the discovery step type: File outputs: - id: items type: Any outputBinding: loadContents: true glob: items.json outputEval: ${ return JSON.parse(self[0].contents); } - id: aoi type: string outputBinding: loadContents: true glob: aoi.txt outputEval: ${ return self[0].contents.trim(); } requirements: - class: InlineJavascriptRequirement - class: SchemaDefRequirement types: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value
type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType/Point type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/coordinates type: name: _:179e9d0e-decb-4c50-90e3-0ee9b8def22c items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox type: name: _:71756cc4-7db0-487b-abfe-a6c44a6435bf items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType/LineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/coordinates type: name: _:0d6b107b-5c2b-4d10-be53-d090a32315c8 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox type: name: _:29cb1814-baee-45ef-8e6d-3755f44e4e8a items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType/Polygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon fields:
-
name
:
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/coordinates type: name: _:645e4c7d-0411-49dc-9e50-d6491e9fac8e items: name: _:bf742d25-3ecd-4c42-8157-3a0ea3597a22 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox type: name: _:5e23a304-1faa-4b56-b9f6-e5330a338576 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType/MultiPoint type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/coordinates type: name: _:a2688e1a-a234-42e6-b6ec-9a9bce39aa81 items: name: _:e2712abb-bbed-4dbb-8665-e97640357951 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox type: name: _:edcfa610-5388-48c7-9dab-ea3e1370e39e items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType/MultiLineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/coordinates type: name: _:31c75abe-0581-49f8-801e-4982e0a6c82c items: name: _:d99b06e1-0860-41b9-9eba-afa70c97a699 items: name: _:ef3a735f-5956-4f81-b056-587e2a561099 items: double type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox type: name: _:1a502b75-1e2d-431d-859d-6dcdd97f3fc4 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType/MultiPolygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/coordinates type: name: _:1f0c97fe-840f-44c0-9e51-5d151b509f48 items: name: _:744819b6-6164-401a-8163-f19594ccff6d items: name: _:0633c8a5-7d1b-46f5-a3e3-8979bd752459 items: name: _:29303098-3c43-4fa5-87de-80bca808b892 items: double type: array type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox type: name: _:657534ab-d704-4e77-976f-b3ecf7bca554 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType/Feature type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/id doc: "Identifier" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/geometry type: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/bbox type: name: _:ed2386fc-d35c-4e55-a341-d977a4326633 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType/GeometryCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/geometries type: name: _:ff744278-0efe-4fd7-a0b4-78857c8c2a11 items: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/bbox type: name: _:496831bd-351d-42e5-a0f8-00bc8cbcbdd5 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/href doc: "i.e. http://data.example.com/buildings/123" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/rel doc: "i.e. alternate" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/type doc: "i.e. application/geo+json" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/hreflang doc: "i.e. en" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/title doc: "i.e. Trierer Strasse 70, 53115 Bonn" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/length type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType/FeatureCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/features type: name: _:fda353e3-c12e-42c1-9ae9-092835ef07b9 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/links type: name: _:4adf378c-5447-426e-b7bb-6a0b998619c8 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/timeStamp type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberMatched type: int - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberReturned type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/key type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/url type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/headers type: - 'null' - name: _:0723a754-dfd6-44a2-a808-82e4bab1eb11 items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/start type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/end type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/include type: - 'null' - name: _:fcebe76f-ee86-4bb5-ba00-3a1042e63c8c items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude type: - 'null' - name: _:05559eee-b434-456f-9ca1-aea29078b9be items: string type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-text - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-json type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/asc - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/desc type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/field type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/direction type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/bbox type: - 'null' - name: _:9bd9a3d2-fdc3-4a3b-bd9c-677af132cdce items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime-interval type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/intersects type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/collections type: - 'null' - name: _:fc084504-ff41-4e65-b123-92844784d813 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids type: - 'null' - name: _:4c3ed8a1-960f-4f14-87d3-b8877d9d2712 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/limit type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/max-items type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/fields type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter type: - 'null' - Any - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-lang type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-crs type: - 'null' - name: _:53e26aee-e233-482e-a1a8-d962f429dadc items: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/sortby type: - 'null' - name: _:42f5f7d1-c15b-4351-828f-f46cb418aeba items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/api_endpoint type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/search_request type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings type: record - class: InitialWorkDirRequirement listing: - entryname: run.sh entry: |- #!/usr/bin/env sh set -x set -euo pipefail yq '[.features[].links[] | select(.rel=="self") | .href]' "$(inputs.search_results.path)" > items.json echo "$(inputs.search_request)" | yq '.bbox | @csv' - > aoi.txt hints: - class: DockerRequirement dockerPull: ghcr.io/eoap/zarr-cloud-native-format/yq@sha256:401655f3f4041bf3d03b05f3b24ad4b9d18cfcf908c3b44f5901383621d0688a cwlVersion: v1.2 baseCommand: - /bin/sh - run.sh arguments: [] $namespaces: *id001
1.3 Obtaining a dictionary¶
Probably users need a plain dictionary to add it inside another document, just invoke:
In [3]:
Copied!
document_dict = dump_cwl(process=cwl_document)
import yaml
yaml.dump(
document_dict,
stream=sys.stdout,
sort_keys=False
)
document_dict = dump_cwl(process=cwl_document)
import yaml
yaml.dump(
document_dict,
stream=sys.stdout,
sort_keys=False
)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[3], line 1 ----> 1 document_dict = dump_cwl(process=cwl_document) 3 import yaml 4 yaml.dump( 5 document_dict, 6 stream=sys.stdout, 7 sort_keys=False 8 ) TypeError: dump_cwl() missing 1 required positional argument: 'stream'
2.1 Parsing a CommandLineTool¶
This sample shows how to read a CWL document from a remote public URL:
In [4]:
Copied!
cwl_document = load_cwl_from_location('https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl')
cwl_document = load_cwl_from_location('https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl')
2025-09-24 07:17:32.383 | DEBUG | cwl_loader:load_cwl_from_location:231 - Loading CWL document from https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl...
2025-09-24 07:17:32.465 | DEBUG | cwl_loader:_load_cwl_from_stream:234 - Reading stream from https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl...
2025-09-24 07:17:32.471 | DEBUG | cwl_loader:load_cwl_from_stream:206 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2025-09-24 07:17:32.472 | DEBUG | cwl_loader:load_cwl_from_yaml:133 - Updating the model from version 'v1.0' to version 'v1.2'...
2025-09-24 07:17:32.472 | DEBUG | cwl_loader:load_cwl_from_yaml:144 - Raw CWL document successfully updated to v1.2!
2025-09-24 07:17:32.473 | DEBUG | cwl_loader:load_cwl_from_yaml:148 - Parsing the raw CWL document to the CWL Utils DOM...
2025-09-24 07:17:32.629 | DEBUG | cwl_loader:load_cwl_from_yaml:161 - Raw CWL document successfully parsed to the CWL Utils DOM!
2025-09-24 07:17:32.629 | DEBUG | cwl_loader:load_cwl_from_yaml:163 - Dereferencing the steps[].run...
2025-09-24 07:17:32.630 | DEBUG | cwl_loader:load_cwl_from_yaml:170 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2025-09-24 07:17:32.631 | DEBUG | cwl_loader:load_cwl_from_yaml:174 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2025-09-24 07:17:32.632 | DEBUG | cwl_loader:load_cwl_from_yaml:178 - All steps[].run link are resolvable!
2025-09-24 07:17:32.632 | DEBUG | cwl_loader:load_cwl_from_yaml:181 - Sorting Process instances by dependencies....
2025-09-24 07:17:32.633 | DEBUG | cwl_loader:load_cwl_from_yaml:183 - Sorting process is over.
2025-09-24 07:17:32.633 | DEBUG | cwl_loader:_load_cwl_from_stream:243 - Stream from https://raw.githubusercontent.com/eoap/application-package-patterns/refs/heads/main/templates/stage-in-file.cwl successfully load!
2.2 Serializing¶
This sample shows how to write a CWL document to a stream (string, file, ...):
In [5]:
Copied!
dump_cwl(process=cwl_document, stream=sys.stderr)
dump_cwl(process=cwl_document, stream=sys.stderr)
id: my-asthonishing-stage-in-file class: CommandLineTool inputs: - id: reference label: Reference URL doc: An URL to stage type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI - id: another_input label: Another Input doc: An additional input for demonstration purposes type: string outputs: - id: staged type: File outputBinding: glob: staged requirements: - class: NetworkAccess networkAccess: true - class: SchemaDefRequirement types: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value type: string type: record - class: DockerRequirement dockerPull: ghcr.io/eoap/application-package-patterns/vegetation-indexes:0.1.1 - class: InlineJavascriptRequirement - class: InitialWorkDirRequirement listing: - entryname: stage.py entry: |- import sys import requests import planetary_computer href = sys.argv[1] signed_url = planetary_computer.sign(href) output_path = "staged" response = requests.get(signed_url, stream=True) response.raise_for_status() # Raise an error for bad status codes with open(output_path, "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) print(f"Downloaded to {output_path}") empty_arg = sys.argv[2] cwlVersion: v1.2 baseCommand: - python - stage.py arguments: - $( inputs.reference.value ) - $( inputs.another_input )
3. Parsing existing data structures¶
Users can load CWL Worflow(s) even from existing dictionaries:
In [6]:
Copied!
from cwl_loader import load_cwl_from_yaml
cwl_document = load_cwl_from_yaml(raw_process={
"cwlVersion": "v1.2",
"inputs": {
"api_endpoint": {
"doc": "STAC API endpoint for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint",
"label": "STAC API endpoint"
},
"search_request": {
"doc": "STAC API settings for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings",
"label": "STAC API settings"
}
},
"requirements": [
{
"class": "InlineJavascriptRequirement"
},
{
"class": "NetworkAccess",
"networkAccess": True
},
{
"class": "SchemaDefRequirement",
"types": [
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml"
}
]
}
],
"doc": "This tool uses the STAC Client to search for STAC items\n",
"class": "CommandLineTool",
"baseCommand": [
"stac-client"
],
"label": "STAC Client Tool",
"arguments": [
"search",
"$(inputs.api_endpoint.url.value)",
"${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(\",\")); return args; }",
"${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; }",
"${ const args = []; const limit = inputs.search_request?.limit; args.push(\"--limit\", (limit ?? 10).toString()); return args; }",
"${ const maxItems = 5; return ['--max-items', maxItems.toString()]; }",
"${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; }",
"${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; }",
"${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; }",
"${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; }",
"--save",
"discovery-output.json"
],
"outputs": {
"search_output": {
"outputBinding": {
"glob": "discovery-output.json"
},
"type": "File"
}
},
"id": "stac-client",
"hints": [
{
"dockerPull": "docker.io/library/stac-client",
"class": "DockerRequirement"
}
]
})
dump_cwl(process=cwl_document, stream=sys.stderr)
from cwl_loader import load_cwl_from_yaml
cwl_document = load_cwl_from_yaml(raw_process={
"cwlVersion": "v1.2",
"inputs": {
"api_endpoint": {
"doc": "STAC API endpoint for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint",
"label": "STAC API endpoint"
},
"search_request": {
"doc": "STAC API settings for Landsat-9 data",
"type": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings",
"label": "STAC API settings"
}
},
"requirements": [
{
"class": "InlineJavascriptRequirement"
},
{
"class": "NetworkAccess",
"networkAccess": True
},
{
"class": "SchemaDefRequirement",
"types": [
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml"
},
{
"$import": "https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml"
}
]
}
],
"doc": "This tool uses the STAC Client to search for STAC items\n",
"class": "CommandLineTool",
"baseCommand": [
"stac-client"
],
"label": "STAC Client Tool",
"arguments": [
"search",
"$(inputs.api_endpoint.url.value)",
"${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(\",\")); return args; }",
"${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; }",
"${ const args = []; const limit = inputs.search_request?.limit; args.push(\"--limit\", (limit ?? 10).toString()); return args; }",
"${ const maxItems = 5; return ['--max-items', maxItems.toString()]; }",
"${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; }",
"${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; }",
"${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; }",
"${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; }",
"--save",
"discovery-output.json"
],
"outputs": {
"search_output": {
"outputBinding": {
"glob": "discovery-output.json"
},
"type": "File"
}
},
"id": "stac-client",
"hints": [
{
"dockerPull": "docker.io/library/stac-client",
"class": "DockerRequirement"
}
]
})
dump_cwl(process=cwl_document, stream=sys.stderr)
2025-09-24 07:17:32.665 | DEBUG | cwl_loader:load_cwl_from_yaml:146 - No needs to update the Raw CWL document since it targets already the v1.2
2025-09-24 07:17:32.666 | DEBUG | cwl_loader:load_cwl_from_yaml:148 - Parsing the raw CWL document to the CWL Utils DOM...
2025-09-24 07:17:33.134 | DEBUG | cwl_loader:load_cwl_from_yaml:161 - Raw CWL document successfully parsed to the CWL Utils DOM!
2025-09-24 07:17:33.135 | DEBUG | cwl_loader:load_cwl_from_yaml:163 - Dereferencing the steps[].run...
2025-09-24 07:17:33.135 | DEBUG | cwl_loader:load_cwl_from_yaml:170 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2025-09-24 07:17:33.136 | DEBUG | cwl_loader:load_cwl_from_yaml:174 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2025-09-24 07:17:33.137 | DEBUG | cwl_loader:load_cwl_from_yaml:178 - All steps[].run link are resolvable!
2025-09-24 07:17:33.137 | DEBUG | cwl_loader:load_cwl_from_yaml:181 - Sorting Process instances by dependencies....
2025-09-24 07:17:33.138 | DEBUG | cwl_loader:load_cwl_from_yaml:183 - Sorting process is over.
id: stac-client class: CommandLineTool label: STAC Client Tool doc: "This tool uses the STAC Client to search for STAC items\n" inputs: - id: api_endpoint label: STAC API endpoint doc: STAC API endpoint for Landsat-9 data type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - id: search_request label: STAC API settings doc: STAC API settings for Landsat-9 data type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings outputs: - id: search_output type: File outputBinding: glob: discovery-output.json requirements: - class: InlineJavascriptRequirement - class: NetworkAccess networkAccess: true - class: SchemaDefRequirement types: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Date/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Duration/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Email/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Hostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNEmail/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IDNHostname/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv4/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6 fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IPv6/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#IRIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#JsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Password/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#RelativeJsonPointer/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#UUID/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URIReference/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URITemplate/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#Time/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType/Point type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/coordinates type: name: _:5bc96d56-8824-4840-9909-82f30a6a5d96 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox type: name: _:9c3414cb-764b-4e0b-8532-557b9cfc5a87 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType/LineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/coordinates type: name: _:e3039424-88fe-4d1e-aefa-06ccbffd9427 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox type: name: _:a6e7709d-8c67-4f0e-b778-34c40578895f items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType/Polygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#PolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/coordinates type: name: _:10366646-c686-40a8-a6c2-6c78254aefd3 items: name: _:e7db118f-21c2-4309-91ef-cedc4ce9fc21 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox type: name: _:b672d1f9-a548-4268-8a86-74b1dd6fd6cf items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType/MultiPoint type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPointType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/coordinates type: name: _:b5ddd1ba-11bc-4b2d-ad13-a2ad4f22982a items: name: _:bff43a75-4253-428f-93d6-77870f61f2b2 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox type: name: _:ccb69cc4-9f00-40be-aa46-e85e376f5e86 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType/MultiLineString type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineStringType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/coordinates type: name: _:b433b138-ddd0-4acf-97a4-3ca64c687664 items: name: _:b85960ee-d975-48f6-a7bc-b8186c1f71dd items: name: _:b3ef73b2-014c-4fc3-a7f5-47d56ed5e6d8 items: double type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox type: name: _:eb0c1093-f7a6-44c8-9073-211a3556b308 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType/MultiPolygon type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygonType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/coordinates type: name: _:bceacb07-947c-4442-b0c8-e9e17b615cde items: name: _:62d9b316-5a10-4daa-9671-dc4856ae7312 items: name: _:049224b4-727e-4cbc-9764-5cea8251e6f7 items: name: _:2f7d0803-50d5-44f6-afb9-b915ebbb994c items: double type: array type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox type: name: _:feda7c65-85f3-4761-98f5-20cf3f3bb861 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType/Feature type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/id doc: "Identifier" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/geometry type: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature/bbox type: name: _:bbfc9cfc-cb19-4ff0-baf4-474de5559da5 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType/GeometryCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/geometries type: name: _:dfa4312a-216e-47a1-bf97-e11365fb76d4 items: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection/bbox type: name: _:01d33b66-194e-4382-b013-3ff99538c199 items: double type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/href doc: "i.e. http://data.example.com/buildings/123" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/rel doc: "i.e. alternate" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/type doc: "i.e. application/geo+json" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/hreflang doc: "i.e. en" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/title doc: "i.e. Trierer Strasse 70, 53115 Bonn" type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link/length type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType symbols: - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType/FeatureCollection type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/type type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollectionType - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/features type: name: _:e649c3ce-6037-48dd-87d2-aa00ee41e6f5 items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Feature type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/links type: name: _:867b8968-9929-4650-abc9-29013f44c80e items: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Link type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/timeStamp type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberMatched type: int - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#FeatureCollection/numberReturned type: int type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/key type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair/value type: string type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/url type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint/headers type: - 'null' - name: _:f7c6d3eb-312c-409f-82a5-5cd27fa98d58 items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#KeyValuePair type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/start type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval/end type: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/include type: - 'null' - name: _:07024d7e-37c2-4620-a076-2466ce95277d items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude type: - 'null' - name: _:1cc98d17-4df1-4be9-8d7b-12daffe1dafd items: string type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-text - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang/cql2-json type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction symbols: - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/asc - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction/desc type: enum - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/field type: string - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy/direction type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Direction type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/bbox type: - 'null' - name: _:bdbd98bc-6713-41e6-8f25-952f465b23d9 items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/datetime-interval type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#DatetimeInterval - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/intersects type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon - https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#GeometryCollection - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/collections type: - 'null' - name: _:4ad8825d-9ab2-4cab-afb1-290ac511cab5 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids type: - 'null' - name: _:650c0ad4-cd00-4e78-926b-9e58fca441ef items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/limit type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/max-items type: - 'null' - int - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/fields type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter type: - 'null' - Any - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-lang type: - 'null' - https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#FilterLang - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/filter-crs type: - 'null' - name: _:6a9d3418-5c3f-4fc1-bfc7-74d1f5f8dc53 items: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#URI type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/sortby type: - 'null' - name: _:aa580c41-9bba-4eb9-b94f-6be9b279eb86 items: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#SortBy type: array type: record - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI fields: - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/api_endpoint type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACAPI/search_request type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings type: record hints: - class: DockerRequirement dockerPull: docker.io/library/stac-client cwlVersion: v1.2 baseCommand: - stac-client arguments: - search - $(inputs.api_endpoint.url.value) - ${ const args = []; const collections = inputs.search_request.collections; args.push('--collections', collections.join(",")); return args; } - ${ const args = []; const bbox = inputs.search_request?.bbox; if (Array.isArray(bbox) && bbox.length >= 4) { args.push('--bbox', ...bbox.map(String)); } return args; } - ${ const args = []; const limit = inputs.search_request?.limit; args.push("--limit", (limit ?? 10).toString()); return args; } - ${ const maxItems = 5; return ['--max-items', maxItems.toString()]; } - ${ const args = []; const filter = inputs.search_request?.filter; const filterLang = inputs.search_request?.['filter-lang']; if (filterLang) { args.push('--filter-lang', filterLang); } if (filter) { args.push('--filter', JSON.stringify(filter)); } return args; } - ${ const datetime = inputs.search_request?.datetime; const datetimeInterval = inputs.search_request?.datetime_interval; if (datetime) { return ['--datetime', datetime]; } else if (datetimeInterval) { const start = datetimeInterval.start?.value || '..'; const end = datetimeInterval.end?.value || '..'; return ['--datetime', `${start}/${end}`]; } return []; } - ${ const ids = inputs.search_request?.ids; const args = []; if (Array.isArray(ids) && ids.length > 0) { args.push('--ids', ...ids.map(String)); } return args; } - ${ const intersects = inputs.search_request?.intersects; if (intersects) { return ['--intersects', JSON.stringify(intersects)]; } return []; } - --save - discovery-output.json
4. Parsing conditional Workflow¶
In [7]:
Copied!
cwl_document = load_cwl_from_location('https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl')
dump_cwl(process=cwl_document, stream=sys.stderr)
cwl_document = load_cwl_from_location('https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl')
dump_cwl(process=cwl_document, stream=sys.stderr)
2025-09-24 07:17:33.208 | DEBUG | cwl_loader:load_cwl_from_location:231 - Loading CWL document from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl...
2025-09-24 07:17:33.304 | DEBUG | cwl_loader:_load_cwl_from_stream:234 - Reading stream from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl...
2025-09-24 07:17:33.326 | DEBUG | cwl_loader:load_cwl_from_stream:206 - CWL data of type <class 'ruamel.yaml.comments.CommentedMap'> successfully loaded from stream
2025-09-24 07:17:33.327 | DEBUG | cwl_loader:load_cwl_from_yaml:146 - No needs to update the Raw CWL document since it targets already the v1.2
2025-09-24 07:17:33.327 | DEBUG | cwl_loader:load_cwl_from_yaml:148 - Parsing the raw CWL document to the CWL Utils DOM...
2025-09-24 07:17:33.457 | DEBUG | cwl_loader:load_cwl_from_yaml:161 - Raw CWL document successfully parsed to the CWL Utils DOM!
2025-09-24 07:17:33.458 | DEBUG | cwl_loader:load_cwl_from_yaml:163 - Dereferencing the steps[].run...
2025-09-24 07:17:33.458 | DEBUG | cwl_loader:_on_process:81 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#stac must be externally imported...
2025-09-24 07:17:33.459 | DEBUG | cwl_loader:_on_process:85 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2025-09-24 07:17:33.460 | DEBUG | cwl_loader:_on_process:81 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_stack must be externally imported...
2025-09-24 07:17:33.460 | DEBUG | cwl_loader:_on_process:85 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2025-09-24 07:17:33.461 | DEBUG | cwl_loader:_on_process:81 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_warp_stack must be externally imported...
2025-09-24 07:17:33.462 | DEBUG | cwl_loader:_on_process:85 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2025-09-24 07:17:33.463 | DEBUG | cwl_loader:_on_process:81 - Checking if https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl#rio_color must be externally imported...
2025-09-24 07:17:33.463 | DEBUG | cwl_loader:_on_process:85 - run_url: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl - uri: https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl
2025-09-24 07:17:33.464 | DEBUG | cwl_loader:load_cwl_from_yaml:170 - steps[].run successfully dereferenced! Dereferencing the FQNs...
2025-09-24 07:17:33.465 | DEBUG | cwl_loader:load_cwl_from_yaml:174 - CWL document successfully dereferenced! Now verifying steps[].run integrity...
2025-09-24 07:17:33.465 | DEBUG | cwl_loader:load_cwl_from_yaml:178 - All steps[].run link are resolvable!
2025-09-24 07:17:33.466 | DEBUG | cwl_loader:load_cwl_from_yaml:181 - Sorting Process instances by dependencies....
2025-09-24 07:17:33.467 | DEBUG | cwl_loader:load_cwl_from_yaml:183 - Sorting process is over.
2025-09-24 07:17:33.468 | DEBUG | cwl_loader:_load_cwl_from_stream:243 - Stream from https://raw.githubusercontent.com/eoap/how-to/refs/heads/main/cwl-workflows/conditional-workflows.cwl successfully load!
cwlVersion: v1.2 $graph: - id: stac class: CommandLineTool inputs: - id: stac_item type: string - id: common_band_name type: string outputs: - id: hrefs type: string outputBinding: loadContents: true glob: message outputEval: | ${ const assets = JSON.parse(self[0].contents).assets; const bandKey = Object.keys(assets).find(key => assets[key]['eo:bands'] && assets[key]['eo:bands'].length === 1 && assets[key]['eo:bands'].some(band => band.common_name === inputs.common_band_name) ); if (!bandKey) { throw new Error(`No valid asset found for band: ${inputs.common_band_name}`); } return assets[bandKey].href; } requirements: - class: DockerRequirement dockerPull: docker.io/curlimages/curl:latest cwlVersion: v1.2 baseCommand: curl arguments: - $( inputs.stac_item ) stdout: message - id: rio_color class: CommandLineTool inputs: - id: stacked type: File outputs: - id: rgb type: File outputBinding: glob: rgb.tif requirements: - class: DockerRequirement dockerPull: ghcr.io/eoap/how-to/rio:1.0.0 - class: InitialWorkDirRequirement listing: - entryname: run.sh entry: |- #!/bin/bash rio color -j -1 --out-dtype uint8 $1 rgb.tif "gamma 3 0.95, sigmoidal rgb 35 0.13" cwlVersion: v1.2 baseCommand: - /bin/bash - run.sh arguments: - $( inputs.stacked.path ) - id: rio_warp_stack class: CommandLineTool inputs: - id: tiffs type: name: _:3d5c3b2c-bddf-4801-8c99-a7a47c9c898b items: string type: array - id: epsg_code type: string outputs: - id: stacked type: File outputBinding: glob: warped.tif requirements: - class: DockerRequirement dockerPull: ghcr.io/eoap/how-to/rio:1.0.0 - class: EnvVarRequirement envDef: - envName: GDAL_TIFF_INTERNAL_MASK envValue: YES - envName: GDAL_HTTP_MERGE_CONSECUTIVE_RANGES envValue: YES - envName: CPL_VSIL_CURL_ALLOWED_EXTENSIONS envValue: .tif - class: InitialWorkDirRequirement listing: - entryname: run.sh entry: |- #!/bin/bash rio stack $@ rio warp --dst-crs $(inputs.epsg_code) stacked.tif warped.tif cwlVersion: v1.2 baseCommand: - /bin/bash - run.sh arguments: - valueFrom: | ${ var arr = []; for(var i=0; i<inputs.tiffs.length; i++) { arr.push(inputs.tiffs[i]); } return arr; } - stacked.tif - id: main class: Workflow inputs: - id: stac-item type: string - id: epsg_code default: native type: string - id: bands type: name: _:65301f32-d8f6-4a66-8006-fc9140eb476a items: string type: array outputs: - id: rgb-tif outputSource: step_color/rgb type: File - id: stack outputSource: - step_stack/stacked - step_warp_stack/stacked pickValue: the_only_non_null type: File requirements: - class: InlineJavascriptRequirement - class: NetworkAccess networkAccess: true - class: ScatterFeatureRequirement - class: MultipleInputFeatureRequirement cwlVersion: v1.2 steps: - id: step_curl in: - id: stac_item source: stac-item - id: common_band_name source: bands out: - hrefs run: '#stac' scatter: step_curl/common_band_name scatterMethod: dotproduct - id: step_warp_stack in: - id: tiffs source: step_curl/hrefs - id: epsg_code source: epsg_code out: - stacked run: '#rio_warp_stack' when: $( inputs.epsg_code != "native") - id: step_stack in: - id: tiffs source: step_curl/hrefs - id: epsg_code source: epsg_code out: - stacked run: '#rio_stack' when: $( inputs.epsg_code == "native") - id: step_color in: - id: stacked source: - step_stack/stacked - step_warp_stack/stacked pickValue: the_only_non_null out: - rgb run: '#rio_color' - id: rio_stack class: CommandLineTool inputs: - id: tiffs type: name: _:1798ef1a-bfe1-4cf4-bd5c-c0ad4c2f355e items: string type: array outputs: - id: stacked type: File outputBinding: glob: stacked.tif requirements: - class: DockerRequirement dockerPull: ghcr.io/eoap/how-to/rio:1.0.0 - class: EnvVarRequirement envDef: - envName: GDAL_TIFF_INTERNAL_MASK envValue: YES - envName: GDAL_HTTP_MERGE_CONSECUTIVE_RANGES envValue: YES - envName: CPL_VSIL_CURL_ALLOWED_EXTENSIONS envValue: .tif - class: InitialWorkDirRequirement listing: - entryname: run.sh entry: |- #!/bin/bash rio stack $@ cwlVersion: v1.2 baseCommand: - /bin/bash - run.sh arguments: - valueFrom: | ${ var arr = []; for(var i=0; i<inputs.tiffs.length; i++) { arr.push(inputs.tiffs[i]); } return arr; } - stacked.tif