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

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. GNU AGPL v3 or later. Exemptions available for MARINERG-i project partners.

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.1.0.tar.gz (29.8 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.1.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: marinerg_schema-0.1.0.tar.gz
  • Upload date:
  • Size: 29.8 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.1.0.tar.gz
Algorithm Hash digest
SHA256 a0509ca4b6c79f31fc1cfb3a6a3a87c9a01021565fe669469f547842cfca12d5
MD5 e32591e6fb9891ff61d82227695a0bd0
BLAKE2b-256 2ea98d1eab6a333db6ab091197da89ea80d72ee7ffd8a611828af2f88c31e057

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marinerg_schema-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65cfec1b5ba0fcd6615b586658ff53aef405b2989e6bccc1990ea80838ef7f2d
MD5 c7f3ce4d8ad23e99f7375d989849173a
BLAKE2b-256 22d0925050b68d78a4f1dc2c50bc32d3779c7e42a054584410c91126f160313d

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