shacl_validation/helpers/
helper_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use srdf::SRDFGraphError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum SPARQLError {
    #[error("Query could not be performed")]
    Query { query: String, error: String },
}

#[derive(Error, Debug)]
pub enum SRDFError {
    #[error("Error during the SRDF operation")]
    Srdf { error: String },

    // #[error("Error parsing the IRI")]
    // IriParse(#[from] IriParseError),
    #[error("Error during the creation of the SRDFGraph")]
    SRDFGraph(#[from] SRDFGraphError),

    #[error("Converting term {subject} to subject")]
    SRDFTermAsSubject { subject: String },

    #[error("Error finding values for subject {subject} with predicate {predicate}: {error}")]
    ObjectsWithSubjectPredicate {
        subject: String,
        predicate: String,
        error: String,
    },

    #[error("Error finding values for object {object} with predicate {predicate}: {error}")]
    SubjectsWithPredicateObject {
        object: String,
        predicate: String,
        error: String,
    },
}