shacl_ast/converter/rdf_to_shacl/
shacl_parser_error.rs1use crate::ShaclError;
2use srdf::RDFParseError;
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum ShaclParserError {
7 #[error("RDF parse error: {err}")]
8 RDFParseError {
9 #[from]
10 err: RDFParseError,
11 },
12
13 #[error("Expected RDFNode parsing node shape, found: {term}")]
14 ExpectedRDFNodeNodeShape { term: String },
15
16 #[error("Expected Value of `sh:or` to be a subject, found: {term}")]
17 OrValueNoSubject { term: String },
18
19 #[error("Expected Value of `sh:and` to be a subject, found: {term}")]
20 AndValueNoSubject { term: String },
21
22 #[error("Expected Value of `sh:xone` to be a subject, found: {term}")]
23 XOneValueNoSubject { term: String },
24
25 #[error("Expected NodeKind, found: {term}")]
26 ExpectedNodeKind { term: String },
27
28 #[error("Unknown NodeKind, found: {term}")]
29 UnknownNodeKind { term: String },
30
31 #[error("SHACL error: {err}")]
32 ShaclError {
33 #[from]
34 err: ShaclError,
35 },
36
37 #[error("Custom error: {msg}")]
38 Custom { msg: String },
39}