Expand description
Native, RDF-1.2-first multiset SPARQL evaluator (purrdf S6).
This crate is the evaluation runtime that consumes the
purrdf_sparql_algebra front-end (S5) and evaluates it over the
purrdf_core IR’s DatasetView read trait
entirely in interned TermId space. It is the
native replacement for the oxigraph-family spareval on the query path and
the single required impl of the
SparqlEngine seam.
§Design pillars
- TermId hot path. Basic-graph-pattern matching and joins never leave
interned-id space: constants resolve to a dataset
purrdf_core::TermIdonce (viaterm_id_by_value, P4) and solutions carrySolutionTerms that are a single integer compare apart. Computed terms (FILTER/BIND results not already in the dataset) are interned in a per-query scratch table — but a computed value that does exist in the dataset is promoted toSolutionTerm::Existingat mint time, so cross-case join keys are unequal purely by construction (no structural fallback at join time). Seescratch. - Multiset (bag) semantics. Solutions are a bag, preserved until
DISTINCT/REDUCED. Seesolution. - Property paths in-engine (S8). The
Pathgraph pattern is evaluated over the same indexed surface, wasm-safe, covering the full algebra (* + ? / | ^ !()and the PurRDF{n,m}/<any>extensions) — see thepathmodule. - Hard-fail, no degraded fallback. A well-formed but out-of-scope algebra
node (
SERVICE,LATERAL, SPARQLUPDATE) or an unimplemented builtin is a typedEvalError::Unsupported— never a partial or wrong answer (the projectno-optionalitydoctrine).
The crate carries zero oxigraph-family dependencies and builds for
wasm32-unknown-unknown (the wasm query path); both invariants are
gated by make rdf-core-hygiene.
Re-exports§
pub use engine::NativeSparqlEngine;pub use engine::PlanCache;pub use engine::PreparedQuery;pub use error::EvalError;pub use eval::EvalCtx;pub use eval::EvalOptions;pub use eval::LossVocabulary;pub use eval::Outcome;pub use eval::StandpointPredicates;pub use eval::eval;pub use eval::evaluate_query;pub use remote::LocalRemoteQuerySource;pub use remote::RemoteError;pub use remote::RemoteQuerySource;pub use remote::ResolvedBindings;pub use remote_http::HttpRemoteQuerySource;pub use remote_http::HttpRequest;pub use remote_http::HttpTransport;pub use scratch::ScratchId;pub use scratch::ScratchInterner;pub use scratch::SolutionTerm;pub use solution::Solution;pub use solution::SolutionSeq;pub use solution::VarSchema;pub use solution::compatible;pub use update::GraphResolver;pub use user_fn::Arity;pub use user_fn::NativeFnBody;pub use user_fn::NativeFunction;pub use user_fn::NodeKind;pub use user_fn::TypeConstraint;pub use user_fn::UserFnBody;pub use user_fn::UserFnParam;pub use user_fn::UserFunction;pub use user_fn::UserFunctionRegistry;pub use user_fn::Volatility;
Modules§
- engine
- The native
SparqlEngineimplementation and its parse-memoizing plan cache. - error
- The evaluator’s typed error channel.
- eval
- The graph-pattern evaluation recursion and its
EvalCtx. - remote
- SPARQL
SERVICEfederation: theeval_servicehandler and theRemoteQuerySourceseam. - remote_
http - HTTP-shaped transport adapter for SPARQL
SERVICEfederation. - scratch
- Solution-term identity: the
SolutionTermbound-value representation and the per-queryScratchInternerfor computed terms. - solution
- Solution sequences: the column-oriented multiset of variable bindings.
- update
- SPARQL 1.1 UPDATE evaluation over a
MutableDataset. - user_fn
- Dynamic, host-injected user functions — of two kinds under one IRI namespace.
Structs§
- Complete
Sparql Result - A fully materialized SPARQL result whose backing view reached a final ready checkpoint.
- Parser
Options - Parse-time configuration for the SPARQL front-end.
Enums§
- Fallible
Sparql Error - Failure of a query over a
FallibleDatasetView.
Type Aliases§
- Fallible
Sparql Result - The public return type for a query over an operationally fallible view.