Skip to main content

rdf_structural_model/
error.rs

1//! Structural errors independent of an RDF backend.
2
3/// A rejected RDF structural value.
4#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
5pub enum ModelError {
6    /// A language tag is not well-formed BCP 47.
7    #[error("language tag is not well-formed BCP 47")]
8    InvalidLanguageTag,
9    /// An abstract blank-node identifier is empty.
10    #[error("blank-node identifier must not be empty")]
11    EmptyBlankNode,
12    /// A language datatype has missing or inconsistent facets.
13    #[error("literal datatype and language/direction facets disagree")]
14    InconsistentLiteralFacets,
15    /// A literal or triple term cannot occupy a standard subject position.
16    #[error("term cannot occupy an RDF 1.2 subject position")]
17    InvalidSubject,
18    /// Only an IRI can occupy a standard predicate position.
19    #[error("term cannot occupy an RDF 1.2 predicate position")]
20    InvalidPredicate,
21    /// A literal or triple term cannot name a standard RDF graph.
22    #[error("term cannot occupy an RDF 1.2 graph-name position")]
23    InvalidGraphName,
24}