pyunitwizard.dialects.vocabulary.annotate#
- pyunitwizard.dialects.vocabulary.annotate(record, *, unit_iri, kind_iri)[source]#
Bind explicit unit/kind identifiers to an already kind-tagged record.
- Parameters:
record (QuantityRecord) – Homogeneous record whose existing
kindequalskind_iriand whose named unit matches the bounded catalogue exactly after codec canonicalization. Convert explicitly before annotating other scales or unnamed SI expressions. Values and the original seal stay unchanged.unit_iri (str) – Registered QUDT unit or OBO UO unit IRI.
kind_iri (str) – Registered QUDT quantity-kind IRI, explicitly selected by the consumer.
- Returns:
Provisional sealed annotation sidecar bound to the original record digest and the installed catalogue. Retain it alongside that record.
- Return type:
dict
- Raises:
RecordError – For missing/unknown kinds or units, mismatched named meanings or SI definitions, or unsupported layout. This is not semantic inference or proof that a consumer assigned its scientific kind correctly.
Examples
>>> note = annotate(record, unit_iri='http://qudt.org/vocab/unit/HZ', ... kind_iri='http://qudt.org/vocab/quantitykind/Frequency')