You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Filter extension provides an expressive mechanism for searching based on Item attributes.
55
54
56
-
This extension uses several conformance classes defined in the
55
+
This extension references behavior defined in the
57
56
[OGC API - Features - Part 3: Filtering and the Common Query Language (CQL)](https://portal.ogc.org/files/96288)
58
57
specification. As of May 2020, this specification is in draft status. The only anticipated change before final is to the
59
58
division of behavior among conformance classes, as described further
60
-
in [OAFeat Part 3 Conformance Classes](#oafeat-part-3-conformance-classes).
59
+
in the [Conformance Classes](#conformance-classes) section.
61
60
62
61
OAFeat Part 3 CQL formally defines syntax for both a text format (cql-text) as an ABNF grammar (largely similar to the BNF grammar
63
-
in the General Model) and a JSON format (cql-json) as an OpenAPI schema, and provides a precise natural language description of
64
-
the declarative semantics.
65
-
The CQL Text format has long-standing use within
62
+
in the General Model) and a JSON format (cql-json) as a JSON Schema and OpenAPI schema, and provides a precise natural
63
+
language description of the declarative semantics. The CQL Text format has long-standing use within
66
64
geospatial software (e.g., GeoServer), is expected not to change before final.
67
-
OGC CQL Text has been previously described
68
-
in [OGC Filter Encoding](https://www.ogc.org/standards/filter) and
65
+
OGC CQL Text has been previously described in [OGC Filter Encoding](https://www.ogc.org/standards/filter) and
69
66
[OGC Catalogue Services 3.0 - General Model](http://docs.opengeospatial.org/is/12-168r6/12-168r6.html#62)
70
67
(including a BNF grammar in Annex B). The CQL JSON format is newly-defined, but also not
71
68
expected to change before final.
@@ -114,8 +111,9 @@ predicates.
114
111
## Conformance Classes
115
112
116
113
OAFeat CQL defines several conformance classes that allow implementers to create compositions of
117
-
functionality that support whatever expressiveness they need. Implementers many choose not to incur the cost of
118
-
implementing functionality they do not need, or may not be able to implement functionality that is not supported by
114
+
functionality that support whatever expressiveness they need. This allows implementers to incrementally support CQL
115
+
syntax, without needing to implement a huge spec all at once. Some implementers choose not to incur the cost of
116
+
implementing functionality they do not need or may not be able to implement functionality that is not supported by
119
117
their underlying datastore, e.g., Elasticsearch does not support the spatial predicates required by the
120
118
Enhanced Spatial Operators conformance class.
121
119
@@ -168,7 +166,20 @@ will support arbitrary uses of properties and literals in expressions on either
168
166
implementations that use datastores that do not easily support right-hand side properties to implement Simple CQL
169
167
(e.g., Elasticsearch). Implementers should feel free to only implement `property operand literal` expressions at this time.
170
168
171
-
## Grammar and schemas
169
+
## Getting Started with Implementation
170
+
171
+
It recommended that implementers start with fully implementing only a subset of functionality. As stated previously,
172
+
until the OAFeat CQL spec is finalized, it is legal in a STAC API implementation to advertise that the Simple CQL conformance
173
+
class is implemented, but that only a subset of that functionality is implemented.
174
+
175
+
A good place to start is
176
+
implementing only the logical and simple comparison operators (`=`, `<`, `<=`, `>`, `>=`), defining a static Queryables
177
+
schema with no queryables advertised, and only implementing CQL Text. Following from that can be support for
178
+
INTERSECTS and ANYINTERACTS, defining a static Queryables schema with only the basic Item properties, and also
179
+
implementing CQL JSON. From there, other comparison operators can be implemented and a more
180
+
dynamic Queryables schema (if desired).
181
+
182
+
Formal definitions and grammars for CQL can be found here:
172
183
173
184
- The [OAFeat (CQL) spec](https://portal.ogc.org/files/96288) includes an ABNF for cql-text and both JSON Schema and
174
185
OpenAPI specifications for cql-json. The standalone files are:
@@ -179,6 +190,18 @@ implementations that use datastores that do not easily support right-hand side p
179
190
- A OpenAPI specification for only the parts of the CQL JSON encoding required by this extension is [here](cql.yml)
180
191
- xtraplatform-spatial has a CQL [ANTLR 4 grammer](https://github.com/interactive-instruments/xtraplatform-spatial/tree/master/xtraplatform-cql/src/main/antlr/de/ii/xtraplatform/cql/infra)
181
192
193
+
These projects have or are developing CQL support:
194
+
195
+
-[GeoPython PyCQL](https://github.com/geopython/pycql/tree/master/pycql), and the
196
+
[Bitner fork](https://github.com/bitner/pycql) to be used in stac-fastapi
197
+
-[Franklin](https://github.com/azavea/franklin) is working on it in [this PR](https://github.com/azavea/franklin/pull/750).
198
+
-[Geotools](https://github.com/geotools/geotools) has support for [CQL text](https://github.com/geotools/geotools/tree/main/modules/library/cql/src/main/java/org/geotools/filter/text/cql2)
199
+
200
+
Note that the [xbib CQL library (JVM)](https://github.com/xbib/cql) is the OASIS Contextual Query Language, not
201
+
OGC CQL, and should not be used to implement this extension, as they are significantly different query languages.
202
+
[Stacatto](https://github.com/planetlabs/staccato) uses this for their query language implementation, but it is
203
+
not compliant with this extension.
204
+
182
205
## Queryables
183
206
184
207
The Queryables mechanism allows a client to discover what variable terms are available for use when writing filter
@@ -761,15 +784,3 @@ GeoJSON geometries.
761
784
},
762
785
}
763
786
```
764
-
765
-
## Implementations
766
-
767
-
-[GeoPython PyCQL](https://github.com/geopython/pycql/tree/master/pycql), and the
768
-
[Bitner fork](https://github.com/bitner/pycql) to be used in stac-fastapi
769
-
-[Franklin](https://github.com/azavea/franklin) is working on it in [this PR](https://github.com/azavea/franklin/pull/750).
770
-
-[Geotools](https://github.com/geotools/geotools) has support for [CQL text](https://github.com/geotools/geotools/tree/main/modules/library/cql/src/main/java/org/geotools/filter/text/cql2)
771
-
772
-
Note that the [xbib CQL library (JVM)](https://github.com/xbib/cql) is the OASIS Contextual Query Language, not
773
-
OGC CQL, and should not be used to implement this extension, as they are significantly different query languages.
774
-
[Stacatto](https://github.com/planetlabs/staccato) uses this for their query language implementation, but it is
0 commit comments