Add cql-json support for ES (#723)

Fix starlette event loop


Fix starlette event loop


Fix starlette event loop


Fix starlette event loop


Fix provider regression


Make method public


Make method public


Move function to the helpers utility


Add the CQL lifecycle for development


Add CQL docs


Fix flake8


Isolate import for starlette codepath
This commit is contained in:
Francesco Bartoli
2021-07-22 03:00:14 +02:00
committed by GitHub
parent 0f38c764d6
commit bb4cd0bf69
18 changed files with 1431 additions and 35 deletions
+33
View File
@@ -23,6 +23,39 @@ To run all tests, simply run ``pytest`` in the repository. To run a specific te
run ``pytest tests/test_api.py``, for example.
CQL extension lifecycle
-----------------------
Limitations
^^^^^^^^^^^
This workflow is valid only for the `CQL-JSON` format.
Schema
^^^^^^
The Common Query Language (CQL) is the part 3 of the standard OGC API - Features. This extension has its specification available at
`OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) <https://portal.ogc.org/files/96288>`_ and the schema exists in development at
`cql.json <https://github.com/opengeospatial/ogcapi-features/blob/master/extensions/cql/standard/schema/cql.json>`_.
Model generation
^^^^^^^^^^^^^^^^
pygeoapi uses a class-based python model interface to translate the schema into python objects defined by `pydantic <https://pydantic-docs.helpmanual.io/>`_ models.
The model is generated with the pre-processing of the schema through the utility ``datamodel-codegen``:
.. code-block:: bash
# Generate from local downloaded json schema file
datamodel-codegen --input ~/Download/cql-schema.json --input-file-type jsonschema --output ./pygeoapi/models/cql_update.py --class-name CQLModel
How to merge
^^^^^^^^^^^^
Once the new pydantic models have been generated then the content of the python file ``cql_update.py`` can be used to replace the old classes within the ``cql.py`` file.
Update everything above the function ``get_next_node`` and then verify if the tests for the CQL are still passing, for example ``test_post_cql_json_between_query``
in ``tests/test_elasticsearch__provider.py``.
Working with Spatialite on OSX
------------------------------