engine.rete_errors¶
Fatal rule errors and RDF triple well-formedness diagnostics.
Attributes¶
Exceptions¶
Fatal error raised by public rule, predicate, or callback execution. |
|
RDF term-type constraint violation with optional stated/inference context. |
|
Warning for triples rejected by RDF 1.1 triple well-formedness checks. |
|
Raised when a stated or inferred triple has a literal subject. |
|
Warning emitted when a literal-subject triple is skipped in warning mode. |
|
Raised when a stated or inferred triple has a blank node predicate. |
|
Warning emitted when a blank-node-predicate triple is skipped in warning mode. |
|
Raised when a stated or inferred triple has a non-IRI predicate. |
|
Warning emitted when a non-IRI-predicate triple is skipped in warning mode. |
Functions¶
Format a multi-line diagnostic block for an RDF term constraint violation. |
Module Contents¶
- engine.rete_errors.RDF_TRIPLES_SPEC_URL = 'https://www.w3.org/TR/rdf11-concepts/#section-triples'¶
- engine.rete_errors.format_term_constraint_diagnostics(triple: axiom.common.Triple, *, source: Literal['stated', 'inferred'] | None, rule_id: Any = None, depth: int | None = None, pattern: tuple[rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable] | None = None, bindings: collections.abc.Mapping[str, rdflib.term.Node] | None = None, premises: tuple[axiom.common.Triple, Ellipsis] | None = None) str¶
Format a multi-line diagnostic block for an RDF term constraint violation.
- exception engine.rete_errors.FatalRuleError¶
Bases:
RuntimeErrorFatal error raised by public rule, predicate, or callback execution.
- exception engine.rete_errors.RDFTermConstraintError(message: str, *, triple: axiom.common.Triple | None = None, source: Literal['stated', 'inferred'] | None = None, rule_id: Any = None, depth: int | None = None, pattern: tuple[rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable] | None = None, bindings: collections.abc.Mapping[str, rdflib.term.Node] | None = None, premises: tuple[axiom.common.Triple, Ellipsis] | None = None)¶
Bases:
FatalRuleErrorRDF term-type constraint violation with optional stated/inference context.
- triple = None¶
- source = None¶
- rule_id = None¶
- depth = None¶
- pattern = None¶
- bindings = None¶
- premises = None¶
- exception engine.rete_errors.RuleTripleWarning¶
Bases:
UserWarningWarning for triples rejected by RDF 1.1 triple well-formedness checks.
These warnings are emitted when the engine is configured to warn and skip malformed triples instead of raising. The governing normative source is the RDF 1.1 Concepts triples section: https://www.w3.org/TR/rdf11-concepts/#section-triples
- exception engine.rete_errors.LiteralAsSubjectError(message: str, *, triple: axiom.common.Triple | None = None, source: Literal['stated', 'inferred'] | None = None, rule_id: Any = None, depth: int | None = None, pattern: tuple[rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable] | None = None, bindings: collections.abc.Mapping[str, rdflib.term.Node] | None = None, premises: tuple[axiom.common.Triple, Ellipsis] | None = None)¶
Bases:
RDFTermConstraintErrorRaised when a stated or inferred triple has a literal subject.
Literal subjects are disallowed by the RDF 1.1 data model, so the engine refuses to admit or materialize such triples in error mode.
When available,
RDFTermConstraintError.tripleand related fields identify the offending triple and (for inferences) the rule activation.
- exception engine.rete_errors.LiteralAsSubjectWarning¶
Bases:
RuleTripleWarningWarning emitted when a literal-subject triple is skipped in warning mode.
- exception engine.rete_errors.BlankNodePredicateError(message: str, *, triple: axiom.common.Triple | None = None, source: Literal['stated', 'inferred'] | None = None, rule_id: Any = None, depth: int | None = None, pattern: tuple[rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable] | None = None, bindings: collections.abc.Mapping[str, rdflib.term.Node] | None = None, premises: tuple[axiom.common.Triple, Ellipsis] | None = None)¶
Bases:
RDFTermConstraintErrorRaised when a stated or inferred triple has a blank node predicate.
Predicates must be IRIs in RDF 1.1, so the engine refuses to admit or materialize such triples in error mode.
- exception engine.rete_errors.BlankNodePredicateWarning¶
Bases:
RuleTripleWarningWarning emitted when a blank-node-predicate triple is skipped in warning mode.
- exception engine.rete_errors.LiteralPredicateError(message: str, *, triple: axiom.common.Triple | None = None, source: Literal['stated', 'inferred'] | None = None, rule_id: Any = None, depth: int | None = None, pattern: tuple[rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable, rdflib.term.Node | rdflib.term.Variable] | None = None, bindings: collections.abc.Mapping[str, rdflib.term.Node] | None = None, premises: tuple[axiom.common.Triple, Ellipsis] | None = None)¶
Bases:
RDFTermConstraintErrorRaised when a stated or inferred triple has a non-IRI predicate.
Literal predicates are explicitly invalid, and this exception is also used for the broader non-IRI predicate path when the engine is configured to fail fast.
- exception engine.rete_errors.LiteralPredicateWarning¶
Bases:
RuleTripleWarningWarning emitted when a non-IRI-predicate triple is skipped in warning mode.