-
-
Notifications
You must be signed in to change notification settings - Fork 283
add support for feature/record domain queries #1988
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
Conversation
do you have a link to that discussion, from the code i understand the domains method returns the unique domain values for each of the properties of records in the records collection.
|
There will be an issue in OGC API - Records shortly, and I will link it here. Note that this PR, given updated discussion, now provides this functionality in
In theory it shouldn't matter. From a pygeoapi perspective, the default providers with this support are simply operating on the underlying data. A custom provider plugin can exercise more control as required.
OGC API - Records - Part 2: Facets is more about aggregations/computes based on search results, vs. describing a collection's queryables/live enums. |
pygeoapi/provider/tinydb_.py
Outdated
@@ -370,6 +370,24 @@ def get_fields(self): | |||
|
|||
return fields | |||
|
|||
def get_domains(self, properties=[], urrent=False) -> tuple: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
ae6a399
to
61c60e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this really cutting edge feature! 👍🏽
- I am not sure where this is documented, but if there is a place maybe it is worth leaving a link to it in the pygeoapi docs.
- This is kind of a low level thing, being very implementation specific. I realised the success of this functionality is also deployment specific; in the case of elasticsearch, it will fail to get the domains if the mappings are not done in a certain way. But I guess this is a best effort from the server.
|
||
for key, value in response['aggregations'].items(): | ||
if self.fields[key]['type'] in ['string', 'number']: | ||
values = [x['key'] for x in value['buckets']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that elastic fails to do the aggregation of strings, when fields are not mapped as raw, but I guess this is too specific of the index, not much we can do. Something to keep in mind, though.
This fails:
"namealt": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
this works:
"nameascii": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the associated GitHub issues can now be found per below: |
Overview
This PR adds support for OGC API - Features and OGC API - Records domains within
/collections/{collectionId}/queryables
), as per OGC API - Features - Part 5: Schemas, and as discussed during last week's OGC Standards Code Sprint. The feature is driven by the OGC API - Records SWG discussion, but also applies to OGC API - Features.Related Issue / discussion
Additional information
See discussion in OGC API - Records / OGC API - Features SWGs:
Note that functionality may be updated in the future.
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)