Expand description
Zero-allocation Lexicon Resolver.
Maps 64-bit Quin field values back to human-readable &[u8] slices for
serialisation into N-Triples or JSON-LD surface syntaxes.
§Bit layout of a Quin field value
Bit 63 │ Bits 60-63 │ Bits 0-59 │ Interpretation
────────┼──────────────┼───────────────┼──────────────────────────────────────
1 │ any │ payload │ did:q42 topological pointer (identifier module)
0 │ 0b0000 │ FNV-1a hash │ IRI / blank-node → lexicon lookup
0 │ 0b0001 │ integer │ Inline xsd:integer literal
0 │ 0b0010 │ scaled × 10⁶ │ Inline xsd:decimal literal
0 │ 0b0011 │ 0 or 1 │ Inline xsd:boolean literal
0 │ 0b001 │ embedded hash │ SPARQL-Star embedded triple <<s p o>>
0 │ 0b1000 │ webizen id │ Person-controlled WebID agent identifier
0 │ 0b0101 │ f32 bits │ Inline xsd:float literal (computed values)
0 │ 0b0110–0b0111│ reserved │ Treated as IRI hash (future use)NOTE: 0b0101 (INLINE_TAG_FLOAT) was formally allocated to inline xsd:float
in 0.0.19 to resolve the float-vs-integer tag clash — computed f32 values used to
squat on the 0b0001 integer tag. The Webizen VM, frame_layout, and this
resolver now agree on 0b0101. See AGENTS.md §4-D and ALGEBRA_MANIFOLD_PLAN.md.
The inline-type encoding is applied by the ingest layer, which masks FNV-1a hash values to 60 bits before storing them so there is no ambiguity with the type-tag bits.
§Zero-allocation guarantee
format_ntriples_to writes directly to any impl io::Write sink and
never touches the heap. Callers own the output buffer.
Structs§
- Lexicon
- Wraps the persistent dictionary block used for hash → IRI resolution.
Enums§
- Inline
Literal - An inline-typed literal decoded from a Quin field value’s tag bits (60-62). Allocation-free; the caller formats the lexical/datatype form it needs (N-Triples surface syntax, SPARQL-Results JSON/XML, etc.).
Constants§
- INLINE_
TAG_ BOOLEAN - INLINE_
TAG_ DECIMAL - INLINE_
TAG_ FLOAT - Inline
xsd:floatliteral: bits 0-31 are raw IEEE-754 f32 bits. Allocated 0.0.19 to end the float-vs-integer clash (formerly squatted onINLINE_TAG_INTEGER). Canonical home for this tag;frame_layoutre-exports it. - INLINE_
TAG_ INTEGER - INLINE_
TAG_ MASK - INLINE_
VALUE_ MASK - Mask over bits 0-59 — the value payload when an inline tag is present.
- MSB_
FLAG - TAG_
EMBEDDED - SPARQL-Star embedded triple tag: indicates the value is a Virtual ID for <
> - TAG_
WEBIZEN - Webizen identity tag: indicates the value is a person-controlled WebID agent identifier Uses 0x8 prefix for instant identification without dictionary lookup
Functions§
- classify_
inline_ literal - Classify a Quin field value as an inline-typed literal, or
Noneif it is not one (an IRI hash / did:q42 pointer / lexicon entry). - format_
nquads_ to - N-Quads lines with graph context (zero-heap).
- format_
ntriples_ star_ to - RDF-Star N-Triples line (
<<<...>>>subject when virtual id). - format_
ntriples_ to - Serialise
quinsas N-Triples, writing each line directly toout. - resolve_
hash - Resolve a 64-bit Quin field value to its original URI bytes.