Examples¶
The following examples show how to use the loader APIs:
1. Parsing¶
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://raw.githubusercontent.com/eoap/schemas/main/experimental/stac-api-client.cwl')
from cwl_loader import load_cwl_from_location
cwl_document = load_cwl_from_location('https://raw.githubusercontent.com/eoap/schemas/main/experimental/stac-api-client.cwl')
2025-08-14 23:06:11.052 | INFO | cwl_loader:load_cwl_from_location:192 - Loading CWL document from https://raw.githubusercontent.com/eoap/schemas/main/experimental/stac-api-client.cwl...
2025-08-14 23:06:11.137 | INFO | cwl_loader:load_cwl_from_yaml:123 - Updating the model to v1.2...
2025-08-14 23:06:11.141 | INFO | cwl_loader:load_cwl_from_yaml:134 - Raw CWL document successfully updated to v1.2! Now converting to the CWL model...
2025-08-14 23:06:12.211 | INFO | cwl_loader:load_cwl_from_yaml:142 - Raw CWL document successfully updated to v1.2! Now dereferencing the FQNs...
2025-08-14 23:06:12.212 | INFO | cwl_loader:_clean_process:65 - Cleaning CommandLineTool stac-client...
2025-08-14 23:06:12.213 | INFO | cwl_loader:load_cwl_from_yaml:150 - CWL document successfully dereferenced!
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)
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: _:9a82fd33-05e0-4fef-8a0d-9ae48bde85ff items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point/bbox type: name: _:a7443885-e83e-412a-a16b-8b263807ddb7 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: _:a55b9727-fc3b-4e72-899d-537bd4aab56d items: double type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#LineString/bbox type: name: _:ed6508f6-59de-442d-b8fc-58bcbb3412bf 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: _:a5dfe0ee-faee-42ff-a959-4124b5caec1f items: name: _:9192e7dc-2cc3-4499-8b82-142ce3a77189 items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon/bbox type: name: _:d106e625-6a5d-4eb5-a2ce-c789e7be75e7 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: _:804edea1-7d04-4a3a-9543-064b89f2ff35 items: name: _:4a4e8688-d6c3-409d-8c55-302dfb9145ef items: double type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPoint/bbox type: name: _:9c0b8d47-c99e-4a47-a53b-8f1fa3aed651 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: _:53fd80eb-bdfd-4119-abcd-3a785e8ffb58 items: name: _:3a3aa22a-e824-4dd5-b6c0-3de0d9e3911b items: name: _:c6dc9df9-1874-47de-8bdb-42b902efb250 items: double type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiLineString/bbox type: name: _:a020415b-14b7-41bc-b4b8-edf0c4038cd8 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: _:69a60bc1-8134-4ee5-b49c-edccb8eba595 items: name: _:3a717437-6f3a-404b-95b1-889fe128030f items: name: _:a96d5bed-cc54-4e14-8be4-d2a38dc61758 items: name: _:37123a52-a15a-4590-a90e-b2c1e610ab7a items: double type: array type: array type: array type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#MultiPolygon/bbox type: name: _:ba0d419b-d793-426e-9a01-4b2e29cea834 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: _:796abf02-e69f-4fc4-8ff0-7de718cdc321 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: _:4b668c40-45e3-46dc-885e-5aa1ec9aeb0b 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: _:c52b1c11-dff5-4ad0-adce-4335bd0df502 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: _:c35756a1-feb5-4d71-a38e-a59ce017807e 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: _:b4472faa-2391-4700-88fa-599801f3ca4c 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: _:cea4baca-ec21-4027-98a0-2a9b5081299e 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: _:021ec701-85b7-411b-aa5b-6e09cd21cd3a items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#Fields/exclude type: - 'null' - name: _:ea420d0a-3351-4141-9f55-e0f2e4dca020 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: _:1f16081b-26b9-405e-b747-76226a353a9e 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: _:595c5730-b134-4555-bc28-d7a5537993a1 items: string type: array - name: https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings/ids type: - 'null' - name: _:2d120a3b-026b-4333-8cc3-8a3331c48747 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/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: _:b349accf-3a24-46a4-9ba6-211ee842c5cd 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: _:90f41760-1c97-41d3-961f-68b61b4e6bdf 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