With this plugin, you extend the dataset schema with multiple new dataset type schemas to comply with the scorewater/portal metadata structure. Every schema serves a different purpose in the SCOREwater portal UI.
This plugin includes schemas and thus the ckanext-scheming is a requirement for it to function properly.
To install ckanext-scorewater:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-scorewater Python package into your virtual environment:
pip install ckanext-scorewater
Add
scorewaterto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Enable the plugin by including it in the configuration options:
ckan.plugins = ... scorewater ...
Enable all scorewater schemas in the configuration options, to get a dropdown menu with several dataset schemas when creating a new dataset:
# For scorewater dataset multi-schemas: scheming.dataset_multi_schemas = ckanext.scorewater:scheming/multi_schemas/ckan-scorewater.json
These schemas are built to comply with the SCOREwater portal structure. There are 4 new dataset types declared, extending the default dataset:
- sensor
- service
- source
- supplier
and each of them have its own metadata structure, to take advantage of the SCOREwater portal's UI logic.
To install ckanext-scorewater for development, activate your CKAN virtualenv and do:
git clone https://github.com/CivityNL/ckanext-scorewater.git cd ckanext-scorewater python setup.py develop pip install -r dev-requirements.txt
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (pip install coverage) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.scorewater --cover-inclusive --cover-erase --cover-tests

