can't access to ontology in other languges

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

can't access to ontology in other languges

mary
This post was updated on .
hello,
I have successfully imported the english ontology using onto = get_ontology("file://ontologies/abc.owl").load(),but i cant access to persian ontology with same statement!it gives me an error:


Traceback (most recent call last):
  File "<pyshell#132>", line 1, in <module>
    quran2 = get_ontology("file://C:/Users/Ali/Desktop/quran_farhang2.owl").load()
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python35\lib\site-packages\owlready2\namespace.py", line 520, in load
    self._load_properties()
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python35\lib\site-packages\owlready2\namespace.py", line 541, in _load_properties
    Prop = self.world._get_by_storid(prop_storid)
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python35\lib\site-packages\owlready2\namespace.py", line 332, in _get_by_storid
    return self._get_by_storid2(storid, full_iri, main_type, main_onto)
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python35\lib\site-packages\owlready2\namespace.py", line 402, in _get_by_storid2
    entity = AnnotationPropertyClass(name, tuple(types) or (AnnotationProperty,), { "namespace" : namespace, "is_a" : is_a_entities, "storid" : storid } )
  File "C:\Users\Ali\AppData\Local\Programs\Python\Python35\lib\site-packages\owlready2\prop.py", line 50, in __new__
    raise TypeError("Property '%s' is both an AnnotationProperty and a DataProperty!" % iri)
TypeError: Property 'http://quran.itrc.ac.ir/quran#تاریخ' is both an AnnotationProperty and a DataProperty!




Reply | Threaded
Open this post in threaded view
|

Re: can't access to ontology in other languges

Jiba
Administrator
Hello,

For your first problem, the error is:

        TypeError: Property 'http://quran.itrc.ac.ir/quran#تاریخ' is both an AnnotationProperty and a DataProperty!

It means that property 'http://quran.itrc.ac.ir/quran#تاریخ' is both declared/used as an AnnotationProperty and a DataProperty -- this is not correct in OWL (although RDF accepts it).


For your second problem, I have successfully loaded the pizza ontology, as follows:


from owlready2 import *
onto = get_ontology("https://protege.stanford.edu/ontologies/pizza/pizza.owl").load()
print(list(onto.classes()))

[pizza.American, pizza.AmericanHot, pizza.AnchoviesTopping, pizza.ArtichokeTopping, pizza.AsparagusTopping, pizza.Cajun, pizza.CajunSpiceTopping, pizza.CaperTopping,...]


Best regards,
Jean-Baptiste Lamy
MCF HDR, Laboratoire LIMICS, Université Paris 13