java - YAGO 本体无法被 OWL API 解析

标签 java parsing owl owl-api turtle-rdf

我正在使用 OWL API(5.1.7) 尝试加载 YAGO 本体。我下载了两个 YAGO 分类法( YAGOTaxonomy.ttlYAGOTaxonomy.tsv ),之后我使用以下代码创建了一个简单的 java 文件

OWLOntologyManager man = OWLManager.createOWLOntologyManager();
    try {
        OWLOntology ow = man.loadOntologyFromOntologyDocument(new File(filed));
        System.out.println(ow);
    } catch (OWLOntologyCreationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

问题是,当我运行它时,我收到系统似乎无法解析它的错误。

 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
org.semanticweb.owlapi.io.UnparsableOntologyException: Problem parsing file:/H:/toplevel/myDownloads/yagoTaxonomy.tsv.7z
Could not parse ontology.  Either a suitable parser could not be found, or parsing failed.  See parser logs below for explanation.
The following parsers were tried:
1) org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser@443118b0
2) org.semanticweb.owlapi.owlxml.parser.OWLXMLParser@6bf0219d
3) org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParser@41c2284a
4) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RioTurtleDocumentFormatFactory@95fd655c
5) org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxOntologyParser@c88a337
6) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.NQuadsDocumentFormatFactory@6f9c39ad
7) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.TrigDocumentFormatFactory@27e81c
8) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.NTriplesDocumentFormatFactory@937ecd36
9) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFJsonDocumentFormatFactory@cd748dc3
10) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFJsonLDDocumentFormatFactory@dcacc47d
11) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.N3DocumentFormatFactory@9a5
12) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RioRDFXMLDocumentFormatFactory@69b9a3bc
13) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.TrixDocumentFormatFactory@27e82d
14) org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParser@723e88f9
15) org.semanticweb.owlapi.oboformat.OBOFormatOWLAPIParser@4c012563
16) org.semanticweb.owlapi.dlsyntax.parser.DLSyntaxOWLParser@13b3d178
17) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.BinaryRDFDocumentFormatFactory@3bf24493
18) org.semanticweb.owlapi.krss2.parser.KRSS2OWLParser@704deff2
19) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFaDocumentFormatFactory@264e8d

我发现了另一个处理类似问题的 stackoverflow 问题 but it doesn't seem to solve my issue

任何帮助将不胜感激。

最佳答案

查看堆栈跟踪,它指出无法找到您尝试加载的“.7z”文件的合适解析器解析文件时出现问题:/H:/toplevel/myDownloads/yagoTaxonomy.tsv.7z

尝试使用解压的 TTL 版本 yagoTaxonomy.ttl.7z,您在问题中发布了该版本的链接。

关于java - YAGO 本体无法被 OWL API 解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52846727/

相关文章:

json - Golang/gin 从 gin.Context 解析 JSON

python - 如何解析 XML 文件中的 VCARD

c# - 从 VAT eu 解析一个 json

java - 如何将 URI 中的尾随字符从 # 更改为/in <rdf :RDF xmlns =""> - owl api

rdf - Must 的 OWL 限制

java - org.springframework.beans.factory.UnsatisfiedDependencyException : Error creating bean. ..期望单个匹配的bean,但发现12

Java 接口(interface) Start/Stop 已经存在?

conditional-statements - 门徒-猫头鹰 : Class must have one of each <value>

java - Java 中可靠的 UDP 协议(protocol)实现——为什么会这样?

Java动态列标题