使用OWL API加载YAGO本体 [英] Loading YAGO Ontology with OWL API
问题描述
我第一次使用OWL API(出于兼容性原因,使用3.4.8),并且尝试加载作为YAGO知识库的一部分提供的本体(
I’m using the OWL API (3.4.8 for compatibility reasons) for the first time, and I’m trying to load an ontology that is provided as part of the YAGO knowledge base (http://resources.mpi-inf.mpg.de/yago-naga/yago3.1/yagoSimpleTaxonomy.ttl.7z). However I keep getting the following warning:
[main] WARN org.obolibrary.oboformat.parser.OBOFormatParser - LINE: 629693 Expected white space at pos: 44 LINE:
<wikicat_Gardens_in_Aomori_Prefecture> rdfs:subClassOf <yagoGeoEntity> .
(我只是复制了一个示例,但是我在turtle文件中的每一行都收到了此警告,并且打印位置始终是冒号.)
(I just copied one example, but I get this warning for every line in the turtle file, and the printed position is always the colon.)
以下是产生这些警告的代码:
Here’s the code that produces those warnings:
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(new File("../data/yago/yagoSimpleTaxonomy.ttl"));
即使它们只是作为警告记录,并且没有引发异常,程序仍会卡在此处.因此,似乎需要解决一些问题.谁能告诉我这是怎么回事?
Even though they are just logged as warnings and there is no exception thrown, the program gets stuck at this point. So, it seems like there is some kind of issue that I need to sort out. Could anyone tell me what’s going on here?
推荐答案
事实证明,YAGO本体中的某些URI包含\n
.从相关的URI中删除这些\n
可以解决此问题.
As it turned out, some of the URIs in the YAGO ontology contain \n
. Removing those \n
s from the URIs that were concerned fixed the problem.
这篇关于使用OWL API加载YAGO本体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!