ontolearn.base.complex_ce_instances

OWL Reasoner - Complex Class Expression Instances (CCEI).

Module Contents

Classes

OWLReasoner_Owlready2_ComplexCEInstances

Extra convenience methods for OWL Reasoners

Attributes

logger

ontolearn.base.complex_ce_instances.logger
class ontolearn.base.complex_ce_instances.OWLReasoner_Owlready2_ComplexCEInstances(ontology: OWLOntology_Owlready2, base_reasoner: BaseReasoner_Owlready2 | None = None, infer_property_values: bool = True, infer_data_property_values: bool = True, isolate: bool = False)[source]

Bases: ontolearn.base.OWLReasoner_Owlready2

Extra convenience methods for OWL Reasoners

(Not part of OWLAPI)

__slots__ = ('_cnt', '_conv', '_base_reasoner')
update_isolated_ontology(axioms_to_add: List[owlapy.owl_axiom.OWLAxiom] = None, axioms_to_remove: List[owlapy.owl_axiom.OWLAxiom] = None)[source]

Add or remove axioms to the isolated ontology that the reasoner is using.

Parameters:
  • axioms_to_add (List[OWLAxiom]) – Axioms to add to the isolated ontology.

  • axioms_to_remove (List[OWLAxiom]) – Axioms to remove from the isolated ontology.

instances(ce: owlapy.class_expression.OWLClassExpression, direct: bool = False) Iterable[owlapy.owl_individual.OWLNamedIndividual][source]

Gets the individuals which are instances of the specified class expression.

Parameters:
  • ce – The class expression whose instances are to be retrieved.

  • direct – Specifies if the direct instances should be retrieved (True), or if all instances should be retrieved (False).

Returns:

If direct is True, each named individual j where the set of reasoner axioms entails DirectClassAssertion(ce, j). If direct is False, each named individual j where the set of reasoner axioms entails ClassAssertion(ce, j). If ce is unsatisfiable with respect to the set of reasoner axioms then nothing returned.

__del__()[source]