Expand description
Stable SPARQL, graph-pattern, federation, and result API.
Structs§
- Community
Partial - One community’s contribution to a community-split evaluation: how many member subjects it holds and how many solution rows it produced.
- Routed
Triple Pattern - A single triple pattern that can be answered by the range-routed permutation
reader.
Nonemeans the position is a variable/wildcard;Some(term)means the query pins that term. - Triple
Pattern - A triple pattern
(subject, predicate, object)ofPatternTerms. - Triple
Provenance - Why a triple-pattern result is present in the file.
Enums§
- Pattern
Term - A term in a pattern: a named variable or a constant term token.
- Query
Output - The result of evaluating any SPARQL query form.
- Sparql
Error - Summary
Query Shape - Query shapes that can be answered exactly from
crate::range::SummaryViewpredicate totals, without opening the triple index.
Traits§
- Service
Client - Executes one SPARQL query against a remote endpoint (the SPARQL Protocol)
and returns its solutions. Implementations own transport, auth, and
timeouts; they typically
POSTthe query withAccept: application/sparql-results+jsonand feed the body throughparse_sparql_json_results. Errors are strings, surfaced verbatim as the query error (or, underSERVICE SILENT, swallowed per the spec) — name the endpoint in the message, the engine adds no prefix.
Functions§
- eval_
query - Evaluate any supported SPARQL query form (SELECT / ASK / CONSTRUCT).
- eval_
query_ reasoned - Like
eval_query, but with OWL 2 QL entailment on: the lowered plan is rewritten by the internal QL lowering pass so the answer includes ontology-entailed solutions (Stage 1a:rdfs:subClassOf), computed over the raw data with no materialization. Opt-in — a plaineval_queryis byte-identical to before. - eval_
select_ communities - Evaluate a SELECT per pyramid community, then merge: each community’s
subjects are pushed into the plan as a VALUES binding, the partial rows
are concatenated, and the solution modifiers (GROUP BY / ORDER BY / LIMIT
/ DISTINCT) run once on the union — so the rows are identical to
eval_query’s answer. Sound only for subject-star queries over the default graph (every triple pattern sharing one subject variable; FILTERs allowed); anything else returnsSparqlError::Unsupportedrather than a possibly-wrong split answer.roundpicks the dendrogram granularity (None= the build’s tile-budget round). Also returns each community’s subject and row counts for display. - eval_
sparql - Parse and evaluate a SELECT against a file, applying the plan then
projection, DISTINCT, OFFSET, and LIMIT. Returns
(projected_vars, solutions). - eval_
sparql_ reasoned - Like
eval_sparql, but with OWL 2 QL entailment on (seeeval_query_reasoned). - parse_
sparql_ json_ results - Parse a SPARQL 1.1 Query Results JSON document (
application/sparql-results+json) into bindings of variable → N-Triples term token. An ASK document (noresults) yields no bindings. Unknown per-binding fields are ignored;xsd:stringdatatypes are dropped (a simple literal — matching how plain literals are tokenized everywhere else in the engine). - push_
json_ string - Append
vtooutas a JSON string literal (RFC 8259 escaping): the mandatory escapes (",\, and C0 controls, the common ones in short form), every other char — including all UTF-8 — passed through. Matches whatserde_jsonemits for a string by default. - query_
predicates - Collect the concrete predicate IRIs a query constrains on — i.e. every
IRI that appears in the predicate position of a triple pattern, or as a plain
predicate inside a property path. Variable predicates (
?p) and the speciala(rdf:type) keyword are normalized to their IRI tokens (<…>). - results_
envelope_ json - Serialize
outas{ "kind": …, … }.extrais a raw JSON fragment of additional object members appended before the closing brace (e.g.,"remote":{…}); pass""for none.CONSTRUCTis rendered as atriplesarray — the text formats (Turtle / JSON-LD) are handled by the caller, which owns those serializers. - routed_
triple_ pattern - Classify queries whose graph access is exactly one default-graph triple pattern. Solution modifiers (projection, LIMIT, aggregate wrappers) do not change the underlying range access, but named graphs, FROM, joins, filters, paths, and other algebra need the full SPARQL evaluator.
- sparql_
json_ ask - Serialize an ASK result as a SPARQL 1.1 Query Results JSON document.
- sparql_
json_ results - Serialize a SELECT result as a SPARQL 1.1 Query Results JSON document.
varsfixes theheadorder (pass the projection); solutions’ bindings are term tokens exactly as the engine returns them. - summary_
query_ shape - Classify SPARQL queries that can be answered exactly from the pyramid summary’s per-predicate totals. This is intentionally conservative: anything with constants, repeated variables, filters, joins, paths, named graphs, ORDER BY, OFFSET/LIMIT, or non-summary-safe aggregates still requires the index. The only accepted DISTINCT shape is a predicate list over one fully unbound triple pattern.
Type Aliases§
- Binding
- A solution: variable name → bound term (the public, resolved form).
- Community
Select - The outcome of a community-split SELECT: the projected variables, the merged solution rows, and each community’s contribution.