Skip to content

Commit

Permalink
fix for ea_initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Feb 28, 2025
1 parent f2634cf commit eaa9549
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ontolearn/ea_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from itertools import chain, cycle

from owlapy.class_expression import OWLClass, OWLClassExpression, OWLThing
from owlapy.iri import IRI
from owlapy.owl_individual import OWLNamedIndividual
from owlapy.owl_literal import OWLLiteral
from owlapy.owl_property import OWLDataProperty, OWLObjectProperty
Expand Down Expand Up @@ -241,6 +242,8 @@ def _select_type(self, ind: OWLNamedIndividual) -> OWLClass:
@lru_cache(maxsize=_cache_size)
def _get_types(self, ind: OWLNamedIndividual, direct: bool = False) -> Set[OWLClass]:
inds = set(self.kb.get_types(ind, direct))
if OWLClass(IRI("http://www.w3.org/2002/07/owl#", "NamedIndividual")) in inds:
inds.remove(OWLClass(IRI("http://www.w3.org/2002/07/owl#", "NamedIndividual")))
return inds if inds else {OWLThing}

@lru_cache(maxsize=_cache_size)
Expand Down

0 comments on commit eaa9549

Please sign in to comment.