'python_name' property is not defined.

Posted by Fay on
URL: http://owlready.306.s1.nabble.com/python-name-property-is-not-defined-tp1790.html

Dear Friends, could anyone help me please.!

I import an ontology:

class ont_Service(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self):
        super(ont_Service, self).__init__()
        self.setupUi(self)
        self.ontShow.clicked.connect(self.classTree)


    def classTree(self):

        file = QFileDialog.getOpenFileName(self, "打开", "C:/", "Text Files (*.owl)")
        filepath = file[0]
        ontpath = "file://" + filepath
        ont = get_ontology(ontpath).load()

**** I want to show the classes in a window.

Traceback (most recent call last):
  File "F:/OntServiceSystem/main_interface.py", line 64, in classTree
    ont = get_ontology(ontpath).load()
  File "D:\Program Files (x86)\Anaconda3\lib\site-packages\owlready2\namespace.py", line 808, in load
    if self.world.graph.indexed: self._load_properties()
  File "D:\Program Files (x86)\Anaconda3\lib\site-packages\owlready2\namespace.py", line 834, in _load_properties
    props.append(Prop.python_name)
  File "D:\Program Files (x86)\Anaconda3\lib\site-packages\owlready2\entity.py", line 556, in __getattr__
    if not Prop: raise AttributeError("'%s' property is not defined." % attr)
AttributeError: 'python_name' property is not defined.