亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法解析某些本體

無法解析某些本體

慕工程0101907 2021-08-25 18:12:32
在解析一組本體時,一些文件給了我以下錯誤,而其他文件運行良好(請注意,我使用的是 OWL API 5.1.6):uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1033)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:933)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadImports(OWLOntologyManagerImpl.java:1630)....Could not parse JSONLD        org.eclipse.rdf4j.rio.jsonld.JSONLDParser.parse(JSONLDParser.java:110)    org.semanticweb.owlapi.rio.RioParserImpl.parseDocumentSource(RioParserImpl.java:172)    org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:125)....Stack trace:org.eclipse.rdf4j.rio.RDFParseException: unqualified attribute 'class' not allowed [line 3, column 65]        org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:138)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:193)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.load(OWLOntologyManagerImpl.java:1071)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1033)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:933)    uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadImports(OWLOntologyManagerImpl.java:1630)....以及許多類似的錯誤。知道如何解決這個問題嗎?更新:加載本體的片段是:File file = new File("C:\\vocabs\\" + Ontofile.getName());OWLOntologyManager m = OWLManager.createOWLOntologyManager();OWLOntology o;o = m.loadOntologyFromOntologyDocument(file);OWLDocumentFormat format = m.getOntologyFormat(o);OWLOntologyXMLNamespaceManager nsManager = new OWLOntologyXMLNamespaceManager(o, format);
查看完整描述

1 回答

?
浮云間

TA貢獻1829條經驗 獲得超4個贊

此錯誤表示您正在解析的本體之一不是有效的 JSON/LD 格式。

要解決此問題,您必須做兩件事:

  • 確保正在使用的格式是您期望的格式:OWLAPI,如果未指定格式,將嘗試使用所有可用的解析器,直到其中之一成功解析本體

  • 如果格式正確,請修復輸入數據:在這種情況下,對于 JSON/LD,錯誤在第 3 行

如果使用的格式不是應有的格式,則需要在代碼中指定一種格式 - 為此,您必須添加用于解析文件的代碼片段。


查看完整回答
反對 回復 2021-08-25
  • 1 回答
  • 0 關注
  • 200 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號