Extension Topics


Extension Basics

Title
Topics
Name
ckanext-topics
Type
Public extension
Description
Topics and subtopics for classifying datasets in CKAN
CKAN versions
Download-Url (zip)
Last commit
4 years ago (2021-07-13 05:15:16)
Url to repo
Category
Visualization & Analytics


Background Infos

Description (long)
Show details

ckanext-topics

Topics and subtopics for classifying datasets in CKAN. Tested for CKAN 2.7.2

Features

This extension provides mechanisms for classifying your datasets in a hierarchy of topics and subtopics. This topics will appear under the Additional info of the dataset:

Dataset Show

Topics and subtopics can be assigned to a datasets in its edit page. The available subtopics will be filtered by the selected topic:

Dataset Edit

Then you can filter search results by a specific topic or subtopic:

Search Filter

Sysadmins can view the complete list of topics and edit them:

Topic Index

Topic Edit

Reordering of topics and subtopics is available, but is a bit tedious to do (see Limitations and tradeoffs)

Limitations and tradeoffs

When we started the implementation of this features, we had two possible approaches:

  1. Create a new model to support topics and subtopics, with the associated complexity of managing database migrations, taking care of the faceted search etc.
  2. Adapt existing CKAN features for this purpose. In this case Tag Vocabularies

We opted for 2, which had the following advantages and disadvantages:

Advantages

  • We didn’t have to bother about adding a new model to CKAN, creating its database table, indexing this new model in Solr etc.
  • Faceted search was pretty easy to implement.

Disadvantages

The Tag Vocabularies feature is not prepared to support making a hierarchy of them, nor ordering. We have two tag vocabularies, one for topics and other for subtopics:

“` ckan_default=# select * from vocabulary; id | name ————————————–+—————— 69f6965b-5fb1-4736-b4

Version
Version release date
(not set)
Contact name
Populate
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

Follow the regular procedure for installing CKAN extensions:

  1. Clone the repository in /usr/lib/ckan/default/src/ (or equivalent)
  2. Install the extension:
. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckanext-topics
python setup.py develop
  1. Add the topics plugin to the ckan.plugins line in the .ini configuration file.
  2. To create the custom_topics and custom_subtopics vocabularies, and fill them with some sample topics and subtopics, you can lo
Plugins to configure (ckan.ini)
topics
CKAN Settings (ckan.ini)
# ckan_default=# select * from vocabulary;
DB migration to be executed
upgrade
<< back to Extensions