Skip to main content

Crate waratah_temporal

Crate waratah_temporal 

Source
Expand description

Waratah temporal plugin: native temporal literals (already storage terms), the O-axis dyadic temporal index, SPARQL comparison-FILTER rewrites, and the tf:* (timefuncs) custom functions.

One crate implements the waratah_compute::plugin hooks — write (TemporalWritePlugin), plan (TemporalPlannerPlugin), and execute (TemporalExecutorPlugin) — so ingest and query constants cannot diverge. No EncodePlugin is registered: temporal terms (xsd:dateTime, xsd:date, xsd:gYear, xsd:gYearMonth, …) are storage-native already; the write hook only derives O-axis postings from them.

Register at compute startup via register: the binary composes geo + temporal onto ONE waratah_compute::PluginHost and installs the composed set exactly once (PluginHost::install_process_wide) — the tf:* custom functions (unindexed fallback, ground evaluation) land on the same process custom-function map BEFORE any query is lowered. The registries are first-install-wins, so a second self-install is a silent no-op; install remains only as a single-plugin test shim.

Tier summary (see ARCH.md):

  • Tier 0 — comparison rewrite ([plan]): FILTER(?t >= const) / range pairs over temporal-typed consts → Join(temporal_scan, inner, ?t). The scan’s partition-side reject is a conservative superset; the executor re-evaluates the stripped comparison exactly (XSD partial order, timezone rules, the gYear family extension) so rows are kept exactly as the unindexed FILTER would.
  • Tier 1 — the index: dyadic postings under the term’s (budgeted) covering; instants post one exact leaf. Built by write, served by the partition, trusted from the rebuild epoch (absent = untrusted; the compute auto-rebuild stamps it at startup).
  • Tier 2 — tf:*: the timefuncs relations as ground custom functions now; the OWL-Time structure-join rewrite is the follow-on.

Structs§

TemporalExecutorPlugin
Temporal executor hook.
TemporalPlannerPlugin
Temporal planner hook.
TemporalScanPayload
Typed payload of the temporal_scan CustomOp (downcast by the executor).
TemporalWritePlugin
Temporal write hook.

Constants§

PLUGIN_ID
Stable plugin id carried by every CustomOp the temporal plugin mints.
TEMPORAL_SCAN_OP_ID
temporal_scan op id on the CustomOp node.
TF_NAMESPACE
The tf: namespace (timefuncs; the local names this crate adds beyond the vocabulary’s eight were placed here with the author’s permission).

Functions§

eval_tf_function
Evaluate one unindexed tf:* call over RESOLVED terms (ground path).
ingest_coverer_config
Coverer configuration for ingest postings and query windows (process configuration; a change makes existing postings valid-but-looser supersets — correct, only candidate volume grows — and is made consistent by waratah temporal rebuild-index).
install
Test convenience: install ONLY the temporal plugin + tf:* custom functions on the process registries (first install wins; one guarded host install per process, so repeat calls are no-ops). Production composes via register + one waratah_compute::PluginHost::install_process_wide — a second plugin’s self-install would otherwise be a silent no-op. Still BEFORE any QueryEngine is constructed.
register
Register the temporal plugin bundle + the tf:* custom functions on host (the composition point every plugin crate shares; the binary then installs the composed host exactly once, BEFORE any QueryEngine is constructed). Duplicate function IRIs propagate to the caller — a conflicting plugin set is a deployment error and must fail at the composition site, not silently no-op at install.
set_coverer_config
Override the process coverer config (CLI / compute config / tests).
tf_custom_functions
Register the tf:* custom functions (unindexed ground fallback).