ontolearn.base.ext

Extra classes.

Package Contents

Classes

OWLReasonerEx

Extra convenience methods for OWL Reasoners

Attributes

logger

ontolearn.base.ext.logger
class ontolearn.base.ext.OWLReasonerEx(ontology: owlapy.owl_ontology.OWLOntology)[source]

Bases: owlapy.owl_reasoner.OWLReasoner

Extra convenience methods for OWL Reasoners

(Not part of OWLAPI)

data_property_ranges(pe: owlapy.owl_property.OWLDataProperty, direct: bool = False) Iterable[owlapy.owl_data_ranges.OWLDataRange][source]

Gets the data ranges that are the direct or indirect ranges of this property with respect to the imports closure of the root ontology.

Parameters:
  • pe – The property expression whose ranges are to be retrieved.

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

Returns:

all_data_property_values(pe: owlapy.owl_property.OWLDataProperty, direct: bool = True) Iterable[owlapy.owl_literal.OWLLiteral][source]

Gets all values for the given data property expression that appear in the knowledge base.

Parameters:
  • pe – The data property expression whose values are to be retrieved

  • direct – Specifies if only the direct values of the data property pe should be retrieved (True), or if the values of sub properties of pe should be taken into account (False).

Returns:

A set of OWLLiterals containing literals such that for each literal l in the set, the set of reasoner axioms entails DataPropertyAssertion(pe ind l) for any ind.

ind_data_properties(ind: owlapy.owl_individual.OWLNamedIndividual, direct: bool = True) Iterable[owlapy.owl_property.OWLDataProperty][source]

Gets all data properties for the given individual that appear in the knowledge base.

Parameters:
  • ind – The named individual whose data properties are to be retrieved

  • direct – Specifies if the direct data properties should be retrieved (True), or if all data properties should be retrieved (False), so that sub properties are taken into account.

Returns:

All data properties pe where the set of reasoner axioms entails DataPropertyAssertion(pe ind l) for atleast one l.

ind_object_properties(ind: owlapy.owl_individual.OWLNamedIndividual, direct: bool = True) Iterable[owlapy.owl_property.OWLObjectProperty][source]

Gets all object properties for the given individual that appear in the knowledge base.

Parameters:
  • ind – The named individual whose object properties are to be retrieved

  • direct – Specifies if the direct object properties should be retrieved (True), or if all object properties should be retrieved (False), so that sub properties are taken into account.

Returns:

All data properties pe where the set of reasoner axioms entails ObjectPropertyAssertion(pe ind ind2) for atleast one ind2.