Skip to content

Commit 96d4159

Browse files
committed
normalize CQL text support to CQL2 (#2015)
1 parent b9e81dd commit 96d4159

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. _cql:
1+
.. _cql2:
22

3-
CQL support
4-
===========
3+
CQL2 support
4+
============
55

6-
OGC Common Query Language (`CQL2`_) is a generic language designed to provide enhanced query and subset/filtering to (primarily) feature and record data.
6+
`OGC Common Query Language`_ (CQL2) is a generic language designed to provide enhanced query and subset/filtering to (primarily) feature and record data.
77

88
Providers
99
---------
@@ -14,7 +14,7 @@ for current provider support.
1414
Limitations
1515
-----------
1616

17-
Support of CQL is limited to `Basic CQL2 <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-core>`_ and thus it allows to query with the
17+
Support is limited to `Basic CQL2 <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-core>`_ and thus it allows to query with the
1818
following predicates:
1919

2020
* comparison predicates
@@ -24,9 +24,9 @@ following predicates:
2424
Formats
2525
-------
2626

27-
Supported providers leverage the CQL2 dialect with the JSON encoding `CQL-JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_.
27+
Supported providers leverage the CQL2 dialect with the JSON encoding `CQL JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_.
2828

29-
PostgreSQL supports both `CQL2 JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_ and `CQL text <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-text>`_ dialects.
29+
PostgreSQL supports both `CQL JSON <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-json>`_ and `CQL Text <https://docs.ogc.org/is/21-065r2/21-065r2.html#cql2-text>`_ dialects.
3030

3131
Queries
3232
^^^^^^^
@@ -83,7 +83,7 @@ Or
8383
]
8484
}'
8585
86-
The same ``BETWEEN`` query using HTTP GET request formatted as CQL text and URL encoded as below:
86+
The same ``BETWEEN`` query using HTTP GET request formatted as CQL2 text and URL encoded as below:
8787

8888
.. code-block:: bash
8989
@@ -103,7 +103,7 @@ An ``EQUALS`` example for a specific property:
103103
]
104104
}'
105105
106-
A ``CROSSES`` example via an HTTP GET request. The CQL text is passed via the ``filter`` parameter.
106+
A ``CROSSES`` example via an HTTP GET request. The CQL2 text is passed via the ``filter`` parameter.
107107

108108
.. code-block:: bash
109109
@@ -122,6 +122,6 @@ The same example, but this time providing a geometry in EWKT format:
122122
123123
curl "http://localhost:5000/collections/beni/items?filter=DWITHIN(geometry,SRID=3857;POINT(1392921%205145517),100,meters)"
124124
125-
Note that the CQL text has been URL encoded. This is required in curl commands but when entering in a browser, plain text can be used e.g. ``CROSSES(foo_geom, LINESTRING(28 -2, 30 -4))``.
125+
Note that the CQL2 text has been URL encoded. This is required in curl commands but when entering in a browser, plain text can be used e.g. ``CROSSES(foo_geom, LINESTRING(28 -2, 30 -4))``.
126126

127-
.. _`CQL2`: https://docs.ogc.org/is/21-065r2/21-065r2.html
127+
.. _`OGC Common Query Language`: https://docs.ogc.org/is/21-065r2/21-065r2.html

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ reference documentation on all aspects of the project.
4545
plugins
4646
html-templating
4747
crs
48-
cql
48+
cql2
4949
language
5050
development
5151
ogc-compliance

docs/source/publishing/ogcapi-features.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ To publish an Elasticsearch index, the following are required in your index:
107107
The ES provider also has the support for the CQL queries as indicated in the table above.
108108

109109
.. seealso::
110-
:ref:`cql` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
110+
:ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
111111

112112
.. _ERDDAP Tabledap Service:
113113

@@ -284,7 +284,7 @@ These are optional and if not specified, the default from the engine will be use
284284
This provider has support for the CQL queries as indicated in the Provider table above.
285285

286286
.. seealso::
287-
:ref:`cql` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
287+
:ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
288288

289289

290290
OGR
@@ -424,7 +424,7 @@ To publish an OpenSearch index, the following are required in your index:
424424
The OpenSearch provider also has the support for the CQL queries as indicated in the table above.
425425

426426
.. seealso::
427-
:ref:`cql` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
427+
:ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
428428

429429
.. _Oracle:
430430

@@ -722,7 +722,7 @@ block contains the necessary socket connection information.
722722
This provider has support for the CQL queries as indicated in the Provider table above.
723723

724724
.. seealso::
725-
:ref:`cql` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
725+
:ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
726726

727727
SQLiteGPKG
728728
^^^^^^^^^^

docs/source/publishing/ogcapi-records.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To publish an Elasticsearch index, the following are required in your index:
5454
The ES provider also has the support for the CQL queries as indicated in the table above.
5555

5656
.. seealso::
57-
:ref:`cql` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
57+
:ref:`cql2` for more details on how to use Common Query Language (CQL) to filter the collection with specific queries.
5858

5959
TinyDBCatalogue
6060
^^^^^^^^^^^^^^^

pygeoapi/api/itemtypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from typing import Any, Tuple, Union
4444
import urllib.parse
4545

46-
from pygeofilter.parsers.ecql import parse as parse_ecql_text
46+
from pygeofilter.parsers.cql2_text import parse as parse_cql2_text
4747
from pygeofilter.parsers.cql2_json import parse as parse_cql2_json
4848
from pyproj.exceptions import CRSError
4949

@@ -488,7 +488,7 @@ def get_collection_items(
488488

489489
if cql_text is not None:
490490
try:
491-
filter_ = parse_ecql_text(cql_text)
491+
filter_ = parse_cql2_text(cql_text)
492492
filter_ = modify_pygeofilter(
493493
filter_,
494494
filter_crs_uri=filter_crs_uri,

tests/other/test_crs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import pytest
3434
from pyproj.exceptions import CRSError
3535
import pygeofilter.ast
36-
from pygeofilter.parsers.ecql import parse
36+
from pygeofilter.parsers.cql2_text import parse
3737
from pygeofilter.values import Geometry
3838
from shapely.geometry import Point
3939

tests/provider/test_postgresql_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import pyproj
5858
from shapely.geometry import shape as geojson_to_geom
5959

60-
from pygeofilter.parsers.ecql import parse
60+
from pygeofilter.parsers.cql2_text import parse
6161

6262
from pygeoapi.api import API
6363
from pygeoapi.api.itemtypes import (
@@ -396,7 +396,7 @@ def test_get_not_existing_item_raise_exception(config):
396396
80835475, 80835478, 80835483, 80835486]),
397397
("osm_id BETWEEN 80800000 AND 80900000 AND waterway = 'stream'",
398398
[80835470]),
399-
("osm_id BETWEEN 80800000 AND 80900000 AND waterway ILIKE 'sTrEam'",
399+
("osm_id BETWEEN 80800000 AND 80900000 AND CASEI(waterway) LIKE 'sTrEam'",
400400
[80835470]),
401401
("osm_id BETWEEN 80800000 AND 80900000 AND waterway LIKE 's%'",
402402
[80835470]),

0 commit comments

Comments
 (0)