Expand description
Stable byte-range and lazy-open API for local or remote .rete files.
Structs§
- Block
Cache Reader - Byte
Range - A byte range in the
.retefile image. - Counting
Reader - Wraps a reader and tallies how many ranges were requested and how many bytes
were returned — the metric that matters for a range-streamed format.
Atomically counted, so it stays
Sync(a lazily-faulting remote index holds its reader behind a shared loader). - 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. - Slice
Reader - A
RangeReaderover an in-memory byte slice (tests, embedded files). - Summary
View - A lightweight, overview-only view of a file: the pyramid summary graph plus just enough dictionary to label predicates. Fetched via ranges without touching the (large) triple index — the “load the coarse graph first” path from SPEC.md §7.2.
Constants§
- DEFAULT_
BLOCK - Default block size: 64 KiB — large enough to swallow a dictionary chunk or an index tile in one fetch, small enough to keep over-fetch modest.
- DEFAULT_
CACHE_ CAP - Default cap on resident cached bytes: 256 MiB. Large enough that a working set (the tiles + dictionary chunks a query family touches) stays warm; small enough that a full sweep of a multi-GB file leaves plenty of the 32-bit wasm address space for the decompressed structures built on top of these bytes. At the auto-tuned 128–512 KiB block sizes this is 512–2048 resident blocks, so the eviction scan is trivial.
Traits§
- Range
Reader - Something that can serve arbitrary byte ranges of a
.reteresource.
Functions§
- auto_
block - Pick a
BlockCacheReaderblock size from the file length: bigger files get bigger blocks so a remote query makes far fewer (but larger) round trips — 128 KiB ≤ 10 MB, 256 KiB ≤ 100 MB, 512 KiB above. The over-fetch is modest next to the round-trip latency it saves on a high-latency link (S3/CDN). Shared by the CLI and the wasm client so both size identically; the file length is known for free from the openingHEAD/Content-Range. - read_
metadata_ ranged - Fetch only the metadata section (the opaque Dataset Card blob) via a
RangeReader: read the 128-byte header, then the metadata byte range — nothing else. This is the index-free CARD tier of the exploration model: a remote/S3 client learns the dataset’s self-description in two small range requests, never touching the dictionary, index, or pyramid. ReturnsNonewhen the file carries no metadata. - read_
schema_ coherence_ ranged - Dictionary-free Tier-0 coherence read. Fetch only the header and the
pyramid-meta range (2 small range reads) and run
schema_coherenceover the schema pyramid — never touching the dictionary (which a literal-heavy file makes large) or the triple index.Ok(None)if the file ships no pyramid. - read_
schema_ summary_ ranged - The schema summary (per-class histogram + class relations at the finest
level) read over a
RangeReaderfrom the schema pyramid alone — the index-free, range-readable source for a Schema view of a remote graph. Returns(classes, relations)withclasses = [(class_iri, count)]andrelations = [(s_class, predicate, o_class, count)];Nonewhen the file has no schema pyramid. Likeread_schema_coherence_ranged, it reads only the trailing schema block, so it stays flat at any graph size.