hermitpy

hermitpy.errors

Errors

Loading fails closed. Classification refuses an ontology with no model. The tableau stops if the graph or the branch grows past its bound.

from hermitpy import InconsistentOntology, ReasonerLimitExceeded, UnsupportedConstruct

try:
    pairs = reasoner.direct_subclasses()
except InconsistentOntology:
    print(reasoner.unsatisfiable_classes())
except UnsupportedConstruct as error:
    print(error.construct)
except ReasonerLimitExceeded:
    print("search bound")

UnsupportedConstruct

A ValueError. Raised while the graph is loaded, including from Reasoner(...), when the ontology uses OWL outside the fragment. The message is Unsupported OWL construct: ... and says the construct is not ignored.

error.construct is the short name, such as owl:maxCardinality, owl:oneOf, SWRL, or anonymous individual. Source: errors.py.

InconsistentOntology

A ValueError. Raised only by direct_subclasses when is_consistent is false. unsatisfiable_classes does not raise it. On an inconsistent ontology that method returns every named class.

ReasonerLimitExceeded

A RuntimeError. Raised when a completion graph reaches 256 nodes, or when nondeterministic search passes depth 4096. The node message says the fragment search did not terminate. The depth message says the tableau search depth was exceeded.