Domain Model/Vocabulary

From CKAN

Jump to: navigation, search

CKAN vocabularies are a way to organise tags into sets. A Vocabulary is a set of related tags, for example a "Genre" vocabulary might contain the tags "Jazz", "Rock" and "Pop", whereas a "Composers" vocabulary might contain the tags "Bach", "Wagner" and "Strauss". A dataset can be tagged with multiple tags from multiple vocabularies at once, for example a dataset might be tagged with "Fugue" in the "Genre" vocabulary and "Bach" in the "Composers" vocabulary. and may also have some free tags (tags which don't belong to any vocabulary) at the same time.

Schema

To add tags to a vocabulary you create tags with the vocabulary's id in their vocabulary_id fields, see Domain Model/Tag.

Code

The Vocabulary domain object: https://github.com/okfn/ckan/blob/master/ckan/model/vocabulary.py

Schema: default_vocabulary_schema() in https://github.com/okfn/ckan/blob/master/ckan/logic/schema.py

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox