【问题标题】:YAGO Ontology unparseable by OWL APIOWL API 无法解析的 YAGO 本体
【发布时间】:2018-10-17 03:05:09
【问题描述】:

我正在使用 OWL API(5.1.7) 来尝试加载 YAGO Ontology。我已经下载了 YAGO 分类法(YAGOTaxonomy.ttl,YAGOTaxonomy.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

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

任何帮助将不胜感激。

【问题讨论】:

    标签: java parsing owl owl-api turtle-rdf


    【解决方案1】:

    查看堆栈跟踪,它指出找不到适合您尝试加载的“.7z”文件的解析器Problem parsing file:/H:/toplevel/myDownloads/yagoTaxonomy.tsv.7z

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

    【讨论】:

    • 我已经尝试了两个扩展,它似乎不起作用。
    • @user2333103 ttl 文件肯定可以被解析。 tsv 文件不是正确的 RDF 格式。此外,只要谓词未明确声明为对象或数据属性,OWL API 将无法解析 tsv 文件中的三元组。
    • @AKSW 我试图解析 ttl.7z 文件,我得到了同样的错误。是不是我做错了什么?
    • @user2333103 7z 文件没有解析器,尝试使用 7Zip 程序解压,然后尝试解压后的 TTL 文件
    • 对,OWL API 不支持 7z - 我想知道您为什么首先说您已经尝试了答案中的建议,即提前提取文件?
    猜你喜欢
    • 2013-05-12
    • 2014-11-18
    • 2018-03-18
    • 1970-01-01
    • 2017-11-14
    • 1970-01-01
    • 2014-04-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多