engine.rete_errors ================== .. py:module:: engine.rete_errors .. autoapi-nested-parse:: Fatal rule errors and RDF triple well-formedness diagnostics. Attributes ---------- .. autoapisummary:: engine.rete_errors.RDF_TRIPLES_SPEC_URL Exceptions ---------- .. autoapisummary:: engine.rete_errors.FatalRuleError engine.rete_errors.RDFTermConstraintError engine.rete_errors.RuleTripleWarning engine.rete_errors.LiteralAsSubjectError engine.rete_errors.LiteralAsSubjectWarning engine.rete_errors.BlankNodePredicateError engine.rete_errors.BlankNodePredicateWarning engine.rete_errors.LiteralPredicateError engine.rete_errors.LiteralPredicateWarning Functions --------- .. autoapisummary:: engine.rete_errors.format_term_constraint_diagnostics Module Contents --------------- .. py:data:: RDF_TRIPLES_SPEC_URL :value: 'https://www.w3.org/TR/rdf11-concepts/#section-triples' .. py:function:: format_term_constraint_diagnostics(triple: rdflib_reasoning.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[rdflib_reasoning.axiom.common.Triple, Ellipsis] | None = None) -> str Format a multi-line diagnostic block for an RDF term constraint violation. .. py:exception:: FatalRuleError Bases: :py:obj:`RuntimeError` Fatal error raised by public rule, predicate, or callback execution. .. py:exception:: RDFTermConstraintError(message: str, *, triple: rdflib_reasoning.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[rdflib_reasoning.axiom.common.Triple, Ellipsis] | None = None) Bases: :py:obj:`FatalRuleError` RDF term-type constraint violation with optional stated/inference context. .. py:attribute:: triple :value: None .. py:attribute:: source :value: None .. py:attribute:: rule_id :value: None .. py:attribute:: depth :value: None .. py:attribute:: pattern :value: None .. py:attribute:: bindings :value: None .. py:attribute:: premises :value: None .. py:exception:: RuleTripleWarning Bases: :py:obj:`UserWarning` Warning 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 .. py:exception:: LiteralAsSubjectError(message: str, *, triple: rdflib_reasoning.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[rdflib_reasoning.axiom.common.Triple, Ellipsis] | None = None) Bases: :py:obj:`RDFTermConstraintError` Raised 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, :attr:`RDFTermConstraintError.triple` and related fields identify the offending triple and (for inferences) the rule activation. .. py:exception:: LiteralAsSubjectWarning Bases: :py:obj:`RuleTripleWarning` Warning emitted when a literal-subject triple is skipped in warning mode. .. py:exception:: BlankNodePredicateError(message: str, *, triple: rdflib_reasoning.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[rdflib_reasoning.axiom.common.Triple, Ellipsis] | None = None) Bases: :py:obj:`RDFTermConstraintError` Raised 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. .. py:exception:: BlankNodePredicateWarning Bases: :py:obj:`RuleTripleWarning` Warning emitted when a blank-node-predicate triple is skipped in warning mode. .. py:exception:: LiteralPredicateError(message: str, *, triple: rdflib_reasoning.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[rdflib_reasoning.axiom.common.Triple, Ellipsis] | None = None) Bases: :py:obj:`RDFTermConstraintError` Raised 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. .. py:exception:: LiteralPredicateWarning Bases: :py:obj:`RuleTripleWarning` Warning emitted when a non-IRI-predicate triple is skipped in warning mode.