简体   繁体   English

使用OWL API加载YAGO本体

[英]Loading YAGO Ontology with OWL API

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 ). 我第一次使用OWL API(出于兼容性原因,使用3.4.8),并且尝试加载作为YAGO知识库的一部分提供的本体( 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> .

(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.) (我只是复制了一个示例,但是我在turtle文件中的每一行都收到此警告,并且打印位置始终为冒号。)

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? 谁能告诉我这是怎么回事?

As it turned out, some of the URIs in the YAGO ontology contain \\n . 事实证明,YAGO本体中的某些URI包含\\n Removing those \\n s from the URIs that were concerned fixed the problem. 从相关的URI中删除\\n可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM