Skip to main content

Module chebi_map

Module chebi_map 

Source
Expand description

ChEBI record → Quin mapping (AST-04). ChEBI record → Quin mapping (AST-04).

Maps accepted ChebiRecord values from AST-03 into evidence-preserving, parity-valid NQuin slices plus a cold validation / lexicon report.

§Mapping (per accepted record)

#Predicate IRIObject
1rdf:typechebi:Compound
2chebi:accession60-bit hash of accession (same as subject)
3chebi:hasName60-bit hash of name (surface in lexicon)
4chebi:hasParent60-bit hash of CHEBI:{parent_id} (optional)
5chebi:fromRelease60-bit hash of release_label; metadata low 32 = source_line

Subject for every Quin is q_hash(accession). Context is q_hash(release_label). No network; no new Host/Vibe invoke IDs.

Hot API: map_records_into — caller-buffered. Report types may allocate.

Structs§

LexiconEntry
Bounded lexicon / hash note for a surface string projected as a 60-bit object.
MapBudgets
Caller ceilings for one mapping pass.
MapConflict
One identifier collision or mapping refusal inside a batch.
MapReport
Result of a successful (possibly partially conflicted) mapping pass.

Enums§

MapError
Fail-closed errors for ChEBI Quin mapping.

Constants§

CLASS_CHEBI_COMPOUND
Object class for a ChEBI compound.
PRED_ACCESSION
Predicate: accession string evidence.
PRED_FROM_RELEASE
Predicate: release provenance; source_line in metadata.
PRED_HAS_NAME
Predicate: display name (hashed; surface in lexicon note).
PRED_HAS_PARENT
Predicate: parent compound accession hash.
PRED_RDF_TYPE
Predicate: RDF typing.
QUINS_PER_RECORD_BASE
Quins emitted for every mapped record (type, accession, name, provenance).

Functions§

map_records_into
Project accepted ChEBI records into caller-buffered Quins.
quin_parity_valid
True when Quin parity matches the AGENTS.md XOR fold.
quins_for_record
How many Quins one record would emit (including optional parent).