Verbatim JSON-LD injection feature#2171
Conversation
doublebyte1
left a comment
There was a problem hiding this comment.
Thank you so much for this contribution! 🙏🏽 I think it is a powerful enhancement of the current Linked Data capabilities in pygeoapi; it can also leverage the existing OGC building blocks , enabling users to not reinvent the wheel and to build upon this extensive work.
I am not sure these capabilities should live side by side with the current LD capabilities in pygeoapi, which do have some degree of overlap. To have two different code bases for LD support does not seem a robust approach, and it leaves to the users the burden to decide which one to use through a configuration flag.
If this would be to replace the existing approach, creating structured metadata for SEO would be one of the use cases. Would it be possible to use the inject_verbatim to generate the relevant information to be consumed by Search engine crawlers, providing a rich version of the webpage?
I am also not convinced that we should use JSON-LD in both JSON and JSON-LD encodings, even if it we are injecting a single tag; this may seem confusing to the users, and IMHO it breaks the content negotiation promise.
I think this PR deserves an issue to discuss the LD capabilities in pygeoapi, and I created one here: #2176
Looking forward to continue the discussion there.
Overview
This PR enables injecting JSON-LD context into both JSON and JSON-LD Features and STAC items, without applying any modifications to the JSON-LD version. This behavior is disabled by default, and has to be specifically enabled in the
linked-dataconfiguration section.Related Issue / discussion
Additional information
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)