Skip to main content

ckanext-marinerg

CKAN extension for the MARINERG-i data catalogue. Part of the MARINERG-i e-infrastructure — a Distributed Research Infrastructure supporting Marine Renewable Energy (MRE) test facilities across the EU.

Companion to the data-access-service repo, which contains the Docker compose stack, Django facility service, and planning documents.


Features

Marine metadata schema

Custom CKAN scheming fields on top of the standard dataset form:

Field Description
zenodo_doi DOI entry with "Prefill from Zenodo" button
publication_date YYYY-MM-DD
visibility public / private / restricted — controlled vocab
access_scope open / org_members / on_request — controlled vocab
data_mode Raw / Provisional / Delayed-mode / Mixed — MARINERG-i vocab
source_kind zenodo / datacite / manual / synthetic — MARINERG-i vocab
feature_type CF DSG feature type — MARINERG-i SKOS vocab
processing_level EMODnet EPL level (L0–L4) — NERC NVS EPL vocab
coordinate_reference_system EPSG code or CUSTOM — NERC NVS L10 vocab
site Named test site / location
time_coverage_start / time_coverage_end Data collection period
facility_ref Stable facility PID — ROR URI preferred, portal URL fallback
facility_name Display name of selected facility
equipment_name Name of selected equipment

Zenodo prefill

Server-side CKAN action (marinerg_zenodo_prefill) triggered by DOI entry. Fetches DataCite/InvenioRDM metadata from Zenodo using an optional API key held in CKAN server config and pre-populates the creation form. Handles both the current InvenioRDM format and the legacy Zenodo API format.

Facility/equipment picker

Two-dropdown form widget that calls the Django facility service to populate contextual selections. Resolves each facility to a stable PID (ROR URI preferred; portal URL fallback) — internal Django API URLs are never written to dataset records.

Controlled vocabulary validators

All controlled fields are validated at submission time against registry/controlled-metadata.yaml, which is auto-generated from the LinkML schema (schema/marinerg_dataset.linkml.yaml). Values not in the registry are rejected. Each code has a corresponding concept URI emitted in RDF export.

Vocabulary sources:

  • processing_level → NERC NVS EPL (cached in registry/nerc_cache/EPL.yaml)
  • coordinate_reference_system → NERC NVS L10 (cached in registry/nerc_cache/L10.yaml)
  • feature_type, access_scope, data_mode, source_kind, visibility → MARINERG-i SKOS vocab
  • euroscivoc → EuroSciVoc (EU Science Vocabulary; cached in registry/euroscivoc_cache.yaml)
  • gcmd_keyword → NASA GCMD Science Keywords (cached in registry/gcmd_keyword_cache.yaml)
  • source_repository → re3data registry (cached in registry/source_repository_cache.yaml)
  • license_id → SPDX 3.x (cached in registry/spdx_cache.yaml; served via licenses_group_url)

The EOSC-vocabulary label caches are refreshed from their authorities with python scripts/fetch_eosc_vocabs.py (URIs stay single-sourced in the LinkML schema).

DCAT-AP 3.0 RDF export

ckanext-dcat is installed; MarinergDCATProfile stacks on euro_dcat_ap_3. Custom mappings:

  • visibilitydct:accessRights (EU Publications Office vocab)
  • facility_ref / facility_namedct:publisher (ROR URI as foaf:homepage)
  • authordct:creator; author_emaildcat:contactPoint (restricted datasets only)
  • zenodo_doidct:identifier + adms:identifier (the DOI is the dataset's sole identity; no owl:sameAs)
  • publication_datedct:issued
  • feature_typedcat:theme (MARINERG-i concept URI)
  • euroscivocdcat:theme (EuroSciVoc concept URIs); gcmd_keyworddct:subject (GCMD concept URIs)
  • source_repositorydct:source (re3data repository URI)
  • processing_leveldqv:hasQualityAnnotation with NERC EPL concept URI
  • coordinate_reference_systemdct:conformsTo (NERC L10 URI or Literal)
  • sitedct:spatial; time_coverage_start/enddct:temporal

Endpoints: /catalog.rdf, /catalog.ttl, /catalog.n3, /catalog.jsonld and per-dataset equivalents.

FAIR Signposting

Dataset landing pages (/dataset/<name>) carry a typed HTTP Link header (FAIR Signposting Profile), added by an IBlueprint app-wide after_request hook (signposting.py):

  • cite-as → the DOI (canonical citation)
  • describedby → the .ttl / .jsonld / .rdf DCAT serialisations (with media types)
  • typedcat:Dataset + schema.org/Dataset
  • author → ORCiD URI (when recorded), license → licence URL, item → each distribution

Machine-navigable without OAI-PMH or SPARQL; assessed by F-UJI and expected by EOSC harvesters. Ref: ../data-access-service/docs/eosc-roadmap.md §2.9.

CKAN theming

Custom header (MARINERG-i logo), colour scheme (--marinerg-primary: #003964), favicon, background imagery.


Planned

  • Keycloak SSOckanext-oidc-pkce against ICHEC Keycloak; JIT user creation; group membership from JWT claims
  • NERC P01 parameters — discipline-filtered allowlist; instrument/parameter linking
  • SeaDataNet device categories (L05) — upgrade equipment_name from free text to controlled picker
  • DataCite export — same schema and vocab registry; DOI registration
  • OAI-PMH endpoint — for EOSC/B2FIND harvesting
  • MARINERG-i VO — EOSC Virtual Organisation for consortium-level access policies

Local development

This repo is a sibling of data-access-service/. The CKAN dev stack lives there:

cd ../data-access-service/infra/ckan
docker compose -f compose.yml -f compose.local.yml up -d --build
# CKAN at http://localhost:5001  (port 5000 is owned by Docker Desktop's gvproxy)
# Login: ckan_admin / ckan_admin

compose.local.yml mounts this repo into the container at /srv/app/src/ckanext-marinerg. Python and template changes are live immediately. Only dependency changes need a rebuild.

Facility service

The facility/equipment picker calls the Django facility service. For local dev it should be running on port 8000. The CKAN image has http://host.docker.internal:8000 baked in at build time — Docker resolves this to the Mac host from inside the container.

Running tests

python -m venv .venv
.venv/bin/pip install -e ".[test]"
.venv/bin/python -m pytest tests/ -v

All tests run without a CKAN installation — conftest.py stubs ckan.plugins.toolkit so pure action/model/validator logic can be tested directly.

Linting and formatting

tox -e format_check   # check (CI)
tox -e format_apply   # apply
tox -e style          # flake8
tox -e type           # mypy
tox -e registry       # check controlled-metadata.yaml is in sync with the LinkML schema

Vocabulary cache scripts

Run these manually (or on a schedule in CI) to update pinned snapshots. Commit the diff after reviewing.

# NERC NVS collections (EPL processing levels, L10 CRS)
python scripts/fetch_nerc_vocabs.py

# SPDX license list
python scripts/fetch_spdx_licenses.py

# Regenerate controlled-metadata.yaml from the LinkML schema (also run by `tox -e registry`)
python scripts/generate_registry.py

CKAN config keys

Baked into ckan.ini at image build time via RUN ckan config-tool in data-access-service/infra/ckan/Dockerfile. Do not rely on runtime env vars — prerun.py only writes ckan.plugins.

Key Default Purpose
scheming.dataset_schemas Path to the marine dataset schema
ckanext.dcat.rdf.profiles euro_dcat_ap_3 marinerg_dcat RDF profile stack
marinerg.zenodo_api_key "" Zenodo API key for prefill (optional)
marinerg.facility_api_url http://host.docker.internal:8000 Django facility service base URL
marinerg.facility_api_token "" Token for authenticated facility API access
marinerg.portal_base_url http://localhost:5001 Fallback facility PID base when no ROR ID

Licence

Copyright ICHEC. GNU AGPL v3 or later.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_marinerg-0.1.1.tar.gz (241.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_marinerg-0.1.1-py3-none-any.whl (224.4 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_marinerg-0.1.1.tar.gz.

File metadata

  • Download URL: ckanext_marinerg-0.1.1.tar.gz
  • Upload date:
  • Size: 241.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for ckanext_marinerg-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a7b8a8feddf75f5840241c73488b8da750dd56ef17928358007f3e24d6bec51
MD5 8d7e13ddbdf4f7fc4ae2abb1373de937
BLAKE2b-256 c55df7f5ae44c302e5aa40623e61b1bcddadec54223c07cbe36ffddb0fa77e71

See more details on using hashes here.

File details

Details for the file ckanext_marinerg-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_marinerg-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec892b11b4b14a37f59f0eec3ed622e5de1d494bd97e0491865689c20bde0e97
MD5 d4dfbf3f5930db77c1e9ce0cdb850bec
BLAKE2b-256 8987771bdd502f0f6d094760b107208b75235d04cb4f828c8f74babc2f024caa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page