pub enum Plan {
Bgp(Vec<TriplePattern>),
Join(Box<Plan>, Box<Plan>),
Union(Box<Plan>, Box<Plan>),
LeftJoin(Box<Plan>, Box<Plan>, Option<FExpr>),
Filter(FExpr, Box<Plan>),
Extend(String, FExpr, Box<Plan>),
Path(PatternTerm, PathAst, PatternTerm),
Values(Vec<String>, Vec<Vec<Option<String>>>),
Minus(Box<Plan>, Box<Plan>),
Graph(GraphTarget, Box<Plan>),
Subquery(Box<Select>),
Service {
silent: bool,
endpoint: String,
vars: Vec<String>,
query: String,
},
}Expand description
A SPARQL graph-pattern evaluation plan (the supported algebra subset).
Variants§
Bgp(Vec<TriplePattern>)
Basic graph pattern: triple patterns joined on shared variables.
Join(Box<Plan>, Box<Plan>)
Conjunction of two patterns (inner join on shared variables).
Union(Box<Plan>, Box<Plan>)
UNION: all solutions of either side.
LeftJoin(Box<Plan>, Box<Plan>, Option<FExpr>)
OPTIONAL (left join): left solutions, extended by the right where it matches (and passes the optional condition), kept as-is where it doesn’t.
Filter(FExpr, Box<Plan>)
FILTER over an inner pattern.
Extend(String, FExpr, Box<Plan>)
In-pattern BIND(expr AS ?var): each inner solution extended with ?var
(left unbound where expr errors). Distinct from the projection-time
alias list (Select::extends) — this one is inside the graph pattern,
so a following FILTER or join sees the bound variable.
Path(PatternTerm, PathAst, PatternTerm)
A property path subject <path> object.
Values(Vec<String>, Vec<Vec<Option<String>>>)
Inline VALUES: variable names and rows of optional ground-term tokens
(None = UNDEF).
Minus(Box<Plan>, Box<Plan>)
MINUS: left solutions, minus those compatible with a right solution
that shares at least one bound variable.
Graph(GraphTarget, Box<Plan>)
GRAPH <iri>|?g { … } — evaluate the inner pattern against a named graph.
Subquery(Box<Select>)
A nested SELECT subquery: evaluated independently to its projected
solutions, which then join with the surrounding pattern on shared
variables (only the subquery’s projected variables are visible outside).
Service
SERVICE [SILENT] <endpoint> { … } — SPARQL 1.1 federated query. The
inner pattern is shipped (as query, its re-serialized SPARQL text) to
the remote endpoint through the file’s attached
ServiceClient at evaluation time; the returned
solutions join the surrounding pattern on shared variables like any
other operand. Under silent, a failed call degrades to one empty
solution (per the spec); otherwise it fails the whole query.