Skip to content
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

Updates to Filter Extension for CQL2 #225

Merged
merged 13 commits into from
Dec 3, 2021
Merged

Conversation

philvarner
Copy link
Collaborator

@philvarner philvarner commented Oct 26, 2021

Related Issue(s): #222

Proposed Changes:

  • Filter Extension updates to align with changes to OAFeat CQL2 spec
  • Updated all "CQL" usages to "CQL2"
  • Most conformance class URIs are now prefixed with http://www.opengis.net/spec/cql2/ instead
    of http://www.opengis.net/spec/ogcapi-features-3/
  • Conformance classes http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/basic-cql,
    http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/cql-text, and
    http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/cql-json have had cql replaced
    with cql2 (in addition to the prefix change) to
    become http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2,
    http://www.opengis.net/spec/cql2/1.0/conf/cql2-text, and
    http://www.opengis.net/spec/cql2/1.0/conf/cql2-json
  • Significant changes to CQL2 JSON format, now using op and args structure
  • Spatial operator INTERSECTS is now S_INTERSECTS
  • Temporal operator ANYINTERACTS is now T_INTERSECTS
  • Updated Example 3 (now Example 5) to make it clear that property to property comparisons require the
    Property-Property Comparisons conformance class
  • Added CQL2 Case Insensitive Comparison
    (http://www.opengis.net/spec/cql2/1.0/conf/case-insensitive-comparison) conformance class
    that adds functions LOWER and UPPER for case-insensitive comparison

PR Checklist:

  • This PR is made against the dev branch (all proposed changes except releases should be against dev, not master).
  • This PR has no breaking changes. THIS PR HAS BREAKING CHANGES
  • This PR does not make any changes to the core spec in the stac-spec directory (these are included as a subtree and should be updated directly in radiantearth/stac-spec)
  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

@philvarner philvarner changed the base branch from master to dev October 26, 2021 16:43
@philvarner philvarner changed the title Updates to CQL 2 Updates to CQL2 Oct 27, 2021
@philvarner philvarner marked this pull request as ready for review October 27, 2021 13:05
@philvarner philvarner changed the title Updates to CQL2 Updates to Filter Extension for CQL2 Oct 27, 2021
@jisantuc
Copy link
Contributor

jisantuc commented Nov 1, 2021

Should review here wait on the symbolic operators change upstream?

@philvarner
Copy link
Collaborator Author

Should review here wait on the symbolic operators change upstream?

My understanding is that the current published spec allows either symbolic or alphabetic, and that's changing to only allow symbolic, so these are currently valid wrt that.

@m-mohr
Copy link
Collaborator

m-mohr commented Nov 27, 2021

Quickly looked at it and looks good to me, but I leave the full review and final approval up to an implementor.

@m-mohr m-mohr removed their request for review November 27, 2021 16:23
@bitner
Copy link
Collaborator

bitner commented Dec 1, 2021

Looking good @philvarner!

I think it would be good to include examples for BETWEEN, IN and the use of UPPER/LOWER.

Having these examples is really helpful when building things out and also gives a great starting place for building out tests (ie these are used directly in the pgstac tests in the PR for adding CQL2 support)

@philvarner
Copy link
Collaborator Author

@bitner Added some examples for BETWEEN, IN, LIKE, UPPER, and LOWER. If you accept the invite for this repo, you may be able to approve the PR. Otherwise, @m-mohr or @cholmes, would you approve it based on @bitner's comments?

"op": "eq",
"args": [
{
"function" : "lower",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So upper and lower are implemented as "function" not with "op"?

As these are standard, shouldn't they use "op"? My impression is that "function" was for platform defined functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. They're not operators since they don't return a boolean value -- they return a string value. However, I looked it up in the spec and I did define them wrong -- they're not operators or functions, they're a separate thing, which is confusing, because the text syntax is exactly the same as if they were functions. I'll update the examples.

The spec is here:
https://github.com/opengeospatial/ogcapi-features/blob/b752479d850c52f372c4164202f041ecbe906e46/cql2/standard/schema/cql2.json

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to ask the CQL2 folks about this, because it seems like it would be simpler if it was just a pre-defined function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@philvarner philvarner Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, so this is changing in CQL2 opengeospatial/ogcapi-features#641

UPPER/LOWER will be replaced with a function CASEI

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking at CASEI, I have some significant concerns about it. I'm just going to yank it for beta.5, and re-add after it's stabilitzed in CQL2. I wrote up the concerns here if you're interested
opengeospatial/ogcapi-features#641 (comment)

@philvarner philvarner merged commit b379265 into radiantearth:dev Dec 3, 2021
@philvarner philvarner deleted the cql2 branch December 3, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants