owlapy.owl_reasoner =================== .. py:module:: owlapy.owl_reasoner .. autoapi-nested-parse:: OWL Reasoner Attributes ---------- .. autoapisummary:: owlapy.owl_reasoner.logger Classes ------- .. autoapisummary:: owlapy.owl_reasoner.StructuralReasoner owlapy.owl_reasoner.SyncReasoner Functions --------- .. autoapisummary:: owlapy.owl_reasoner.initialize_reasoner owlapy.owl_reasoner.import_and_include_axioms_generators Module Contents --------------- .. py:data:: logger .. py:class:: StructuralReasoner(ontology: Union[owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntology, str], *, class_cache: bool = True, property_cache: bool = True, negation_default: bool = True, sub_properties: bool = False) Bases: :py:obj:`owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner` Tries to check instances fast (but maybe incomplete). .. py:attribute:: class_cache :type: bool :value: True .. py:method:: reset() The reset method shall reset any cached state. .. py:method:: data_property_domains(pe: owlapy.owl_property.OWLDataProperty, direct: bool = False) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the class expressions that are the direct or indirect domains of this property with respect to the imports closure of the root ontology. :param pe: The property expression whose domains are to be retrieved. :param direct: Specifies if the direct domains should be retrieved (True), or if all domains should be retrieved (False). :returns: Let N = equivalent_classes(DataSomeValuesFrom(pe rdfs:Literal)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(DataSomeValuesFrom(pe rdfs:Literal), true). If direct is False: then the result of super_classes(DataSomeValuesFrom(pe rdfs:Literal), false) together with N if N is non-empty. (Note, rdfs:Literal is the top datatype). .. py:method:: object_property_domains(pe: owlapy.owl_property.OWLObjectProperty, direct: bool = False) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the class expressions that are the direct or indirect domains of this property with respect to the imports closure of the root ontology. :param pe: The property expression whose domains are to be retrieved. :param direct: Specifies if the direct domains should be retrieved (True), or if all domains should be retrieved (False). :returns: Let N = equivalent_classes(ObjectSomeValuesFrom(pe owl:Thing)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(ObjectSomeValuesFrom(pe owl:Thing), true). If direct is False: then the result of super_classes(ObjectSomeValuesFrom(pe owl:Thing), false) together with N if N is non-empty. .. py:method:: object_property_ranges(pe: owlapy.owl_property.OWLObjectProperty, direct: bool = False) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the class expressions that are the direct or indirect ranges of this property with respect to the imports closure of the root ontology. :param pe: The property expression whose ranges are to be retrieved. :param direct: Specifies if the direct ranges should be retrieved (True), or if all ranges should be retrieved (False). :returns: Let N = equivalent_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing), true). If direct is False: then the result of super_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing), false) together with N if N is non-empty. .. py:method:: data_property_ranges(pe: owlapy.owl_property.OWLDataProperty, direct: bool = True) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the data ranges that are the direct or indirect ranges of this property with respect to the imports closure of the root ontology. :param pe: The property expression whose ranges are to be retrieved. :param direct: Specifies if the direct ranges should be retrieved (True), or if all ranges should be retrieved (False). Returns: .. py:method:: equivalent_classes(ce: owlapy.class_expression.OWLClassExpression, only_named: bool = True) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the class expressions that are equivalent to the specified class expression with respect to the set of reasoner axioms. :param ce: The class expression whose equivalent classes are to be retrieved. :returns: All class expressions C where the root ontology imports closure entails EquivalentClasses(ce C). If ce is not a class name (i.e. it is an anonymous class expression) and there are no such classes C then there will be no result. If ce is unsatisfiable with respect to the set of reasoner axioms then owl:Nothing, i.e. the bottom node, will be returned. .. py:method:: disjoint_classes(ce: owlapy.class_expression.OWLClassExpression, only_named: bool = True) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the class expressions that are disjoint with specified class expression with respect to the set of reasoner axioms. :param ce: The class expression whose disjoint classes are to be retrieved. :returns: All class expressions D where the set of reasoner axioms entails EquivalentClasses(D ObjectComplementOf(ce)) or StrictSubClassOf(D ObjectComplementOf(ce)). .. py:method:: different_individuals(ind: owlapy.owl_individual.OWLNamedIndividual) -> Iterable[owlapy.owl_individual.OWLNamedIndividual] Gets the individuals that are different from the specified individual with respect to the set of reasoner axioms. :param ind: The individual whose different individuals are to be retrieved. :returns: All individuals x where the set of reasoner axioms entails DifferentIndividuals(ind x). .. py:method:: same_individuals(ind: owlapy.owl_individual.OWLNamedIndividual) -> Iterable[owlapy.owl_individual.OWLNamedIndividual] Gets the individuals that are the same as the specified individual with respect to the set of reasoner axioms. :param ind: The individual whose same individuals are to be retrieved. :returns: All individuals x where the root ontology imports closure entails SameIndividual(ind x). .. py:method:: data_property_values(e: owlapy.owl_object.OWLEntity, pe: owlapy.owl_property.OWLDataProperty, direct: bool = True) -> Iterable[owlapy.owl_literal.OWLLiteral] Gets the data property values for the specified entity and data property expression. :param e: The owl entity (usually an individual) that is the subject of the data property values. :param pe: The data property expression whose values are to be retrieved for the specified entity. Note: Can be used to get values, for example, of 'label' property of owl entities such as classes and properties too (not only individuals). :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). .. py:method:: all_data_property_values(pe: owlapy.owl_property.OWLDataProperty, direct: bool = True) -> Iterable[owlapy.owl_literal.OWLLiteral] Gets all values for the given data property expression that appear in the knowledge base. :param pe: The data property expression whose values are to be retrieved :param 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. .. py:method:: object_property_values(ind: owlapy.owl_individual.OWLNamedIndividual, pe: owlapy.owl_property.OWLObjectPropertyExpression, direct: bool = False) -> Iterable[owlapy.owl_individual.OWLNamedIndividual] Gets the object property values for the specified individual and object property expression. :param ind: The individual that is the subject of the object property values. :param pe: The object property expression whose values are to be retrieved for the specified individual. :returns: The named individuals such that for each individual j, the set of reasoner axioms entails ObjectPropertyAssertion(pe ind j). .. py:method:: instances(ce: owlapy.class_expression.OWLClassExpression, direct: bool = False, timeout: int = 1000) Gets the individuals which are instances of the specified class expression. :param ce: The class expression whose instances are to be retrieved. :param direct: Specifies if the direct instances should be retrieved (True), or if all instances should be retrieved (False). :param timeout: Time limit in seconds until results must be returned, else empty set is returned. :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. .. py:method:: sub_classes(ce: owlapy.class_expression.OWLClassExpression, direct: bool = False, only_named: bool = True) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the set of named classes that are the strict (potentially direct) subclasses of the specified class expression with respect to the reasoner axioms. :param ce: The class expression whose strict (direct) subclasses are to be retrieved. :param direct: Specifies if the direct subclasses should be retrieved (True) or if the all subclasses (descendant) classes should be retrieved (False). :returns: If direct is True, each class C where reasoner axioms entails DirectSubClassOf(C, ce). If direct is False, each class C where reasoner axioms entails StrictSubClassOf(C, ce). If ce is equivalent to owl:Nothing then nothing will be returned. .. py:method:: super_classes(ce: owlapy.class_expression.OWLClassExpression, direct: bool = False, only_named: bool = True) -> Iterable[owlapy.class_expression.OWLClassExpression] Gets the stream of named classes that are the strict (potentially direct) super classes of the specified class expression with respect to the imports closure of the root ontology. :param ce: The class expression whose strict (direct) super classes are to be retrieved. :param direct: Specifies if the direct super classes should be retrieved (True) or if the all super classes (ancestors) classes should be retrieved (False). :returns: If direct is True, each class C where the set of reasoner axioms entails DirectSubClassOf(ce, C). If direct is False, each class C where set of reasoner axioms entails StrictSubClassOf(ce, C). If ce is equivalent to owl:Thing then nothing will be returned. .. py:method:: equivalent_object_properties(op: owlapy.owl_property.OWLObjectPropertyExpression) -> Iterable[owlapy.owl_property.OWLObjectPropertyExpression] Gets the simplified object properties that are equivalent to the specified object property with respect to the set of reasoner axioms. :param op: The object property whose equivalent object properties are to be retrieved. :returns: All simplified object properties e where the root ontology imports closure entails EquivalentObjectProperties(op e). If op is unsatisfiable with respect to the set of reasoner axioms then owl:bottomDataProperty will be returned. .. py:method:: equivalent_data_properties(dp: owlapy.owl_property.OWLDataProperty) -> Iterable[owlapy.owl_property.OWLDataProperty] Gets the data properties that are equivalent to the specified data property with respect to the set of reasoner axioms. :param dp: The data property whose equivalent data properties are to be retrieved. :returns: All data properties e where the root ontology imports closure entails EquivalentDataProperties(dp e). If dp is unsatisfiable with respect to the set of reasoner axioms then owl:bottomDataProperty will be returned. .. py:method:: disjoint_object_properties(op: owlapy.owl_property.OWLObjectPropertyExpression) -> Iterable[owlapy.owl_property.OWLObjectPropertyExpression] Gets the simplified object properties that are disjoint with the specified object property with respect to the set of reasoner axioms. :param op: The object property whose disjoint object properties are to be retrieved. :returns: All simplified object properties e where the root ontology imports closure entails EquivalentObjectProperties(e ObjectPropertyComplementOf(op)) or StrictSubObjectPropertyOf(e ObjectPropertyComplementOf(op)). .. py:method:: disjoint_data_properties(dp: owlapy.owl_property.OWLDataProperty) -> Iterable[owlapy.owl_property.OWLDataProperty] Gets the data properties that are disjoint with the specified data property with respect to the set of reasoner axioms. :param dp: The data property whose disjoint data properties are to be retrieved. :returns: All data properties e where the root ontology imports closure entails EquivalentDataProperties(e DataPropertyComplementOf(dp)) or StrictSubDataPropertyOf(e DataPropertyComplementOf(dp)). .. py:method:: super_data_properties(dp: owlapy.owl_property.OWLDataProperty, direct: bool = False) -> Iterable[owlapy.owl_property.OWLDataProperty] Gets the stream of data properties that are the strict (potentially direct) super properties of the specified data property with respect to the imports closure of the root ontology. :param dp: The data property whose super properties are to be retrieved. :type dp: OWLDataProperty :param direct: Specifies if the direct super properties should be retrieved (True) or if the all super properties (ancestors) should be retrieved (False). :type direct: bool :returns: Iterable of super properties. .. py:method:: sub_data_properties(dp: owlapy.owl_property.OWLDataProperty, direct: bool = False) -> Iterable[owlapy.owl_property.OWLDataProperty] Gets the set of named data properties that are the strict (potentially direct) subproperties of the specified data property expression with respect to the imports closure of the root ontology. :param dp: The data property whose strict (direct) subproperties are to be retrieved. :param direct: Specifies if the direct subproperties should be retrieved (True) or if the all subproperties (descendants) should be retrieved (False). :returns: If direct is True, each property P where the set of reasoner axioms entails DirectSubDataPropertyOf(P, pe). If direct is False, each property P where the set of reasoner axioms entails StrictSubDataPropertyOf(P, pe). If pe is equivalent to owl:bottomDataProperty then nothing will be returned. .. py:method:: super_object_properties(op: owlapy.owl_property.OWLObjectPropertyExpression, direct: bool = False) -> Iterable[owlapy.owl_property.OWLObjectPropertyExpression] Gets the stream of object properties that are the strict (potentially direct) super properties of the specified object property with respect to the imports closure of the root ontology. :param op: The object property expression whose super properties are to be retrieved. :type op: OWLObjectPropertyExpression :param direct: Specifies if the direct super properties should be retrieved (True) or if the all super properties (ancestors) should be retrieved (False). :type direct: bool :returns: Iterable of super properties. .. py:method:: sub_object_properties(op: owlapy.owl_property.OWLObjectPropertyExpression, direct: bool = False) -> Iterable[owlapy.owl_property.OWLObjectPropertyExpression] Gets the stream of simplified object property expressions that are the strict (potentially direct) subproperties of the specified object property expression with respect to the imports closure of the root ontology. :param op: The object property expression whose strict (direct) subproperties are to be retrieved. :param direct: Specifies if the direct subproperties should be retrieved (True) or if the all subproperties (descendants) should be retrieved (False). :returns: If direct is True, simplified object property expressions, such that for each simplified object property expression, P, the set of reasoner axioms entails DirectSubObjectPropertyOf(P, pe). If direct is False, simplified object property expressions, such that for each simplified object property expression, P, the set of reasoner axioms entails StrictSubObjectPropertyOf(P, pe). If pe is equivalent to owl:bottomObjectProperty then nothing will be returned. .. py:method:: types(ind: owlapy.owl_individual.OWLNamedIndividual, direct: bool = False) -> Iterable[owlapy.class_expression.OWLClass] Gets the named classes which are (potentially direct) types of the specified named individual. :param ind: The individual whose types are to be retrieved. :param direct: Specifies if the direct types should be retrieved (True), or if all types should be retrieved (False). :returns: If direct is True, each named class C where the set of reasoner axioms entails DirectClassAssertion(C, ind). If direct is False, each named class C where the set of reasoner axioms entails ClassAssertion(C, ind). .. py:method:: get_root_ontology() -> owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntology Gets the "root" ontology that is loaded into this reasoner. The reasoner takes into account the axioms in this ontology and its import's closure. .. py:method:: get_instances_from_owl_class(c: owlapy.class_expression.OWLClass) .. py:method:: reset_and_disable_cache() .. py:class:: SyncReasoner(ontology: Union[owlapy.owl_ontology.SyncOntology, str], reasoner='HermiT') Bases: :py:obj:`owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner` An OWLReasoner reasons over a set of axioms (the set of reasoner axioms) that is based on the imports closure of a particular ontology - the "root" ontology. .. py:attribute:: reasoner_name :value: 'HermiT' .. py:attribute:: mapper .. py:attribute:: inference_types_mapping .. py:method:: instances(ce: owlapy.class_expression.OWLClassExpression, direct: bool = False, timeout: int = 1000) Gets the individuals which are instances of the specified class expression. :param ce: The class expression whose instances are to be retrieved. :param direct: Specifies if the direct instances should be retrieved (True), or if all instances should be retrieved (False). :param timeout: Time limit in seconds until results must be returned, else empty set is returned. :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. .. py:method:: equivalent_classes(ce: owlapy.class_expression.OWLClassExpression) Gets the set of named classes that are equivalent to the specified class expression with respect to the set of reasoner axioms. :param ce: The class expression whose equivalent classes are to be retrieved. :type ce: OWLClassExpression :returns: Equivalent classes of the given class expression. .. py:method:: disjoint_classes(ce: owlapy.class_expression.OWLClassExpression, include_bottom_entity=False) Gets the classes that are disjoint with the specified class expression. :param ce: The class expression whose disjoint classes are to be retrieved. :type ce: OWLClassExpression :param include_bottom_entity: Whether to consider OWL Nothing. Defaults to False. :type include_bottom_entity: bool,optional :returns: Disjoint classes of the given class expression. .. py:method:: sub_classes(ce: owlapy.class_expression.OWLClassExpression, direct=False, include_bottom_entity=False) Gets the set of named classes that are the strict (potentially direct) subclasses of the specified class expression with respect to the reasoner axioms. Args: ce (OWLClassExpression): The class expression whose strict (direct) subclasses are to be retrieved. direct (bool, optional): Specifies if the direct subclasses should be retrieved (True) or if all subclasses (descendant) classes should be retrieved (False). Defaults to False. include_bottom_entity (bool, optional): Specifies if owl nothing should be returned or not. :returns: The subclasses of the given class expression depending on `direct` field. .. py:method:: super_classes(ce: owlapy.class_expression.OWLClassExpression, direct=False) Gets the stream of named classes that are the strict (potentially direct) super classes of the specified class expression with respect to the imports closure of the root ontology. :param ce: The class expression whose strict (direct) subclasses are to be retrieved. :type ce: OWLClassExpression :param direct: Specifies if the direct superclasses should be retrieved (True) or if all superclasses (descendant) classes should be retrieved (False). Defaults to False. :type direct: bool, optional :returns: The subclasses of the given class expression depending on `direct` field. .. py:method:: data_property_domains(p: owlapy.owl_property.OWLDataProperty, direct: bool = False) Gets the class expressions that are the direct or indirect domains of this property with respect to the imports closure of the root ontology. :param p: The property expression whose domains are to be retrieved. :param direct: Specifies if the direct domains should be retrieved (True), or if all domains should be retrieved (False). :returns: Let N = equivalent_classes(DataSomeValuesFrom(pe rdfs:Literal)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(DataSomeValuesFrom(pe rdfs:Literal), true). If direct is False: then the result of super_classes(DataSomeValuesFrom(pe rdfs:Literal), false) together with N if N is non-empty. (Note, rdfs:Literal is the top datatype). .. py:method:: object_property_domains(p: owlapy.owl_property.OWLObjectProperty, direct: bool = False) Gets the class expressions that are the direct or indirect domains of this property with respect to the imports closure of the root ontology. :param p: The property expression whose domains are to be retrieved. :param direct: Specifies if the direct domains should be retrieved (True), or if all domains should be retrieved (False). :returns: Let N = equivalent_classes(ObjectSomeValuesFrom(pe owl:Thing)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(ObjectSomeValuesFrom(pe owl:Thing), true). If direct is False: then the result of super_classes(ObjectSomeValuesFrom(pe owl:Thing), false) together with N if N is non-empty. .. py:method:: object_property_ranges(p: owlapy.owl_property.OWLObjectProperty, direct: bool = False) Gets the class expressions that are the direct or indirect ranges of this property with respect to the imports closure of the root ontology. :param p: The property expression whose ranges are to be retrieved. :param direct: Specifies if the direct ranges should be retrieved (True), or if all ranges should be retrieved (False). :returns: Let N = equivalent_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing)). If direct is True: then if N is not empty then the return value is N, else the return value is the result of super_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing), true). If direct is False: then the result of super_classes(ObjectSomeValuesFrom(ObjectInverseOf(pe) owl:Thing), false) together with N if N is non-empty. .. py:method:: sub_object_properties(p: owlapy.owl_property.OWLObjectProperty, direct: bool = False, include_bottom_entity=False) Gets the stream of simplified object property expressions that are the strict (potentially direct) subproperties of the specified object property expression with respect to the imports closure of the root ontology. :param p: The object property expression whose strict (direct) subproperties are to be retrieved. :param direct: Specifies if the direct subproperties should be retrieved (True) or if the all subproperties (descendants) should be retrieved (False). :param include_bottom_entity: Specifies if the bottomObjectProperty should be returned. :type include_bottom_entity: bool, optional :returns: If direct is True, simplified object property expressions, such that for each simplified object property expression, P, the set of reasoner axioms entails DirectSubObjectPropertyOf(P, pe). If direct is False, simplified object property expressions, such that for each simplified object property expression, P, the set of reasoner axioms entails StrictSubObjectPropertyOf(P, pe). If pe is equivalent to owl:bottomObjectProperty then nothing will be returned. .. py:method:: super_object_properties(p: owlapy.owl_property.OWLObjectProperty, direct: bool = False) Gets the stream of object properties that are the strict (potentially direct) super properties of the specified object property with respect to the imports closure of the root ontology. :param p: The object property expression whose super properties are to be retrieved. :type p: OWLObjectPropertyExpression :param direct: Specifies if the direct super properties should be retrieved (True) or if the all super properties (ancestors) should be retrieved (False). :type direct: bool :returns: Iterable of super properties. .. py:method:: sub_data_properties(p: owlapy.owl_property.OWLDataProperty, direct: bool = False, include_bottom_entity=False) Gets the set of named data properties that are the strict (potentially direct) subproperties of the specified data property expression with respect to the imports closure of the root ontology. :param p: The data property whose strict (direct) subproperties are to be retrieved. :param direct: Specifies if the direct subproperties should be retrieved (True) or if the all subproperties (descendants) should be retrieved (False). :param include_bottom_entity: Specifies if the bottomDataProperty should be returned. :returns: If direct is True, each property P where the set of reasoner axioms entails DirectSubDataPropertyOf(P, pe). If direct is False, each property P where the set of reasoner axioms entails StrictSubDataPropertyOf(P, pe). If pe is equivalent to owl:bottomDataProperty then nothing will be returned. .. py:method:: super_data_properties(p: owlapy.owl_property.OWLDataProperty, direct: bool = False) Gets the stream of data properties that are the strict (potentially direct) super properties of the specified data property with respect to the imports closure of the root ontology. :param p: The data property whose super properties are to be retrieved. :type p: OWLDataProperty :param direct: Specifies if the direct super properties should be retrieved (True) or if the all super properties (ancestors) should be retrieved (False). :type direct: bool :returns: Iterable of super properties. .. py:method:: different_individuals(i: owlapy.owl_individual.OWLNamedIndividual) Gets the individuals that are different from the specified individual with respect to the set of reasoner axioms. :param i: The individual whose different individuals are to be retrieved. :returns: All individuals x where the set of reasoner axioms entails DifferentIndividuals(ind x). .. py:method:: same_individuals(i: owlapy.owl_individual.OWLNamedIndividual) Gets the individuals that are the same as the specified individual with respect to the set of reasoner axioms. :param i: The individual whose same individuals are to be retrieved. :returns: All individuals x where the root ontology imports closure entails SameIndividual(ind x). .. py:method:: equivalent_object_properties(p: owlapy.owl_property.OWLObjectProperty) Gets the simplified object properties that are equivalent to the specified object property with respect to the set of reasoner axioms. :param p: The object property whose equivalent object properties are to be retrieved. :returns: All simplified object properties e where the root ontology imports closure entails EquivalentObjectProperties(op e). If op is unsatisfiable with respect to the set of reasoner axioms then owl:bottomDataProperty will be returned. .. py:method:: equivalent_data_properties(p: owlapy.owl_property.OWLDataProperty) Gets the data properties that are equivalent to the specified data property with respect to the set of reasoner axioms. :param p: The data property whose equivalent data properties are to be retrieved. :returns: All data properties e where the root ontology imports closure entails EquivalentDataProperties(dp e). If dp is unsatisfiable with respect to the set of reasoner axioms then owl:bottomDataProperty will be returned. .. py:method:: object_property_values(i: owlapy.owl_individual.OWLNamedIndividual, p: owlapy.owl_property.OWLObjectProperty) Gets the object property values for the specified individual and object property expression. :param i: The individual that is the subject of the object property values. :param p: The object property expression whose values are to be retrieved for the specified individual. :returns: The named individuals such that for each individual j, the set of reasoner axioms entails ObjectPropertyAssertion(pe ind j). .. py:method:: data_property_values(e: owlapy.owl_object.OWLEntity, p: owlapy.owl_property.OWLDataProperty) Gets the data property values for the specified entity and data property expression. :param e: The entity (usually an individual) that is the subject of the data property values. :param p: The data property expression whose values are to be retrieved for the specified individual. :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). .. py:method:: disjoint_object_properties(p: owlapy.owl_property.OWLObjectProperty, include_bottom_entity=False) Gets the simplified object properties that are disjoint with the specified object property with respect to the set of reasoner axioms. :param p: The object property whose disjoint object properties are to be retrieved. :param include_bottom_entity: Whether to consider bottomObjectProperty. :type include_bottom_entity: bool,optional :returns: All simplified object properties e where the root ontology imports closure entails EquivalentObjectProperties(e ObjectPropertyComplementOf(op)) or StrictSubObjectPropertyOf(e ObjectPropertyComplementOf(op)). .. py:method:: disjoint_data_properties(p: owlapy.owl_property.OWLDataProperty, include_bottom_entity=False) Gets the data properties that are disjoint with the specified data property with respect to the set of reasoner axioms. :param p: The data property whose disjoint data properties are to be retrieved. :param include_bottom_entity: Whether to consider bottomDataProperty. :type include_bottom_entity: bool,optional :returns: All data properties e where the root ontology imports closure entails EquivalentDataProperties(e DataPropertyComplementOf(dp)) or StrictSubDataPropertyOf(e DataPropertyComplementOf(dp)). .. py:method:: types(individual: owlapy.owl_individual.OWLNamedIndividual, direct: bool = False) Gets the named classes which are (potentially direct) types of the specified named individual. :param individual: The individual whose types are to be retrieved. :param direct: Specifies if the direct types should be retrieved (True), or if all types should be retrieved (False). :returns: If direct is True, each named class C where the set of reasoner axioms entails DirectClassAssertion(C, ind). If direct is False, each named class C where the set of reasoner axioms entails ClassAssertion(C, ind). .. py:method:: has_consistent_ontology() -> bool Check if the used ontology is consistent. :returns: True if the ontology used by this reasoner is consistent, False otherwise. :rtype: bool .. py:method:: infer_axioms(inference_types: list[str]) -> Iterable[owlapy.owl_axiom.OWLAxiom] Infer the specified inference type of axioms for the ontology managed by this instance's reasoner and return them. :param inference_types: Axiom inference types: Avaliable options (can set more than 1): ["InferredClassAssertionAxiomGenerator", "InferredSubClassAxiomGenerator", "InferredDisjointClassesAxiomGenerator", "InferredEquivalentClassAxiomGenerator", "InferredEquivalentDataPropertiesAxiomGenerator","InferredEquivalentObjectPropertyAxiomGenerator", "InferredInverseObjectPropertiesAxiomGenerator","InferredSubDataPropertyAxiomGenerator", "InferredSubObjectPropertyAxiomGenerator","InferredDataPropertyCharacteristicAxiomGenerator", "InferredObjectPropertyCharacteristicAxiomGenerator" ] :returns: Iterable of inferred axioms. .. py:method:: infer_axioms_and_save(output_path: str = None, output_format: str = None, inference_types: list[str] = None) Generates inferred axioms for the ontology managed by this instance's reasoner and saves them to a file. This function uses the OWL API to generate inferred class assertion axioms based on the ontology and reasoner associated with this instance. The inferred axioms are saved to the specified output file in the desired format. :param output_path: The name of the file where the inferred axioms will be saved. :param output_format: The format in which to save the inferred axioms. Supported formats are: - "ttl" or "turtle" for Turtle format - "rdf/xml" for RDF/XML format - "owl/xml" for OWL/XML format If not specified, the format of the original ontology is used. :param inference_types: Axiom inference types: Avaliable options (can set more than 1): ["InferredClassAssertionAxiomGenerator", "InferredSubClassAxiomGenerator", "InferredDisjointClassesAxiomGenerator", "InferredEquivalentClassAxiomGenerator", "InferredEquivalentDataPropertiesAxiomGenerator","InferredEquivalentObjectPropertyAxiomGenerator", "InferredInverseObjectPropertiesAxiomGenerator","InferredSubDataPropertyAxiomGenerator", "InferredSubObjectPropertyAxiomGenerator","InferredDataPropertyCharacteristicAxiomGenerator", "InferredObjectPropertyCharacteristicAxiomGenerator" ] :returns: None (the file is saved to the specified directory) .. py:method:: generate_and_save_inferred_class_assertion_axioms(output='temp.ttl', output_format: str = None) Generates inferred class assertion axioms for the ontology managed by this instance's reasoner and saves them to a file. This function uses the OWL API to generate inferred class assertion axioms based on the ontology and reasoner associated with this instance. The inferred axioms are saved to the specified output file in the desired format. Parameters: ----------- output : str, optional The name of the file where the inferred axioms will be saved. Default is "temp.ttl". output_format : str, optional The format in which to save the inferred axioms. Supported formats are: - "ttl" or "turtle" for Turtle format - "rdf/xml" for RDF/XML format - "owl/xml" for OWL/XML format If not specified, the format of the original ontology is used. Notes: ------ - The function supports saving in multiple formats: Turtle, RDF/XML, and OWL/XML. - The inferred axioms are generated using the reasoner associated with this instance and the OWL API's InferredClassAssertionAxiomGenerator. - The inferred axioms are added to a new ontology which is then saved in the specified format. Example: -------- >>> instance.generate_and_save_inferred_class_assertion_axioms(output="inferred_axioms.ttl", format="ttl") This will save the inferred class assertion axioms to the file "inferred_axioms.ttl" in Turtle format. .. py:method:: is_entailed(axiom: owlapy.owl_axiom.OWLAxiom) -> bool A convenience method that determines if the specified axiom is entailed by the set of reasoner axioms. :param axiom: The axiom to check for entailment. :returns: True if the axiom is entailed by the reasoner axioms and False otherwise. .. py:method:: is_satisfiable(ce: owlapy.class_expression.OWLClassExpression) -> bool A convenience method that determines if the specified class expression is satisfiable with respect to the reasoner axioms. :param ce: The class expression to check for satisfiability. :returns: True if the class expression is satisfiable by the reasoner axioms and False otherwise. .. py:method:: unsatisfiable_classes() A convenience method that obtains the classes in the signature of the root ontology that are unsatisfiable. .. py:method:: get_root_ontology() -> owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntology Gets the "root" ontology that is loaded into this reasoner. The reasoner takes into account the axioms in this ontology and its import's closure. .. py:function:: initialize_reasoner(reasoner: str, owlapi_ontology) .. py:function:: import_and_include_axioms_generators()