shacl_validation/
validate_error.rs

1// use oxiri::IriParseError;
2use shacl_ast::compiled::compiled_shacl_error::CompiledShaclError;
3use shacl_ast::shacl_parser_error::ShaclParserError;
4use sparql_service::RdfDataError;
5use srdf::RDFParseError;
6use srdf::SRDFGraphError;
7use thiserror::Error;
8
9use crate::constraints::constraint_error::ConstraintError;
10use crate::helpers::helper_error::SPARQLError;
11use crate::helpers::helper_error::SRDFError;
12
13#[derive(Error, Debug)]
14pub enum ValidateError {
15    #[error("Error during the SPARQL operation")]
16    SRDF,
17    #[error("TargetNode cannot be a Blank Node")]
18    TargetNodeBlankNode,
19    #[error("TargetClass should be an IRI")]
20    TargetClassNotIri,
21    #[error("Error when working with the SRDFGraph, {}", ._0)] // TODO: move to store
22    Graph(#[from] SRDFGraphError),
23    #[error("Error when parsing the SHACL Graph, {}", ._0)] // TODO: move to store
24    ShaclParser(#[from] ShaclParserError),
25    #[error("Error during the constraint evaluation")]
26    Constraint(#[from] ConstraintError),
27    // #[error("Error parsing the IRI")]
28    //IriParse(#[from] IriParseError),
29    #[error("Error during some I/O operation")]
30    IO(#[from] std::io::Error),
31    #[error("Error loading the Shapes")]
32    Shapes(#[from] RDFParseError),
33    #[error("Error creating the SPARQL endpoint")]
34    SPARQLCreation,
35    #[error("Error during the SPARQL operation")]
36    Sparql(#[from] SPARQLError),
37    #[error("Implicit class not found")]
38    ImplicitClassNotFound,
39    #[error("The provided mode is not supported for the {} structure", ._0)]
40    UnsupportedMode(String),
41    #[error(transparent)]
42    SrdfHelper(#[from] SRDFError),
43    #[error("Error during the compilation of the Schema, {}", ._0)] // TODO: move to store
44    CompiledShacl(#[from] CompiledShaclError),
45    #[error("Not yet implemented: {msg}")]
46    NotImplemented { msg: String },
47    #[error(transparent)]
48    RdfDataError(#[from] RdfDataError),
49}