1use oxrdf::{NamedNode, Term, Variable};
2use std::convert::Infallible;
3use std::error::Error;
4
5#[derive(Debug, thiserror::Error)]
7#[non_exhaustive]
8pub enum QueryEvaluationError {
9 #[error(transparent)]
11 Dataset(Box<dyn Error + Send + Sync>),
12 #[error("{0}")]
14 Service(#[source] Box<dyn Error + Send + Sync>),
15 #[error("The SPARQL query does not contains variable {0} in its SELECT projection")]
17 NotExistingSubstitutedVariable(Variable),
18 #[error("The SPARQL dataset returned the default graph even if a named graph is expected")]
20 UnexpectedDefaultGraph,
21 #[error("The variable encoding the service name is unbound")]
23 UnboundService,
24 #[error("{0} is not a valid service name")]
26 InvalidServiceName(Term),
27 #[error("The service {0} is not supported")]
29 UnsupportedService(NamedNode),
30 #[cfg(feature = "rdf-star")]
31 #[error("The storage provided a triple term that is not a valid RDF-star term")]
32 InvalidStorageTripleTerm,
33}
34
35impl From<Infallible> for QueryEvaluationError {
36 #[inline]
37 fn from(error: Infallible) -> Self {
38 match error {}
39 }
40}