pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Explore custom JSON-LD templating

Open ksonda opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. @dblodgett-usgs and I have been working through how to use pygeoapi to render some fairly complicated JSON-LD (example). It is impossible to successfully create JSON-LD with nested properties/predicates from a rectangular data structure using the existing pygeoapi context configuration framework.

Describe the solution you'd like As an alternative to the context specification, I would simply like to be able to supply either a weblink or a local path to a JSON-LD template, something like this. With a full context and property structure, and "environmental variables" corresponding to fields from the pygeoapi data provider or rendered geojson properties for a given item. The geometry parts maybe don't need to be part of the template, but could inherit the current json-ld generator functions that auto-generate geosparql and schema:geo geometry depending on the geometry type.

Describe alternatives you've considered The alternative would be to make context specification much more complex, allowing for nested properties. but the wisdom of allowing arbitrary complexity in the config yaml file vs just a dedicated template is lost on me.

Additional context @alpha-beta-soup @tomkralidis @pvgenuchten @webb-ben may be interested. Not sure if this has consequences for api.py refactor.

ksonda avatar Dec 09 '21 20:12 ksonda