I used to load an ontology and work with But then !!!

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I used to load an ontology and work with But then !!!

kloud
from owlready2 import *
onto = get_ontology("file://C:/Users/stef info/Downloads/test.owl").load()
countries=onto.search(type=onto.Country)
countries

I used to type this and start to manipulate the ontology But today this error appears :
 countries=onto.search(type=onto.Country)
countries
Traceback (most recent call last):

  File "C:\Users\stef info\Anaconda3\lib\site-packages\IPython\core\formatters.py", line 702, in __call__
    printer.pretty(obj)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\IPython\lib\pretty.py", line 402, in pretty
    return _repr_pprint(obj, self, cycle)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\IPython\lib\pretty.py", line 697, in _repr_pprint
    output = repr(obj)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\util.py", line 139, in __repr__
    list.__init__(self, self._populate())

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\triplelite.py", line 1457, in <genexpr>
    return (self.world._get_by_storid(o) for (o,) in self.world.graph.execute(sql, params).fetchall())

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\namespace.py", line 537, in _get_by_storid
    return self._load_by_storid(storid, full_iri, main_type, main_onto, default_to_none)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\namespace.py", line 557, in _load_by_storid
    Class = self._get_by_storid(obj, None, ThingClass, main_onto)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\namespace.py", line 537, in _get_by_storid
    return self._load_by_storid(storid, full_iri, main_type, main_onto, default_to_none)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\namespace.py", line 592, in _load_by_storid
    full_iri = full_iri or self._unabbreviate(storid)

  File "C:\Users\stef info\Anaconda3\lib\site-packages\owlready2\triplelite.py", line 489, in _unabbreviate_dict
    return self._unabbreviate_d[storid]

KeyError: 307
Reply | Threaded
Open this post in threaded view
|

Re: I used to load an ontology and work with But then !!!

Jiba
Administrator
Hi,

Could you send me your ontology, so that I can investigate the problem?

You can send it by mail at jibalamy /at/ free.fr

Jiba