首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用sync_reasoner时出现Owlready2解析错误

调用sync_reasoner时出现Owlready2解析错误
EN

Stack Overflow用户
提问于 2018-06-21 23:35:54
回答 1查看 703关注 0票数 0

本体是使用protege创建的,并使用owlready2库填充数据库中的数据。现在,这一行给出了这个错误:

sync_reasoner(my_world)

这是我遇到的错误:

无法分析本体。找不到合适的解析器,或者解析失败。有关说明,请参阅下面的解析器日志。尝试了以下解析器: 1) RDFXMLParser 2) OWLXMLParser 3) OWLFunctionalSyntaxOWLParser 4) TurtleOntologyParser 5) OWLOBOParser 6) KRSS2OWLParser 7) ManchesterOWLSyntaxOntologyParser

详细日志:

代码语言:javascript
复制
Parser: RDFXMLParser 
org.xml.sax.SAXParseException; systemId: file:///C:/Users/THARIN~2/AppData/Local/Temp/tmpin0r193y; lineNumber: 1; columnNumber: 8; Element type "http:" must be followed by either attribute specifications, ">" or "/>". 

-------------------------------------------------------------------------------- 
Parser: OWLXMLParser 
org.xml.sax.SAXParseException; systemId: file:///C:/Users/THARIN~2/AppData/Local/Temp/tmpin0r193y; lineNumber: 1; columnNumber: 8; Element type "http:" must be followed by either attribute specifications, ">" or "/>". 

-------------------------------------------------------------------------------- 
Parser: OWLFunctionalSyntaxOWLParser 
Encountered " <FULLIRI> "<http://www.semanticweb.org/yashoda/ontologies/2017/12/MovieOnto> "" at line 1, column 1. 
Was expecting: 
    "Ontology" ... 
     (Line 0) 

-------------------------------------------------------------------------------- 
Parser: TurtleOntologyParser 
uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered " <ERROR> "< "" at line 64, column 1. 
Was expecting: 
    <EOF>  


-------------------------------------------------------------------------------- 
Parser: OWLOBOParser 
org.coode.owlapi.obo.parser.ParseException: Encountered "<EOF>" at line 941, column 114. 
Was expecting one of: 
    "[" ... 
    <TAG_NAME> ... 
    <QUOTED_STRING> ... 
    <STRING> ... 
    <TAG_VALUE_WS> ... 
    <COMMENT> ... 
     (Line 941) 

-------------------------------------------------------------------------------- 
Parser: KRSS2OWLParser 
de.uulm.ecs.ai.owlapi.krssparser.ParseException: Encountered " ">" "<http://www.semanticweb.org/yashoda/ontologies/2017/12/MovieOnto> "" at line 1, column 1. 
Was expecting: 
    <EOF>  


-------------------------------------------------------------------------------- 
Parser: ManchesterOWLSyntaxOntologyParser 
Encountered <http://www.semanticweb.org/yashoda/ontologies/2017/12/MovieOnto> at line 1 column 1. Expected one of: 
        Individual: 
        AnnotationProperty: 
        Datatype: 
        DataProperty: 
        ObjectProperty: 
        DisjointProperties: 
        ValuePartition: 
        EquivalentClasses: 
        Import: 
        Prefix: 
        DisjointClasses: 
        Class: 
        SameIndividual: 
        DifferentIndividuals: 
 (Line 1) 
EN

回答 1

Stack Overflow用户

发布于 2018-06-25 02:28:19

据我所知(我不是Python程序员),Owlready2使用的是OWLAPI1.3.8版和嵌入式HermiT版本。这个版本非常古老-- HermiT 1.3.8使用的是OWLAPI3,几年前就不再支持了。

解析器在本体的这一部分中出现错误:

代码语言:javascript
复制
<Movie rdf:about="#Wonder_Woman_">
  <isMadeIn rdf:resource="#Hong Kong"/>
</Movie>

<Country rdf:about="#Hong Kong">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</Country>

它正在抱怨#Hong Kong片段-它无法处理空间。更改为:

代码语言:javascript
复制
<Movie rdf:about="#Wonder_Woman_">
  <isMadeIn rdf:resource="#Hong_Kong"/>
</Movie>

<Country rdf:about="#Hong_Kong">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</Country>

允许解析器处理。从长远来看,Owlready2应该更新到更新的HermiT版本。OWLAPI处理版本4中的文件,HermiT 1.3.8.413是Protege中使用的版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50972464

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档