ckanext-semantictags is a CKAN extension that adds support for ontology-backed keywords for your datasets.
The extension reads the ontologies from the TIB-hosted Terminology Service.
Note
ckanext-semantictags uses the NFDI4Energy Annotator API for tag suggestions from the description which only supports energy-related ontologies at the moment.
As usual for CKAN extensions, you can install ckanext-semantictags as follows:
git clone git@github.com:SDM-TIB/ckanext-semantictags.git
pip install -e ./ckanext-semantictags
pip install -r ./ckanext-semantictags/requirements.txtAfter installing the plugin, add semantictags to the plugins in your ckan.ini.
ckanext.semantictags.ontologiesthe ontologies to use for semantic tag suggestions- Default: (none)
ckanext.semantictags.allow_free_tagswhether to allow free-text tags in addition to ontology-based tags- Default:
false
- Default:
ckanext.semantictags.force_reloadwhether to force a reload of the ontologies on startup, instead of using the cached version- Default:
false
- Default:
ckanext.semantictags.tag_suggestwhether to use the NFDI4Energy Annotator API for tag suggestions from the description- Default:
false - Note: Currently, only energy-related ontologies are supported
- Default:
In order to initialize the extension, add the following to your start-up scripts, assuming $CKAN_INI is the path of your CKAN configuration file:
ckan config-tool -s app:main $CKAN_INI "ckanext.semantictags.ontologies = YOUR_ONTOLOGY_SHORT_NAME"
ckan -c $CKAN_INI semantictags init --free-tagsReplace YOUR_ONTOLOGY_SHORT_NAME with the short name(s) of the ontology/ontologies you want to use, e.g. oeo for energy systems research related terms.
If you are using ckanext-scheming, change your tag_string field declaration to:
- field_name: tag_string
label: Tags
form_snippet: form_snippets/semantictags_autocomplete.htmlckanext-semantictags offers the following commands, assuming $CKAN_INI is the path of your CKAN configuration file:
init: initializes theckanext-semantictagsruntime data: sets up the database table, ensures default configuration options are set, and generates the tag vocabulary.Optionally, default values forckan -c $CKAN_INI semantictags initallow_free_tags,force_reload, andtag_suggestcan be set totruevia flags. These are only applied if no value was previously set in the CKAN configuration — existing configuration values take precedence.ckan -c $CKAN_INI semantictags init --free-tags --force-reload --tag-suggest
If you are interested in what has changed, check out the changelog.
ckanext-semantictags is licensed under GPL-3.0, see the license file.