Skip to main content

Module ingest

Module ingest 

Source
Expand description

Streaming import path for RDF text sources → canonical .q42 volume.

Pipeline: a Rio parser on the main thread streams triples into a bounded channel; a pool of worker shards hashes each triple into an NQuin and (in IngestMode::Complete) interns every subject/predicate/object string into a per-shard lexicon; a collector gathers the quins; the main thread merges the lexicon, sorts the quins by object hash, and writes the volume via crate::q42_volume::UnifiedVolumeBuilder — the GOVERNING .q42 layout (160-byte SuperBlock headers, block directory, BIDX object index, Merkle-DAG, and a real lexicon section).

History: this path previously wrote headerless LZ4 blocks and an empty lexicon, so Q42Volume::read_all_quins could not read the graph back and all literal text was discarded while the shrunk file was reported as “compression”. Both defects are fixed — see IngestMode.

Structs§

RawTriple
Represents a raw string-based Triple extracted from RDF/XML

Enums§

IngestMode
How much of the source graph the .q42 retains.

Functions§

catalog_base_iri
Base IRI for relative terms / empty xml:base in catalog RDF.
expand_empty_turtle_prefixed_names
Expand Turtle prefix: empty local names (dc:, foaf:, ns1:) to IRIs.
streaming_import_rdf
Back-compat entry point: ingests losslessly (IngestMode::Complete) — the honest default.
streaming_import_rdf_volume_set_with_mode
Stream-ingest RDF into a front-embedded logical volume root and immutable, size-capped child Q42 segments.
streaming_import_rdf_with_mode
Stream-ingest an RDF source into a .q42 volume under an explicit IngestMode.
verify_integrity