Skip to main content

Crate commonmeta

Crate commonmeta 

Source
Expand description

commonmeta — a Rust port of front-matter/commonmeta.

Convert scholarly metadata between formats. The native model is Data; format modules read into it and write out of it.

Re-exports§

pub use data::Data;
pub use error::Error;
pub use error::Result;

Modules§

crockford
Generate, encode and decode random base32 identifiers. This encoder/decoder:
crossref
data
Core Commonmeta data model.
doi_utils
Utilities for working with DOIs
error
file_utils
progress
schema_utils
JSON Schema validation utilities.
traits
Reader and Writer traits for format modules.
utils
vocab
Controlled vocabularies from the commonmeta schema.

Structs§

AffiliationMatch
A single match result from the ROR affiliation API.
PushResult
The outcome of pushing a single record to InvenioRDM.

Constants§

VERSION

Functions§

convert
Read from one format and write to another in a single call.
convert_citation
Like convert, but passes CSL style and locale through to the citation writer.
fetch_vraix_dump
Fetch commonmeta records from a VRAIX daily dump for from (“crossref” or “datacite”) and date (YYYY-MM-DD).
match_ror_affiliation
Match a free-text affiliation string against ROR organizations using the ROR v2 affiliation endpoint.
push_inveniordm
Create-or-update, then publish, a list of records in InvenioRDM.
put_inveniordm
Create-or-update, then publish, a single record in InvenioRDM.
read
Read a single record from from format, without writing it back out.
read_parquet
Read a list of commonmeta records back from the Parquet schema written by write_parquet. Lossless: each record is restored from its json column, the complete original serialization.
read_vraix_sqlite
Read commonmeta records from a VRAIX daily dump SQLite file already on disk at sqlite_path, e.g. an already-downloaded crossref-2026-06-14.sqlite3.
write
Write an already-loaded record to to format.
write_archive
Render list to to format, split into entries of at most batch_size records each — suitable for packing into an archive via file_utils::write_zip_archive/file_utils::write_tar_gz_archive. base_name (e.g. "out.json") names the single entry directly when there’s only one batch, or gets a numbered suffix ("out-00000.json", "out-00001.json", …) when there are several.
write_list
Render a list of records to to format as a single buffer: a JSON array for object-shaped formats (commonmeta, csl, datacite, inveniordm, schemaorg, ror), or newline-joined output for line/document-shaped formats (e.g. bibtex, ris, crossref_xml).
write_parquet
Write a list of commonmeta records as a single Parquet file. Alongside a flattened tabular projection of each record’s fields (for filtering in tools like DuckDB without parsing JSON), every row also carries a json column with the record’s complete serialization, so read_parquet round-trips losslessly.
write_ror_json
Write a ROR-derived record as raw ROR-shaped JSON (as opposed to write("ror", data), which produces InvenioRDM vocabulary YAML).