-
Notifications
You must be signed in to change notification settings - Fork 27
Add filter extension #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter extension #825
Conversation
- decided to not handle filter={}; let it fail
|
The current filter extension behavior requires using the I think we should provide special handling for the subset of non-property fields that are available for querying on This maintains consistency between the two methods for searching and matches the examples given by the filter extension spec. |
|
I think this comment/suggestion addresses @rkm-ursa 's concern also. I agree that users shouldn't be required to prefix all of their terms with I think the piece that's missing here is including in the queryables specification a mapping from the queryable terms to the document fields, e.g., mapping For example, in the implementation in this PR, a properly-specified queryables schema that supports filtering on cloud cover would look like: {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/v1/collections/foo/queryables",
"type": "object",
"title": "Queryables for Collection foo",
"properties": {
"properties.eo:cloud_cover": {
"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover"
}
},
"additionalProperties": true
}instead of the (better) property definition of: "cloud_cover": {
"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover"
}One possibility is to specify this in the schema like: "cloud_cover": {
"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover",
"mapping": "properties.eo:cloud_cover"
}and remove it before serving the /queryables endpoint so that it's valid JSON Schema (since JSON Schema doesn't allow arbitrary extra fields OOTB). Or, there could just be a separate mapping document attached to the Collection like there is for the queryables that has only the mappings in it, e.g.,: {
"type": "Collection",
"id": "sentinel-2-c1-l2a",
"queryables": { ... },
"queryable_term_mappings": {
"geometry": "geometry"
"cloud_cover": "properties.eo:cloud_cover"
}
...
}I think there also needs to be checking of the terms if the queryables JSON Schema has From OGC API Part 3: Filtering: |
|
@philvarner In response to your comment:
Understood. I had initially implemented it this way and have no issue with reverting.
UPDATE on 1/16/24: Striking the conversation about queryable mappings and property validation if |
|
UPDATE on 1/16/24: Striking this comment about how to gather collections for the purpose of building up the queryable mappings. As discussed with @philvarner offline, we will defer queryable mapping and property validation until the filter extension is more fully implemented in subsequent PRs. |
|
@philvarner Another question. While I don't mind implementing some "advanced" queryable functionality if we are able to come to a reasonable answer to my prior question, are we getting ahead of ourselves? The filter extension recommends starting with:
...which is what this PR currently provides (less the forthcoming change to remove the requirement for fully qualified property names, i.e., remove the requirement for the My intent was to follow up with another PR with the next recommended action:
And then an additional PR with Advanced Comparison Operators, which follows the next recommended action:
And then, finally, look at:
UPDATE on 1/16/24: As discussed with @philvarner offline, we will follow the sequence above (which is taken directly from the filter extension README) in fleshing out the implementation of the filter extension. This PR will be limited to "...only the Basic CQL2 conformance class of logical and comparison operators, defining a static Queryables schema with no queryables advertised and the additionalProperties field set to true, and only implementing CQL2 JSON" |
…properties fields
…ported for filtering
Related Issue(s):
Proposed Changes:
Minimum implementation of the filter extension.
/search(GET and POST),/collections/{collectionId}/items(GET), and/aggregate(GET) endpointsPR Checklist: