Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving an OWLClasss with save_owl_class_expressions #366

Open
Demirrr opened this issue Apr 3, 2024 · 0 comments
Open

Saving an OWLClasss with save_owl_class_expressions #366

Demirrr opened this issue Apr 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Demirrr
Copy link
Member

Demirrr commented Apr 3, 2024

An owl class cannot be saved at the moment.

from owlapy.model import IRI, OWLObjectOneOf, OWLClass
from ontolearn.utils.static_funcs import save_owl_class_expressions
save_owl_class_expressions(OWLClass(IRI.create('http://www.benchmark.org/family#Brother')))

Traceback (most recent call last):
  File "/home/demir/Desktop/Softwares/Ontolearn/ontolearn/utils/static_funcs.py", line 182, in save_owl_class_expressions
    manager.add_axiom(ontology, equivalent_classes_axiom)
  File "/home/demir/Desktop/Softwares/Ontolearn/ontolearn/base/_base.py", line 100, in add_axiom
    axioms._add_axiom(axiom, ontology, self._world)
  File "/home/demir/anaconda3/envs/venv/lib/python3.10/functools.py", line 889, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/home/demir/Desktop/Softwares/Ontolearn/ontolearn/base/axioms.py", line 156, in _
    ce_2_x.equivalent_to.append(ce_1_x)
  File "/home/demir/anaconda3/envs/venv/lib/python3.10/site-packages/owlready2/util.py", line 89, in append
    def append(self, x):          old = list(self); super().append(x)         ; self._callback(self._obj, old)
  File "/home/demir/anaconda3/envs/venv/lib/python3.10/site-packages/owlready2/entity.py", line 219, in _class_equivalent_to_changed
    if not x.equivalent_to._indirect is None:
AttributeError: 'NoneType' object has no attribute 'equivalent_to'

Exception at creating OWLEquivalentClassesAxiom
OWLEquivalentClassesAxiom([OWLClass(IRI('https://dice-research.org/predictions#','Brother')), OWLClass(IRI('http://www.benchmark.org/family#','Brother'))],[])
OWLClass(IRI('https://dice-research.org/predictions#','Brother'))
OWLClass(IRI('http://www.benchmark.org/family#','Brother'))
[OWLClass(IRI('http://www.benchmark.org/family#','Brother'))]
@Demirrr Demirrr added the bug Something isn't working label Apr 4, 2024
@Demirrr Demirrr self-assigned this Apr 4, 2024
Demirrr added a commit that referenced this issue Apr 4, 2024
…ed. We should be using rdflib to serialize prediction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant