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
The measured-parameter vocabulary says what a data channel measures. A facility template names each channel's parameter by its code:
from marinerg_schema import parameter, parameters
parameter("wind_speed").unit # 'm s-1', as UDUNITS
parameter("wind_speed").cf_standard_name # 'wind_speed'
parameter("roll").cf_standard_name # None: no verified CF name
A CF or NERC mapping is filled only where the term was checked to exist. Lab and device quantities, such as mooring-line tension, often have none yet.
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.
Metadata
Release files for marinerg-schema 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| marinerg_schema-0.3.0.tar.gz | 24.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| marinerg_schema-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.6 kB
Release files / marinerg_schema-0.3.0.tar.gz
| Download URL | marinerg_schema-0.3.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9ccb38d93c509e408bd779d57bc1371c51df228d65158cb734b26df491b5225
|
|
BLAKE2b-256 checksum How to use checksums |
87674c66249c171641dec7fc986abd32080c74497db8063c9c1ee29a82b223da
|
| 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.3.0-py3-none-any.whl
| Download URL | marinerg_schema-0.3.0-py3-none-any.whl |
|---|---|
| Size | 22.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
534e923791e074e0b25921b27825a953d7988c6472711a71a0441c3999978aca
|
|
BLAKE2b-256 checksum How to use checksums |
7c522236a450255308aafe0859f34a6ea48f2032caec07cf6dbedb0573dab28c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|