Skip to content

Commit

Permalink
flexible 'direct' argument for ind_data_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Sep 9, 2024
1 parent 7016b29 commit aada550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion owlapy/abstracts/abstract_owl_reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,13 @@ def ind_data_properties(self, ind: OWLNamedIndividual, direct: bool = True) -> I
for atleast one l.
"""
onto = self.get_root_ontology()
has_direct = "direct" in str(signature(self.data_property_values))
for dp in onto.data_properties_in_signature():
try:
next(iter(self.data_property_values(ind, dp, direct)))
if has_direct:
next(iter(self.data_property_values(ind, dp, direct)))
else:
next(iter(self.data_property_values(ind, dp)))
yield dp
except StopIteration:
pass
Expand Down

0 comments on commit aada550

Please sign in to comment.