Skip to main content

Module constants

Module constants 

Source
Expand description

Controlled vocabularies and cross-format type/role translation tables.

All mappings are pure match expressions — zero runtime allocation, compiler-verified exhaustiveness. Callers import only the functions they need; dead-code warnings serve as a built-in unused-constant detector.

Enums§

DoiRegistrationAgency
A DOI Registration Agency (RA).

Constants§

COMMONMETA_RELATION_TYPES
Subset of relation types that are valid at the commonmeta schema level (mirrors Python COMMONMETA_RELATION_TYPES).
CONTRIBUTOR_ROLES
All Commonmeta contributor roles (mirrors Python COMMONMETA_CONTRIBUTOR_ROLES).
CONTRIBUTOR_TYPES
Contributor types.
IDENTIFIER_TYPES
Identifier types (Commonmeta schema enum).
RELATION_TYPES
Relation types from the Commonmeta schema.
WORK_TYPES
All Commonmeta work types.

Functions§

bib_to_cm
BibTeX entry type string → Commonmeta work type.
cm_to_bib
Commonmeta work type → BibTeX entry type string.
cm_to_citeproc
Commonmeta work type → Citeproc/CSL type (DataCite writer variant).
cm_to_cr
Commonmeta work type → Crossref work type string.
cm_to_cr_filter_type
Commonmeta work type → Crossref API filter type (kebab-case). Used for both Crossref (type:…) and OpenAlex (type_crossref:…) filters. Returns "" for types that have no Crossref equivalent.
cm_to_cr_role
Commonmeta contributor role → Crossref contributor role.
cm_to_csl
Commonmeta work type → CSL type string.
cm_to_dc
Commonmeta work type → DataCite resourceTypeGeneral.
cm_to_dc_role
Commonmeta contributor role → DataCite contributor type.
cm_to_inveniordm
Commonmeta work type → InvenioRDM resource_type.id.
cm_to_inveniordm_role
Commonmeta contributor role → InvenioRDM role id (lowercase).
cm_to_ris
Commonmeta work type → RIS type tag.
cm_to_schema_org
Commonmeta work type → Schema.org @type (DataCite writer variant; narrower than cm_to_so — DataCite only serialises a subset).
cm_to_so
Commonmeta work type → Schema.org @type.
cr_to_cm
Crossref work type string → Commonmeta work type.
cr_to_cm_container
Crossref container type string → Commonmeta container type.
cr_to_cm_role
Crossref contributor role → Commonmeta contributor role.
cr_work_to_container
Crossref work type → its Commonmeta container type.
csl_to_cm
CSL type string → Commonmeta work type.
dc_to_cm
DataCite resourceTypeGeneral → Commonmeta work type.
dc_to_cm_container
DataCite container type → Commonmeta container type.
dc_to_cm_role
DataCite contributor type → Commonmeta contributor role.
eu_repo_to_cm
Map an info:eu-repo/semantics/ publication-type URI to a commonmeta type. Returns "" for access-rights terms and any unrecognised URI.
inveniordm_to_cm
InvenioRDM resource_type.id → Commonmeta work type.
inveniordm_to_cm_role
InvenioRDM role id (lowercase) → Commonmeta contributor role.
is_eu_repo_access_right
Returns true if uri is an info:eu-repo/semantics/ access-rights term. These must not be used as license URLs.
lookup_work_type
Case-insensitive lookup against WORK_TYPES. Returns the canonical PascalCase form, or "" if not found.
oa_to_cm
OpenAlex work type → Commonmeta work type.
oa_to_cm_container
OpenAlex source type → Commonmeta container type.
ris_to_cm
RIS type tag → Commonmeta work type.
so_to_cm
Schema.org @type → Commonmeta work type.
subfield_to_fos
Map an OpenAlex subfield numeric ID to the OECD Fields of Science category name. Returns "" if not found.
topic_to_subfield
Map an OpenAlex topic numeric ID (digits only, no “T” prefix) to its parent subfield numeric ID. Returns "" if not found.