Skip to main content

commonmeta-schema

Language-neutral JSON Schema definitions and conformance fixtures for Commonmeta, the scholarly metadata interchange format.

This repository is the shared source of truth consumed by the following Commonmeta implementations:

Keeping the schema and the golden fixtures in one place lets every implementation validate against the same contract and run the same cross-format conformance tests.

Layout

schemas/
  commonmeta_v1.0.json         # the Commonmeta JSON Schema (current)
fixtures/
  commonmeta/                  # canonical Commonmeta records (round-trip + expected output)
  <format>/                    # input fixtures in a given source format
  <format>_out/                # expected writer output (Commonmeta -> format)
  <format>_commonmeta/         # expected reader output for non-JSON inputs
  utils/                       # shared utility fixtures for helpers outside format conversion

Schema versions

Schemas are versioned by filename. The current version is commonmeta_v1.0.json, and the schema_version field of a Commonmeta record is the URL https://commonmeta.org/commonmeta_v1.0.json.

The packages export only v1.0. New versions are added alongside existing files rather than replacing them, so implementations can pin a version.

Fixture conventions

The conformance harness in each implementation follows these naming rules (a missing pair is skipped, so partial coverage is fine):

Test kind Input Expected
Round-trip fixtures/commonmeta/<name>.json itself (re-serialized, semantically equal)
Reader (JSON input) fixtures/<format>/<name>.json fixtures/commonmeta/<name>.json
Reader (text input) fixtures/<format>/<name>.<ext> fixtures/<format>_commonmeta/<name>.json
Writer fixtures/commonmeta/<name>.json fixtures/<format>_out/<name>.<ext>

Formats currently covered: crossref, crossref_xml, datacite, datacite_xml, schemaorg, csl, bibtex, cff, ris, inveniordm, codemeta, orcid, orcid_xml, openalex_source. Writer goldens exist for bibtex, crossref, csl and schemaorg.

CSL 1.0.2

The csl fixtures use CSL 1.0.2 variables, mapped as follows:

CSL variable Commonmeta
available-date dates.available
container-title-short container.additional_titles
event-title container.event
event-place container.location
publisher-place publisher.geo_locations[].place
collection-title container.title of a BookSeries container
edition edition
number number
genre additional_type

OpenAlex scope

The openalex_source fixtures cover OpenAlex sources/containers (for example journal, repository, and blog containers), not OpenAlex works.

  • fixtures/openalex_source/*.json are OpenAlex source records (S... IDs).
  • fixtures/commonmeta/openalex_source_*.json are the expected Commonmeta container entities.

OpenAlex works should be added under a separate format namespace (for example openalex_work) to keep reader and writer behavior unambiguous.

Most fixtures are work entities; orcid and orcid_xml cover person instead. Both read a full ORCID record — with employments and educations as affiliations — from two different sources:

  • orcid/<id>.json is the ORCID REST API /record response (JSON). Because it carries the full person, its commonmeta output also has description and urls. → commonmeta/<id>.json
  • orcid_xml/<id>.xml is the ORCID Public Data File record (XML), a summary that omits biography and researcher URLs. → orcid_xml_commonmeta/<id>.json

Both fixtures trim the record's works list to the 10 most recent (the readers convert person identity and affiliations, not works).

Semantic comparison

Fixtures are compared as parsed JSON trees, not as strings, using an omitempty-aware and numeric-aware diff: key order and whitespace are irrelevant, an absent field equals an empty/zero/null value, and 52 equals 52.0. This keeps hand-authored fixtures robust across implementations.

Utility fixtures

fixtures/utils/ is reserved for shared cross-implementation test data for helper functions outside reader/writer format conversion. The first use is DOI helper coverage for encode_doi and decode_doi. These fixtures are not reader/writer conformance cases; they exist so commonmeta-py and commonmeta-rs can assert the same normalization, checksum, and error handling behavior from one canonical source.

Using this repository

Each implementation vendors (copies) the schema and fixtures it needs from here. Update the canonical files in this repository first, then sync them into commonmeta-rs and commonmeta-py.

Packaging and publishing

This repository can be published as both:

  • a Python package on PyPI (commonmeta-schema)
  • a Rust crate on crates.io (commonmeta-schema)
  • a JavaScript package on npm (commonmeta-schema)

Publishing is done explicitly via CLI (no automated release pipeline in this repo).

The packages are released as 1.0.13; both ship the v1.0 schema:

  • PyPI uses PEP 440 form: 1.0.13
  • crates.io uses SemVer form: 1.0.13
  • npm uses SemVer form: 1.0.13

schemas/commonmeta_v1.0.json is edited directly. scripts/sync_versions.py is the single entry point for preparing a release. It does three things:

  1. Mirrors the canonical schemas/ and fixtures/ into rust/schemas/ and rust/fixtures/ (the crate can only package files under rust/).
  2. Syncs rust/Cargo.toml's version with pyproject.toml's.
  3. Syncs package.json's version with pyproject.toml's.
python scripts/sync_versions.py

To verify sync in CI/local checks without changing files:

python scripts/sync_versions.py --check

Recommended pre-release checks:

python scripts/sync_versions.py --check
uv build
cargo test --manifest-path rust/Cargo.toml
cargo package --manifest-path rust/Cargo.toml
npm pack --dry-run

JavaScript / TypeScript (npm)

Install:

npm install commonmeta-schema

Read packaged assets by path:

import { readFileSync } from "node:fs";
import { fixturesPath, schemaPath } from "commonmeta-schema";

const schema = JSON.parse(readFileSync(schemaPath("1.0"), "utf8"));
const fixture = JSON.parse(
  readFileSync(`${fixturesPath("commonmeta")}/journal_article.json`, "utf8")
);

Or import JSON files directly from subpath exports:

import schema from "commonmeta-schema/schemas/commonmeta_v1.0.json" with { type: "json" };

The helper API mirrors the Python package and exports packageRoot, schemaPath(version), fixturesPath(formatName), and availableSchemaVersions().

Python (PyPI) via uv publish

  1. Ensure you are authenticated for PyPI (recommended: trusted publisher or API token).
  2. Build distribution artifacts:
uv build
  1. Optionally validate the build metadata:
uvx twine check dist/*
  1. Publish to PyPI:
uv publish

Rust (crates.io) via cargo publish

  1. Log in once with a crates.io token:
cargo login
  1. Validate package contents:
cargo package --manifest-path rust/Cargo.toml --allow-dirty
  1. Publish:
cargo publish --manifest-path rust/Cargo.toml

JavaScript / TypeScript (npm) via npm publish

  1. Authenticate with npm (once per environment):
npm login
npm whoami
  1. Validate package contents:
npm pack --dry-run
  1. Publish the version from package.json:
npm publish

The package is public and its version must not already exist on npm. Verify the published version after npm completes:

npm view commonmeta-schema version
  1. Publish 1.0.13 to PyPI with uv publish.
  2. Publish 1.0.13 to crates.io with cargo publish.
  3. Publish 1.0.13 to npm with npm publish.
  4. Create a git tag v1.0.13 after all uploads succeed.

Copy-paste release run

Run this from the repository root:

set -euo pipefail

# 1) Mirror assets into rust/, sync the crate and npm versions
python scripts/sync_versions.py

# 2) Fail the release if anything is still out of sync
python scripts/sync_versions.py --check

# 3) Validate both package builds
uv build
cargo test --manifest-path rust/Cargo.toml
cargo package --manifest-path rust/Cargo.toml
npm pack --dry-run

# 4) Publish Python package
uv publish

# 5) Publish Rust crate
cargo publish --manifest-path rust/Cargo.toml

# 6) Publish npm package
npm publish

# 7) Tag release (replace with the release version)
git tag v1.0.13
git push origin v1.0.13

License

MIT © 2026 Front Matter

Metadata

Release files for commonmeta-schema 1.0.13

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

Source distribution (sdist)

Source distribution for commonmeta-schema 1.0.13
File Size Uploaded Provenance Actions
commonmeta_schema-1.0.13.tar.gz 117.1 kB Without provenance Details for commonmeta_schema-1.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for commonmeta-schema 1.0.13
File Interpreter ABI Platform Actions
commonmeta_schema-1.0.13-py3-none-any.whl Python 3 none any Details for commonmeta_schema-1.0.13-py3-none-any.whl

Total release size: 344.0 kB

Release files / commonmeta_schema-1.0.13.tar.gz

Download URL commonmeta_schema-1.0.13.tar.gz
Size 117.1 kB
Tags Source
SHA-256 checksum
How to use checksums
89930df78c8870ddf1d7140512c0548bd531d6160fac275858c8b60035b1c7d8
BLAKE2b-256 checksum
How to use checksums
6892be5be8789e0206bc5f2d66867ae3cb0cafafa389592f79a7e397c4f4f63d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / commonmeta_schema-1.0.13-py3-none-any.whl

Download URL commonmeta_schema-1.0.13-py3-none-any.whl
Size 227.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
899e68b76c2bc7ad32e682d0b2fd2b062109bfc9302c5d7e007c45d2ff89e048
BLAKE2b-256 checksum
How to use checksums
92306c351837ca536603744e7e5520ca38f9bce00bb0f03602ba2ad4d612feb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for commonmeta-schema 1.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.13 This release

2 release files No provenance

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