我正在使用用于python的owlready2 api来加载本体,并使用sync_reasoner()函数检查该本体的一致性。但是,它似乎并没有检查本体的一致性。虽然有一个错误,但它没有显示任何!我是否知道如何使用owlready2或任何其他api来检查python中本体的一致性。
这是我的小代码:
from owlready2 import *
onto = get_ontology("test.owl")
sync_reasoner()下面是我得到的输出:
本体:

我修改的代码:
from owlready2 import *
onto = get_ontology("test.owl")
with onto:sync_reasoner()
onto.save()输出我得到的owl文件:

发布于 2018-07-05 01:46:04
基本上我错过了两件重要的事情。
我的工作代码如下:
from owlready2 import *
import owlready2
#owlready2.JAVE_EXE="C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\java.exe"
onto_path.append("C:\\User\\Desktop")
onto = get_ontology("test.owl").load()
#inferred_onto = get_ontology("http://test.org/my_inferrences.owl";)
with onto: sync_reasoner()
onto.save("test_t1.owl")

https://stackoverflow.com/questions/51147628
复制相似问题