ckanext-marinerg
CKAN extension powering the MARINERG-i data catalogue — the data catalogue for the MARINERG-i e-infrastructure, a Distributed Research Infrastructure for Marine Renewable Energy (MRE) test facilities across the EU. On top of stock CKAN it adds a marine metadata schema, controlled-vocabulary validation, Zenodo/DOI prefill, a facility/equipment picker, DCAT-AP 3.0 + FAIR Signposting export, Keycloak OIDC login, and MARINERG-i theming.
Building a similar CKAN integration? This README is a map of how it works and where things live. The exhaustive field list, DCAT mappings, and vocabulary architecture are not repeated here — they are generated from the schema and documented in
docs/.
How it works
Everything hangs off a standard CKAN plugin, ckanext/marinerg/plugin.py, which implements a
handful of CKAN interfaces:
| Interface | What it does | Code |
|---|---|---|
IConfigurer |
Registers templates, theme assets, and the scheming dataset schema | plugin.py + templates/, assets/ |
IValidators |
Rejects values outside the controlled vocabularies at save time | validators.py |
IActions |
marinerg_zenodo_prefill, marinerg_facility_list, marinerg_equipment_list |
actions.py |
IBlueprint |
FAIR Signposting Link headers on dataset pages |
signposting.py |
IClick |
Maintenance CLI commands | cli.py |
Two other pieces are registered through CKAN config rather than a plugin interface:
- DCAT-AP 3.0 export —
MarinergDCATProfile(profile.py) stacks oneuro_dcat_ap_3viackanext.dcat.rdf.profiles, adding/catalog.{rdf,ttl,jsonld}and per-dataset serialisations. - Keycloak OIDC — login and role mapping in
oidc_plugin.py/oidc_roles.py/oidc_redirect.py. - A second small plugin,
marinerg_metrics(metrics.py), exposes a Prometheus metrics endpoint.
The metadata model is defined once
schema/marinerg_dataset.linkml.yaml (LinkML) is the single
source of truth for the marine metadata fields and their controlled vocabularies. From it,
scripts/generate_registry.py produces the controlled-vocabulary registry
(ckanext/marinerg/registry/controlled-metadata.yaml) that the validators enforce and the RDF
export cites. Edit the schema, then regenerate — never hand-edit the registry. tox -e registry
(and CI) fails if the two drift.
Where things live
| Path | Contents |
|---|---|
ckanext/marinerg/plugin.py |
Plugin entry points / CKAN hooks — start here |
ckanext/marinerg/actions.py |
Zenodo prefill + facility/equipment lookups (calls the Django facility service) |
ckanext/marinerg/validators.py |
Controlled-vocabulary validation |
ckanext/marinerg/profile.py |
DCAT-AP 3.0 RDF mappings |
ckanext/marinerg/signposting.py |
FAIR Signposting Link headers |
ckanext/marinerg/oidc_*.py |
Keycloak OIDC login + role mapping |
ckanext/marinerg/templates/ |
Theme overrides — header, footer, scheming form/display snippets |
ckanext/marinerg/assets/ |
Theme CSS (marinerg-theme.css) + webassets bundle |
ckanext/marinerg/public/ |
Logos, favicon, background imagery |
ckanext/marinerg/registry/ |
Generated vocabulary registry + cached authority labels |
schema/ |
The LinkML metadata model (source of truth) |
scripts/ |
Registry generation + vocabulary-cache refresh scripts |
infra/ |
Local CKAN stack (compose) and the production image (Dockerfile) |
docs/ |
Metadata-model & vocab-architecture references, EOSC roadmap, C4 diagrams |
tests/ |
Pytest suite (stubs CKAN — no CKAN install needed) |
Run it locally
cd infra
docker compose -f compose.yml -f compose.local.yml up -d # or: podman compose ...
# CKAN → http://localhost:5001 (login: ckan_admin / ckan_admin)
compose.local.yml mounts this repo into the container, so Python and template edits are picked up
live — restart the ckan service to reload cached Jinja templates; only dependency changes need
--build. The facility/equipment picker calls the Django facility service, expected on
http://localhost:8000 (the image resolves it as http://host.docker.internal:8000).
Develop
python -m venv .venv && .venv/bin/pip install -e ".[test]"
.venv/bin/python -m pytest tests/ -v # tests stub ckan.plugins.toolkit — run under plain pytest
tox -e format_check # Black (format_apply to fix)
tox -e style # flake8
tox -e type # mypy
tox -e registry # fails if the registry has drifted from the LinkML schema
python scripts/generate_registry.py # regenerate the registry after a schema change
Vocabulary label caches (NERC NVS, SPDX, EuroSciVoc, GCMD, re3data) are pinned snapshots refreshed
by the scripts/fetch_* scripts; run them manually and commit the reviewed diff.
Configuration
Marinerg config keys are baked into ckan.ini at image-build time (ckan config-tool in
infra/Dockerfile); OIDC credentials and ckan.plugins are the deliberate
runtime exceptions.
| Key | Purpose |
|---|---|
marinerg.zenodo_api_key |
Optional Zenodo API key for DOI prefill |
marinerg.facility_api_url |
Django facility service base URL |
marinerg.facility_api_token |
Token for authenticated facility API access |
marinerg.portal_base_url |
Fallback facility PID base when a facility has no ROR ID |
Release
Run a pipeline with RELEASE_FIELD = patch / minor / major. The tag it creates triggers
the pipeline that publishes the pip package and the CKAN container image. Pin that image tag in the
sibling ../infra repository, then run the infra deploy for the target environment.
Roadmap
NERC P01 parameters · SeaDataNet L05 device categories · DataCite export + DOI registration ·
OAI-PMH endpoint · MARINERG-i EOSC Virtual Organisation. Detail in
docs/eosc-roadmap.md.
Licence
AGPL-3.0-or-later — see LICENSE. Copyright © Irish Centre for High-End Computing
(ICHEC).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ckanext_marinerg-0.3.0.tar.gz.
File metadata
- Download URL: ckanext_marinerg-0.3.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9afa7535ddbb313471d442d51a4f6d6d46914bb4c3b6af16a63d1f752a3d029e
|
|
| MD5 |
8c57e94223485a2c433ca6635ee1fc1c
|
|
| BLAKE2b-256 |
4352122b84f13ac5b26c494121063f715c4682fe1026c01df8e2fcc6c57117ca
|
File details
Details for the file ckanext_marinerg-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ckanext_marinerg-0.3.0-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4e5a506507932376f9093ea60387bd573c256ba7782344107b4f0d1b4101bb7
|
|
| MD5 |
bd75cb6dc9592f2b3e9af066de210b2a
|
|
| BLAKE2b-256 |
c1327ae1b0eb61353ccfd77d5d379c4c58e30d335e3cb2ec310f444ce56f2413
|