qualia_core_db/q42/chebi_map/mod.rs
1//! ChEBI record → Quin mapping (AST-04).
2//!
3//! Maps accepted [`ChebiRecord`](crate::q42::chebi_parse::ChebiRecord) values
4//! from AST-03 into evidence-preserving, parity-valid [`NQuin`](crate::NQuin)
5//! slices plus a cold validation / lexicon report.
6//!
7//! # Mapping (per accepted record)
8//!
9//! | # | Predicate IRI | Object |
10//! |---|---------------|--------|
11//! | 1 | `rdf:type` | `chebi:Compound` |
12//! | 2 | `chebi:accession` | 60-bit hash of accession (same as subject) |
13//! | 3 | `chebi:hasName` | 60-bit hash of name (surface in lexicon) |
14//! | 4 | `chebi:hasParent` | 60-bit hash of `CHEBI:{parent_id}` (optional) |
15//! | 5 | `chebi:fromRelease` | 60-bit hash of `release_label`; `metadata` low 32 = `source_line` |
16//!
17//! Subject for every Quin is `q_hash(accession)`. Context is
18//! `q_hash(release_label)`. No network; no new Host/Vibe invoke IDs.
19//!
20//! Hot API: `map_records_into` — caller-buffered. Report types may allocate.
21
22mod map;
23mod report;
24
25pub use map::{
26 map_records_into, quin_parity_valid, quins_for_record, CLASS_CHEBI_COMPOUND, PRED_ACCESSION,
27 PRED_FROM_RELEASE, PRED_HAS_NAME, PRED_HAS_PARENT, PRED_RDF_TYPE, QUINS_PER_RECORD_BASE,
28};
29pub use report::{LexiconEntry, MapBudgets, MapConflict, MapError, MapReport};