Expand description
Stable file-format, reader, and in-memory build API.
Re-exports§
pub use crate::ingest::assemble_dataset;pub use crate::ingest::assemble_dataset_with;pub use crate::ingest::assemble_dataset_with_layout;pub use crate::ingest::assemble_dataset_with_opts;pub use crate::ingest::assemble_dataset_with_opts_algo;pub use crate::ingest::assemble_dataset_with_perms;pub use crate::ingest::parse;pub use crate::ingest::parse_quads;pub use crate::ingest::parse_rdfxml;pub use crate::ingest::parse_statements;pub use crate::ingest::parse_statements_audited_surface;pub use crate::ingest::parse_turtle;pub use crate::ingest::parse_turtle_surface;pub use crate::ingest::BuildStats;pub use crate::ingest::DeferredMetadata;pub use crate::ingest::FinalCounts;pub use crate::ingest::GraphLayout;pub use crate::ingest::IngestError;pub use crate::ingest::IntoMetadata;pub use crate::ingest::QuotedTripleSurface;pub use crate::ingest::RawQuad;pub use crate::ingest::RawTriple;pub use crate::recard::plan_card_rewrite;pub use crate::recard::rewrite_card;pub use crate::recard::CardRewritePlan;pub use crate::recard::REWRITE_CHUNK;
Structs§
- Build
Info Plan - Everything needed to splice a build-info section into a finished file without holding the file in memory: the rewritten header, where the section goes, and where the bytes that do not move resume.
- Byte
Range - A byte range in the
.retefile image. - Dump
Plan - What a filtered dump will cost, before it runs — see
Rete::dump_plan. - Header
- Decoded file header. All multi-byte fields are little-endian on disk. The
*_offset/*_lenfields are a convenience view over the section directory (populated from it on parse, emitted back to it on serialize). - Layout
Segment - One labelled byte region of a
.retefile image (seeRete::file_layout).kindis a stable machine tag:header,metadata,dictionary,directory,tile,pyramid,named-graphs. - Rete
- A read-only, in-memory view over a
.retefile image. - Scan
Plan - What a routed scan of one pattern will touch, from the tile directories
alone — see [
GraphIndex::scan_plan]. - Section
- One parsed/encoded section-directory entry: a typed
(offset, length)into the file, plus 16 bits of per-section flags (reserved). - Triple
Provenance - Why a triple-pattern result is present in the file.
Enums§
- File
Error - Header
Error - Pyramid
Layout - What a pyramid-meta section carries besides the community summary.
- Section
Kind - A top-level file section, addressed by
SectionKindin the header directory.
Constants§
- CODEC_
NONE - No compression.
- CODEC_
ZSTD - zstd compression (per section).
- CURRENT_
FORMAT_ VERSION - Current format generation written by this crate.
- HEADER_
LEN - Fixed header size in bytes.
- MAGIC
- Magic bytes at offset 0: ASCII
RETE. - MIN_
STABLE_ READ_ VERSION - Oldest stable format generation accepted by this reader.
- RDF_
TYPE rdf:type— the predicate that assigns a class to a resource.
Functions§
- append_
sections - Append LABEL_INDEX / SCHEMA sections (kinds 8, 9) to a finished file image, just before its 4-byte footer, and return the new image.
- attach_
build_ info - Attach (or replace) a build-info section in a finished file image,
returning the new image. Layout and hash semantics:
plan_build_info. - content_
hash_ parts - The byte ranges the content hash folds, in the order it folds them: the metadata payload when present, then dictionary, index, pyramid-meta, and — when present — a kind-6 text index and the named graphs. Build info, the self-digested kinds (8 LABEL_INDEX, 9 SCHEMA, 11 predicate-restricted text index) and any section kind this reader does not know are deliberately outside it. The quad index (kind 10) is not a range here either: its digest is the seal at the end of the index container, so it is hashed by reference.
- plan_
build_ info - Plan the splice of a build-info section of
info_lenbytes into a file whose firstHEADER_LENbytes areheadand whose total length isfile_len. - read_
build_ info - The build-info section of a whole file image, or
Noneif absent. The payload is an opaque application-layer blob (the CLI stores build-conditions JSON there); it is not covered by the content hash — seeattach_build_info. - replace_
metadata - Replace the metadata section (the Dataset Card blob) of a finished file image, returning the new image. The section is the first one after the header, so every later section’s offset shifts by the length delta.
- verify
- Recompute the content hash from a file image and check it against the header
— detects corruption or truncation of the payload sections. The
LABEL_INDEX, SCHEMA and predicate-restricted TEXT_INDEX sections (kinds 8,
9, 11) are outside that hash — an older reader’s
verifymust keep passing on a file that carries them — so each is checked against its own leading digest instead. The QUAD_INDEX section (kind 10) is hashed by reference: its digest is the seal inside the (hashed) index container, checked here.
Type Aliases§
- Term
Triple - A resolved triple as terms.