Skip to main content

marinerg-schema

The MARINERG-i dataset metadata model, as a package.

marinerg_dataset.linkml.yaml (LinkML) defines the marine metadata fields and their controlled vocabularies. Everything else in the estate is a projection of it: the CKAN catalogue's form and validators, and the facility client's pre-publication checks.

It is a package because it has more than one consumer. It used to live inside the CKAN extension, and each consumer kept its own copy — a hand-written field list in marinerg-data, enum values restated in CKAN's form schema. Copies drift silently, and these had: the field list was three fields behind.

Install

pip install marinerg-schema

Use

from marinerg_schema import permitted_values, concept_uri, dataset_slots
from marinerg_schema.ckan import field_names

permitted_values("processing_level")   # frozenset({'L0', 'L1', 'L2', 'L3', 'L4'})
concept_uri("processing_level", "L1")  # 'http://vocab.nerc.ac.uk/collection/EPL/current/L1/'
dataset_slots()                        # the model's fields, in model order
field_names()                          # the keys a CKAN dataset takes top-level

registry_path() returns the generated registry YAML for consumers that want a file rather than the API.

Consumers

Repo What it takes
ckanext-marinerg Vocabularies for its validators and RDF export; its form schema is gated against the model
marinerg-data Vocabularies to check a bundle before a DOI is minted; the CKAN field set to build a package

Predecessor

This model succeeds the MaRINET2 metadata schemas at github.com/Marinet2/metadata-schema (2020, registered at FAIRsharing bsg-s001497) — the dataset schema here, and MaRINET2's datastream schema by marinerg-data's run-manifest schema.

A successor, not a replacement: MaRINET2's schemas are the consortium-familiar backbone, and "Marinet2 NetCDF 0.1" stays a declared value in the conventions list. That repository is outside this group and still reads as current guidance, so a status banner there and a successor relation on its FAIRsharing record have to be requested from its owners.

Change the model

Edit the LinkML file, then regenerate the registry — never hand-edit it:

uv run python -m marinerg_schema
uv run python -m marinerg_schema --check   # what CI runs

A vocabulary change is a release: cut one, then move the consumers' pins. version: inside the LinkML file is the model's version and moves independently of the package's.

Develop

uv sync --group dev
uv run pytest
uv run ruff check src tests
uv run mypy src

The package floor is Python 3.10 — CKAN 2.11's runtime — even though the client that also consumes it needs 3.11. Ruff targets 3.10 for the same reason.

Licence

Copyright ICHEC. MIT — see LICENSE.

Release files for marinerg-schema 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marinerg-schema 0.2.0
File Size Uploaded
marinerg_schema-0.2.0.tar.gz 19.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for marinerg-schema 0.2.0
File Interpreter ABI Platform
marinerg_schema-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.8 kB

Release files / marinerg_schema-0.2.0.tar.gz

Download URL marinerg_schema-0.2.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3f876814177379bcd0085561f7dac021401cb902ac31168646f9b3789f737467
BLAKE2b-256 checksum
How to use checksums
16f50c8b881da946abf9f3502030706c95b3cf5db8c629aa872e909f0230de87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / marinerg_schema-0.2.0-py3-none-any.whl

Download URL marinerg_schema-0.2.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1593184b2101dac748ee222db8b1b3e24364f3d7659b00486eff58f897bacc0a
BLAKE2b-256 checksum
How to use checksums
50ea1a0efb5bd883238548687bc625af7cc18b03b65b81d01844919640de8bdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page