diff --git a/lib/src/sparql/mod.rs b/lib/src/sparql/mod.rs index 3023f7cd..f0c62666 100644 --- a/lib/src/sparql/mod.rs +++ b/lib/src/sparql/mod.rs @@ -159,7 +159,14 @@ impl PreparedQuery for SimplePreparedQuery { } } +/// Handler for SPARQL SERVICEs. +/// +/// Might be used to implement [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) pub trait ServiceHandler { + /// Get the handler for a given service identified by a RDF IRI. + /// + /// A service is a function that returns an iterator of bindings from a `GraphPattern`. + /// Returns `None` if there is no handler for the service. fn handle<'a>( &'a self, node: &NamedNode, @@ -170,10 +177,10 @@ pub trait ServiceHandler { struct EmptyServiceHandler {} impl ServiceHandler for EmptyServiceHandler { - fn handle<'a>( - &'a self, + fn handle( + &self, _node: &NamedNode, - ) -> Option<(fn(GraphPattern) -> Result>)> { + ) -> Option<(fn(GraphPattern) -> Result>)> { None } }