Closed metaodi closed 6 years ago
I found a way to check if a helper function is defined.
In https://github.com/ckan/ckan/pull/3042 an excpetion was added to the helper dictionary, so it's no longer possible to simply use {% if h.structured_data %}
in jinja, as this triggers an exception. But calling h.get()
seems to do the trick:
{% if helper_dict.get('structured_data') %}
{{ h.structured_data()|safe }}
{% endif %}
Unfortunately the approach I described above does not work in older versions of CKAN (<2.6), because earlier versions of jinja do not support the use of dict(). Therefore I added another template helper to check if a helper is available or not.
I rebased this PR to master to fix the merge conflicts.
@amercader ping, can you review this PR?
sorry @metaodi, I'm a bit swamped right now but it's definitely on my list. Will try to review it this week.
This looks good @metaodi . Only one minor change in the README and we can merge.
@amercader I made the changes to the README and added the new config option for the RDF endpoints (+tests)
Thanks @metaodi, fantastic work as usual
This is worth a new release, I've released 0.0.7
Add schema.org mapping (see #75 for details)
This PR provides:
profiles
to the catalog and dataset endpoints to be able to change the profiles when requesting the metadata (this allows to server DCAT and schema.org on the same instance), example/dataset/my-dataset.jsonld?profiles=schemaorg