opengeospatial / opengeospatial/ogcapi-features
Simplify the cql2-text grammar (future version improvements?)
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 386
- Forks
- 92
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 15
Description
This is feedback from trying to implement cql2-text.
Implementers (or at least us) face struggles with the current grammar.
I think it comes down mainly to these two things:
- Some of the capabilities from extension conformance classes are defined as separate rules. I think it would be much easier to simply define new possible values for operators or pre-defined functions identifiers (using the same grammar rule as function calls) for operators using a function call syntax (i.e., array/spatial/temporal operators and predicates). This would cut down the number of rules dramatically, and I think would also allow to make the requirements in each conformance class clearer.
- Some rules seem to exist only to restrict the data types (e.g., numericExpression, characterExpression, temporalExpression...). However, this is purely a runtime concept, since the data type that a certain expression (e.g., a property) will evaluate to will depend on the queryables. Therefore I would not have used grammar rules (which are about the syntax) to make this distinction. Instead, I think what is needed for this is to have requirements and/or permissions that specify the interpretation if an unexpected data type is used in such a context.
I think simplifying these two aspects of the grammar would directly result in simpler parser implementations, greater ease of implementation and greater interoperability.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current cql2-text grammar and the extension conformance class rules described in the issue. Compare the separate operator, function, and data-type expression rules, then determine whether a future grammar revision can simplify them while making the conformance requirements clearer.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100