Skip to content

Installation

Requirements

ckanext-relationship is intended for CKAN sites that already use ckanext-scheming.

The extension targets CKAN 2.10 and newer.

Runtime installation

Install the base extension in your CKAN virtual environment:

pip install ckanext-relationship

If you also want the admin dashboard, install the optional dashboard extra:

pip install "ckanext-relationship[dashboard]"

Source installation

git clone https://github.com/DataShades/ckanext-relationship.git
cd ckanext-relationship
pip install -e .

For the optional dashboard:

pip install -e ".[dashboard]"

Enable CKAN plugins

For the base relationship features, enable relationship and scheming_datasets:

ckan.plugins = ... relationship scheming_datasets ...

For the optional graph UI, also enable relationship_graph.

If you want the graph snippet on scheming dataset pages, keep relationship_graph before scheming_datasets so its template override wins:

ckan.plugins = ... relationship relationship_graph scheming_datasets ...

With relationship_graph enabled:

  • dataset read pages show the graph automatically by default
  • group About pages show it automatically by default when the current group has at least one relationship
  • organization About pages show it automatically by default when the current organization has at least one relationship

See Configuration and Graph for the exact behavior.

For the optional dashboard, also enable tables and relationship_dashboard:

ckan.plugins = ... relationship scheming_datasets tables relationship_dashboard ...

Run the database migration

Run the extension migration after installation:

ckan -c /etc/ckan/default/ckan.ini db upgrade -p relationship

Restart CKAN

Restart CKAN after changing plugins or running migrations. For example, on a typical Ubuntu/Apache deployment:

sudo service apache2 reload

Developer installation

To work on the extension locally:

git clone https://github.com/DataShades/ckanext-relationship.git
cd ckanext-relationship
pip install -e ".[docs]"
pip install -r dev-requirements.txt

If you are also working on the dashboard:

pip install -e ".[dashboard,docs]"

Building the documentation

Serve the docs locally:

mkdocs serve

Build the static site:

mkdocs build

Running tests

Run the test suite from the repository root:

pytest --ckan-ini=test.ini