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.

Download files

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

Source Distribution

marinerg_schema-0.2.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

marinerg_schema-0.2.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: marinerg_schema-0.2.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for marinerg_schema-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f876814177379bcd0085561f7dac021401cb902ac31168646f9b3789f737467
MD5 deb5f1be0077a623a1d3c68421fc327a
BLAKE2b-256 16f50c8b881da946abf9f3502030706c95b3cf5db8c629aa872e909f0230de87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinerg_schema-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1593184b2101dac748ee222db8b1b3e24364f3d7659b00486eff58f897bacc0a
MD5 1145f6df25bd0ff0997ac4262ca27fa7
BLAKE2b-256 50ea1a0efb5bd883238548687bc625af7cc18b03b65b81d01844919640de8bdc

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