Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CKAN CKAN

Semantic Tags

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.

Installation

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.txt

After installing the plugin, add semantictags to the plugins in your ckan.ini.

Configuration Options

  • ckanext.semantictags.ontologies the ontologies to use for semantic tag suggestions
    • Default: (none)
  • ckanext.semantictags.allow_free_tags whether to allow free-text tags in addition to ontology-based tags
    • Default: false
  • ckanext.semantictags.force_reload whether to force a reload of the ontologies on startup, instead of using the cached version
    • Default: false
  • ckanext.semantictags.tag_suggest whether to use the NFDI4Energy Annotator API for tag suggestions from the description
    • Default: false
    • Note: Currently, only energy-related ontologies are supported

Usage

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-tags

Replace 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.html

Commands

ckanext-semantictags offers the following commands, assuming $CKAN_INI is the path of your CKAN configuration file:

  1. init: initializes the ckanext-semantictags runtime data: sets up the database table, ensures default configuration options are set, and generates the tag vocabulary.
    ckan -c $CKAN_INI semantictags init
    Optionally, default values for allow_free_tags, force_reload, and tag_suggest can be set to true via 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

Changelog

If you are interested in what has changed, check out the changelog.

License

ckanext-semantictags is licensed under GPL-3.0, see the license file.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages