protege中 org.xml.sax.SAXParseException: White spaces are required between publicId and systemId

  刚刚接触本体建模,很多东西不懂。用protege加载CIDOC CRM的owl文件然后将其转存至本地后无法打开,网上查了一下,原因是命名空间所声明的本体没有加载进来(即当前所用本体依赖于其它上层本体),于是在<owl:Ontology rdf:about=""> </owl:Ontology>中把所有声明都加进去了,形式如下:

  <owl:imports rdf:resource="http://www.w3.org/2003/11/swrlb#" /> 

  <owl:imports rdf:resource="http://www.w3.org/2003/11/swrl#" />

  <owl:imports rdf:resource="http://protege.stanford.edu/plugins/owl/protege#" />

  <owl:imports rdf:resource="http://www.owl-ontologies.com/2005/08/07/xsp.owl" />

  ……

报错

  org.xml.sax.SAXParseException: White spaces are required between publicId and systemId

最开始被异常信息欺骗了,以为哪里少了个空格,实际上真正原因是publicId and systemId冲突,即你的命名和系统命名冲突了。于是所有全部删掉,只留下一个

  <owl:imports rdf:resource="http://www.owl-ontologies.com/2005/08/07/xsp.owl" />

搞定!猜测原因可能是有些上层本体是protege里有的(太基础太常用了),你再由外部引入就会产生冲突,而另一些是系统里没有的,比如这里的xsp.owl。

原文地址:https://www.cnblogs.com/rouge/p/3099196.html