Skip to content

Commit 15a0fd6

Browse files
committed
Explicitly specify metadata filters for collections through queryables #396
1 parent c3f8512 commit 15a0fd6

File tree

2 files changed

+110
-22
lines changed

2 files changed

+110
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- Recommendation for UDF runtime names. [#409](https://github.com/Open-EO/openeo-api/issues/409)
3030
- Processes: Added `dimensions` schema for subtype `datacube`
3131
- Collections: Added `geometry` dimension type to `cube:dimensions`
32+
- New endpoint for metadata filters (queryables): `/collections/{collection_id}/queryables`. Also adds a new rel type to the collection links. [#396](https://github.com/Open-EO/openeo-api/issues/396)
3233

3334
### Changed
3435

@@ -61,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6162
- `GET /services` and `GET /services/{service_id}`: Clarify that `enabled` is required by removing the default value. [#473](https://github.com/Open-EO/openeo-api/issues/473)
6263
- Several appearances of `nullable` were clarified according to the lint report by Spectral
6364
- Clarify how the well-known document works [#460](https://github.com/Open-EO/openeo-api/issues/460)
65+
- Clarify handling of JSON Schema versions
6466

6567
## [1.1.0] - 2021-05-17
6668

openapi.yaml

Lines changed: 108 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,12 +1374,7 @@ paths:
13741374
- {}
13751375
- Bearer: []
13761376
parameters:
1377-
- name: collection_id
1378-
in: path
1379-
description: Collection identifier
1380-
required: true
1381-
schema:
1382-
$ref: '#/components/schemas/collection_id'
1377+
- $ref: '#/components/parameters/collection_id'
13831378
responses:
13841379
'200':
13851380
description: JSON object with the full collection metadata.
@@ -1436,6 +1431,9 @@ paths:
14361431
- rel: license
14371432
href: https://scihub.copernicus.eu/twiki/pub/SciHubWebPortal/TermsConditions/Sentinel_Data_Terms_and_Conditions.pdf
14381433
type: application/pdf
1434+
- rel: http://www.opengis.net/def/rel/ogc/1.0/queryables
1435+
href: https://example.openeo.org/api/collections/Sentinel-2A/queryables
1436+
type: application/schema+json
14391437
- rel: about
14401438
href: https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c
14411439
type: text/html
@@ -1574,6 +1572,67 @@ paths:
15741572
$ref: '#/components/responses/client_error_auth'
15751573
5XX:
15761574
$ref: '#/components/responses/server_error'
1575+
'/collections/{collection_id}/queryables':
1576+
get:
1577+
summary: Metadata filters for a specific dataset
1578+
operationId: list-collection-queryables
1579+
description: |-
1580+
Lists **all** supported metadata filters (also called "queryables") for
1581+
a specific collection.
1582+
1583+
This endpoint is compatible with endpoint defined in the STAC API extension
1584+
[`filter`](https://github.com/stac-api-extensions/filter#queryables) and
1585+
[OGC API - Features - Part 3: Filtering](https://github.com/opengeospatial/ogcapi-features/tree/master/extensions/filtering).
1586+
For a precise definition please follow those specifications.
1587+
1588+
This endpoints provides a JSON Schema for each queryable that openEO
1589+
users can use in multiple scenarios:
1590+
1. For loading data from the collection, e.g. in the process `load_collection`.
1591+
2. For filtering items using CQL2 on the `/collections/{collection_id}/items` endpoint
1592+
(if [STAC API - Features is implemented in addition to the openEO API](#tag/EO-Data-Discovery/STAC)).
1593+
1594+
Note: Providing the Bearer token is REQUIRED for private collections.
1595+
tags:
1596+
- EO Data Discovery
1597+
security:
1598+
- {}
1599+
- Bearer: []
1600+
parameters:
1601+
- $ref: '#/components/parameters/collection_id'
1602+
responses:
1603+
'200':
1604+
description: |-
1605+
A JSON Schema defining the queryables.
1606+
1607+
It is RECOMMENDED to dereference all "$refs".
1608+
content:
1609+
application/schema+json:
1610+
schema:
1611+
$ref: '#/components/schemas/json_schema'
1612+
example:
1613+
$schema: https://json-schema.org/draft/2019-09/schema
1614+
$id: https://example.com/api/v1.0/collections/Sentinel-2A/queryables
1615+
type: object
1616+
title: Sentinel 2A
1617+
properties:
1618+
'eo:cloud_cover':
1619+
title: Cloud Cover
1620+
type: number
1621+
minimum: 0
1622+
maximum: 100
1623+
platform:
1624+
title: Platform
1625+
description: The satellite platform.
1626+
type: string
1627+
enum:
1628+
- sentinel-2a
1629+
- sentinel-2b
1630+
additionalProperties: false
1631+
1632+
4XX:
1633+
$ref: '#/components/responses/client_error_auth'
1634+
5XX:
1635+
$ref: '#/components/responses/server_error'
15771636
/processes:
15781637
get:
15791638
summary: Supported predefined processes
@@ -4327,7 +4386,7 @@ components:
43274386
- '2011-11-11T12:22:11Z'
43284387
- null
43294388
links:
4330-
description: >-
4389+
description: |-
43314390
Links related to this collection.
43324391
Could reference to licensing information, other meta data formats with
43334392
additional information or a preview image.
@@ -4352,6 +4411,10 @@ components:
43524411
catalog service such as OGC CSW, a human-readable HTML version or a
43534412
metadata document following another standard such as ISO 19115 or DCAT.
43544413
4414+
6. `http://www.opengis.net/def/rel/ogc/1.0/queryables`: URL to the
4415+
queryables endpoint at `/collections/{collection_id}/queryables`.
4416+
For JSON Schema documents, the `type` field must be set to `application/schema+json`.
4417+
43554418
For additional relation types see also the lists of
43564419
[common relation types in openEO](#section/API-Principles/Web-Linking)
43574420
and the STAC specification for Collections.
@@ -5159,7 +5222,7 @@ components:
51595222
description: The return value which can by of any data type.
51605223
links:
51615224
type: array
5162-
description: >-
5225+
description: |-
51635226
Links related to this process, e.g. additional external documentation.
51645227
51655228
It is RECOMMENDED to provide links with the following `rel` (relation) types:
@@ -5965,15 +6028,32 @@ components:
59656028
type: object
59666029
title: JSON Schema
59676030
description: |-
5968-
A JSON Schema compliant to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html).
5969-
JSON Schemas SHOULD always be dereferenced (i.e. all `$refs` should be resolved). This allows clients to consume the schemas much better.
6031+
A JSON Schema compliant to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html) or later.
6032+
6033+
JSON Schemas SHOULD always be dereferenced (i.e. all `$refs` should be resolved).
6034+
This allows clients to consume the schemas much better.
59706035
Clients are not expected to support dereferencing `$refs`.
59716036
5972-
Note: The specified schema is only a common subset of JSON Schema. Additional keywords MAY be used.
6037+
Note: The specified schema in the OpenAPI document is only a common subset of JSON Schema.
6038+
Additional keywords from the JSON Schema specification MAY be used.
59736039
properties:
6040+
$schema:
6041+
description: |-
6042+
The JSON Schema version. If not given in the context of openEO,
6043+
defaults to `draft-07`.
6044+
6045+
You may need to add the default value for `$schema` property explicitly to the JSON Schema
6046+
object before passing it to a JSON Schema validator.
6047+
type: string
6048+
format: uri
6049+
default: http://json-schema.org/draft-07/schema#
6050+
$id:
6051+
description: ID of your JSON Schema.
6052+
type: string
6053+
format: uri
59746054
type:
59756055
description: |-
5976-
The allowed basic data type(s) for a value according to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.1.1).
6056+
The allowed basic data type(s) for a value.
59776057
59786058
If this property is not present, all data types are allowed.
59796059
oneOf:
@@ -5986,28 +6066,28 @@ components:
59866066
pattern:
59876067
type: "string"
59886068
format: "regex"
5989-
description: The regular expression a string value must match against. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.3.3).
6069+
description: The regular expression a string value must match against.
59906070
enum:
59916071
type: array
59926072
items: {}
5993-
description: An exclusive list of allowed values. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.1.2).
6073+
description: An exclusive list of allowed values.
59946074
minimum:
59956075
type: number
5996-
description: The minimum value (inclusive) allowed for a numerical value. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.2.4).
6076+
description: The minimum value (inclusive) allowed for a numerical value.
59976077
maximum:
59986078
type: number
5999-
description: The maximum value (inclusive) allowed for a numerical value. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.2.2).
6079+
description: The maximum value (inclusive) allowed for a numerical value.
60006080
minItems:
60016081
type: number
60026082
minimum: 0
60036083
default: 0
6004-
description: The minimum number of items required in an array. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.4).
6084+
description: The minimum number of items required in an array.
60056085
maxItems:
60066086
type: number
60076087
minimum: 0
6008-
description: The maximum number of items required in an array. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.3).
6088+
description: The maximum number of items required in an array.
60096089
items:
6010-
description: Specifies schemas for the items in an array according to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.1).
6090+
description: Specifies schemas for the items in an array.
60116091
anyOf:
60126092
- type: array
60136093
minItems: 1
@@ -6016,9 +6096,8 @@ components:
60166096
- $ref: '#/components/schemas/json_schema'
60176097
additionalProperties:
60186098
description: >-
6019-
You can add any other property supported by JSON Schema, either
6020-
[draft-07](https://json-schema.org/draft-07/json-schema-validation.html)
6021-
or any later version.
6099+
You can add any other property supported by the JSON Schema version that is given through the property `$schema`,
6100+
so either [draft-07](https://json-schema.org/draft-07/json-schema-validation.html) or any later version.
60226101
json_schema_type:
60236102
type: string
60246103
enum:
@@ -6509,6 +6588,13 @@ components:
65096588
required: true
65106589
schema:
65116590
$ref: '#/components/schemas/job_id'
6591+
collection_id:
6592+
name: collection_id
6593+
in: path
6594+
description: Collection identifier
6595+
required: true
6596+
schema:
6597+
$ref: '#/components/schemas/collection_id'
65126598
examples:
65136599
evi_user_defined_process:
65146600
description: A user-defined process that computes the EVI.

0 commit comments

Comments
 (0)