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.

The local CKAN stack lives in infra/; VM deployment intent lives in the sibling ../infra Ansible repository.


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

  • 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

The CKAN dev stack is included here:

cd infra
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 infra/Dockerfile. OIDC credentials are the deliberate runtime exception; prerun.py writes the enabled plugin list.

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

Release

Create an immutable version tag. Its pipeline publishes the CKAN image; update the pinned image tag in ../infra, then run the full infra deploy for the target environment. Agents can use gl-token for the GitLab tag and merge request.


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.2.0.tar.gz (247.4 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.2.0-py3-none-any.whl (228.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ckanext_marinerg-0.2.0.tar.gz
  • Upload date:
  • Size: 247.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 d0dfab31bbb33a5ac80eb0090bcc636f450629e911184b3de46dc0dc89e9a2a9
MD5 77c7f482de18a0f758b927d28ca0a428
BLAKE2b-256 f97afc90e0a88e8da5ffedf330d45ad70149111638d903f255f4155dc1fd88ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ckanext_marinerg-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03eb51a24e50358dc9b4929d174e72b79a8a35ff4222e1059fd17dc419c71974
MD5 380b5dbb50c3b8e66d53e2cfac0bd66d
BLAKE2b-256 afb5702689e9901a80c4237c5e4023787c93d8f202862ff665248b8725303592

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