0

我正在尝试加载本体,但我收到一个错误,您可以在帖子中看到,代码如下所示。

代码:

from owlready2 import * 
import os
onto = get_ontology("file://C:/Users/achev/Documents/Carro.owl") 
onto.load() 
n_classes = len(list(onto.classes()))
print(n_classes)

错误:

File "c:/Users/achev/Desktop/Proyecto de grado/Python/prueba.py", line 4, in <module>
    onto = get_ontology("file://C:/Users/achev/Documents/Carro.owl").load()
  File "C:\ProgramData\Anaconda3\lib\site-packages\owlready2\namespace.py", line 810, in load
    if self.world.graph.indexed: self._load_properties()
  File "C:\ProgramData\Anaconda3\lib\site-packages\owlready2\namespace.py", line 849, in _load_properties
    raise TypeError("'%s' belongs to more than one entity types (cannot be both a property and a class/an individual)!" % Prop.iri)
4

0 回答 0