-
-
Notifications
You must be signed in to change notification settings - Fork 279
Support GeoJSON-LD templating #1927
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
I would suggest to add at least a basic test for this to make sure that it's not broken by accident in the future. |
Added some general tests for |
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.
Change requests to be applied pending #1943
Create `item_list.jsonld` template to backport current /items json-ld content offerings
c73b5b6
to
ccf5def
Compare
@tomkralidis ported the JSON-LD templating over to use the HTML template structure. Ready for re-review. |
f3128b0
to
4f83a7b
Compare
4f83a7b
to
9fecb89
Compare
This reverts commit 5b371b2.
…er (geopython#1953)" This reverts commit 4f90235. Revert "explicitly define init of BaseProvider (geopython#1972)" This reverts commit ee370fb. Revert "Fix conformance class URIs (geopython#1967)" This reverts commit 94b0b3d. Revert "Fix 'type' member of the rel=http://www.opengis.net/def/rel/ogc/1.0/schema link (geopython#1968)" This reverts commit 24dc072. Revert "Update openapi.py (geopython#1966)" This reverts commit 00b1445. Revert "Include JSON-LD documents in manifest (geopython#1963)" This reverts commit b616fb0. Revert "Support GeoJSON-LD templating (geopython#1927)" This reverts commit 9d60950. Revert "- gracefully catch missing tiles in wmts facade (geopython#1960)" This reverts commit 3a9d853. Revert "Directly render EDR JSON in HTML (geopython#1955)" This reverts commit 7168828. Revert "Gracefully catch tile not found (geopython#1937)" This reverts commit f794d67.
* Remove sitemap * Set Graph endpoint as env variable * Update json-ld template locations implements geopython/pygeoapi#1927 * Delete snap.png * Create terraform deployment for required services * Create terraform deployment for required services * Fix templates * Update pygeoapi.config.yml * Update pygeoapi.config.yml * Condense mainstem query * Limit HTML to only show top 100 graph results * Limit to 100k datasets on a mainstem
Overview
Building on the capacity introduced in #868 and #1858, the PR migrates GeoJSON-LD rendering to always use Jinja2 templates. The default templates provide the same functional JSON-LD output as pygeoapi currently outputs. With the addition of dataset level templating, custom JSON-LD can be rendered for an GeoJSON Feature or GeoJSON Feature Collection by implementing the appropriate template.
This allows us to also un-next the
context
block from a resource configuration, seeeing as the only specific configuration for linked-data is now just the context block.Finally, serialization of geojsonld was moved inside geojson2gejsonld to reduce the number of times the json is serialized and the align with the function's docstring.
Related Issue / discussion
Additional information
In theory it is possible this type of behavior could be subsumed by a jinj2 formatter plugin - not sure how plugin formatters interact with the default HTTP types pygeoapi deals with (HTML, JSON, JSON-LD)
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)