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

Feature Collection caching + bugfix for CQL context #307

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

recalcitrantsupplant
Copy link
Collaborator

@recalcitrantsupplant recalcitrantsupplant commented Nov 15, 2024

  • adds caching of Feature Collection query (the details of a feature collection are required to be included in the GeoJSON response for each page of a /items response, so the same Feature Collection query is called repeatedly. A 10 minute cache has been added with aiocache.
    • While caching may still be used in future, the query performance will be improved by converting the blank node selection blocks to equivalent UNION clauses.
  • add JSON LD context back to the CQL queries. This is to work with the existing implementation of CQL -> SPARQL. As the test cases from OGC contained no URIs, a JSON LD context was applied to them to create URIs for testing against RDF. While this was helpful to have a reference set of test cases, it has caused other issues in parsing and would in hindsight be better left out.
  • update the rdf2geojson version, the latest version addresses these bugs:
  1. langStrings, my converter didn't detect a langstring as a string, so it treated it as a datatype literal, but there was no datatype, so it returned None.
  2. Custom data types (like strings with source ID types etc) They now serialize to a nice little map with {"datatype": x, "value": y }
  3. Numeric literals, there was a else statement that was supposed to treat eveything with a numeric datatype as a python object, to serialize out, but a bug prevented that from working, so numeric literals returned None.

@lalewis1
Copy link
Collaborator

Seems to work OK for me locally.

Should we include a statement in the ogc features readme, noting that these results may be cached?

I'll look into that failing ogc features test.

@recalcitrantsupplant
Copy link
Collaborator Author

Re caching yes... we should generally note in the documentation what things are cached, I think it's there for others, will update

Copy link
Collaborator

@lalewis1 lalewis1 left a comment

Choose a reason for hiding this comment

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

thanks looks good :)

@recalcitrantsupplant recalcitrantsupplant merged commit d2ef2d9 into main Nov 20, 2024
1 check passed
@recalcitrantsupplant recalcitrantsupplant deleted the david/cql-context-bugfix branch November 20, 2024 04:09
Copy link

🎉 This PR is included in version 4.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants