Skip to main content

Crate quarb_model

Crate quarb_model 

Source
Expand description

Model files: derived arbor structure over any Quarb source.

A Model (parsed from a --model file, see parse_model) declares derived containers, references, and edges over a base arbor — the top rung of the reference-provenance ladder, generalizing the SQLite views-and---refs construction to any substrate (a CSV, a JSON export, a log stream).

ModelAdapter wraps a base adapter and presents the base’s own nodes unchanged, adding the derived containers as new root children in a reserved node-id band (bit 63). Derived structure materializes lazily: a node constructor runs its query over the base (never over self, so no recursion) on first touch, and the distinct string-keyed values are cached. Declared references and edges build forward/reverse value indexes on first use.

Structs§

AliasDecl
Borrowed
A borrowing adapter: lets a ModelAdapter enrich an adapter a caller holds by reference (behind dyn) without taking ownership — the shape both qua’s run funnel and quai’s per-query dispatch need, since the concrete adapter is already wrapped (now-binding, shell-gating) and only borrowed there.
EdgeDecl
Model
One parsed model file.
ModelAdapter
A base arbor enriched with a model’s derived structure.
Mount
NodeDecl
RefDecl
RelDecl
rel SOURCE -> TARGET[cond]; — a relation between two node sets that no property carries: the condition is evaluated per pair, with $$ standing for the source node.

Enums§

AliasKind
What an alias applies to.
AliasRule
How a written spelling is matched against the canonical one.

Functions§

parse_model
Parse model-file text. A use FILE; statement needs a location to resolve against, so it is refused here; parse_model_file is the entry point for a model on disk.
parse_model_file
Parse a model file, resolving its use FILE; includes against its own directory (recursively; a cycle is refused). An included model’s mounts are resolved against the included file’s directory, so each model stays self-locating; its node, ref, rel, edge, alias and def statements join the includer’s, ahead of them; a mount name declared twice is refused.
resolve_mount_target
Resolve a mount target against the model file’s directory: a scheme target (neo4j://, git:…) or an absolute path is left as-is; a relative filesystem path is joined to base_dir, so a shipped fixture directory is self-locating.