pub struct FederatedQueryEngine<'a> {
pub local_quins: &'a [NQuin],
pub services: HashMap<String, FederatedService>,
pub initialized: bool,
}Expand description
Federated query engine — dispatches queries across local and remote services.
Local services (local:/qualia:) are executed in-process via the standard
SPARQL parser → planner → executor pipeline. Remote HTTP(S) services are executed
over the real SPARQL 1.1 Protocol ([fetch_remote_sparql] +
[parse_sparql_results_json]): a application/sparql-query POST, the
application/sparql-results+json response parsed into binding rows + a resolvable
lexicon. Remote execution is real network egress and runs only for endpoints the
caller explicitly targets.
Fields§
§local_quins: &'a [NQuin]Local Quins the engine executes local services against.
services: HashMap<String, FederatedService>Registered service endpoints keyed by endpoint URL.
initialized: boolWhether initialize has been called.
Implementations§
Source§impl<'a> FederatedQueryEngine<'a>
impl<'a> FederatedQueryEngine<'a>
Sourcepub fn initialize(&mut self) -> Result<(), String>
pub fn initialize(&mut self) -> Result<(), String>
Initialize the engine for use. Clears any stale state and marks the engine ready. Calling this is required before executing federated queries so that downstream code can rely on a deterministic start state.
Sourcepub fn register_service(&mut self, service: FederatedService)
pub fn register_service(&mut self, service: FederatedService)
Register a federated service endpoint. Re-registering an existing endpoint URL updates its configuration in place.
Sourcepub fn list_services(&self) -> Vec<String>
pub fn list_services(&self) -> Vec<String>
List the endpoint URLs of all registered services.
Sourcepub fn execute_service(
&self,
service: &FederatedService,
query: &str,
) -> Result<FederatedQueryResult, String>
pub fn execute_service( &self, service: &FederatedService, query: &str, ) -> Result<FederatedQueryResult, String>
Execute a query against a single federated service.
- Local endpoints (
local:/qualia:) are executed in-process and return real result bindings. - Remote HTTP endpoints return a placeholder result containing the
constructed query URL (
<endpoint>?query=<encoded>). The HTTP fetch itself requires an async runtime which is not available in this synchronous module; the placeholder is structured so a transport layer can be plugged in later without changing the call sites.
Sourcepub fn execute_federated(
&self,
query: &FederatedQuery,
) -> Result<Vec<FederatedQueryResult>, String>
pub fn execute_federated( &self, query: &FederatedQuery, ) -> Result<Vec<FederatedQueryResult>, String>
Execute a federated query across all of its services.
Each service is dispatched via execute_service
and the per-service results are collected. Results are concatenated
(simple merge); full SPARQL join semantics across services are a
separate task.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FederatedQueryEngine<'a>
impl<'a> RefUnwindSafe for FederatedQueryEngine<'a>
impl<'a> Send for FederatedQueryEngine<'a>
impl<'a> Sync for FederatedQueryEngine<'a>
impl<'a> Unpin for FederatedQueryEngine<'a>
impl<'a> UnsafeUnpin for FederatedQueryEngine<'a>
impl<'a> UnwindSafe for FederatedQueryEngine<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more