以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  求助!!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=33989)


--  作者:wolf_xjf
--  发布时间:6/7/2006 8:50:00 PM

--  求助!!
今天刚在试学owl reasoner将owlDemoSchema.xml 和owlDemoData.xml连同owl example里的第一组代码装载进eclipse上出现这样的问题:ERROR [main] (RDFDefaultErrorHandler.java:44) - file:///D:/java/testing/reasoners/bugs/owlDemoData.rdf(line 1 column 7): The processing instruction target matching "[xX][mM][lL]" is not allowed.
java.lang.NullPointerException
 at com.hp.hpl.jena.rdf.model.ModelFactory.createInfModel(ModelFactory.java:289)
 at jena.examples.ontology.classHierarchy.main.main(main.java:80)
Exception in thread "main"
不知何解,望各位大侠指点!!!
--  作者:happy++
--  发布时间:6/8/2006 4:43:00 PM

--  
好像是XML语法有问题
上次遇到过,当时是rdf文档第一行的开头有空格,去掉就行了
<?xml version....>   这行必须顶格写,前面不能有空格
楼主看一下是不是这个问题
--  作者:wolf_xjf
--  发布时间:6/8/2006 7:59:00 PM

--  
谢谢楼上我试过里的方法,它在 public void printStatements(Model m, Resource s, Property p, Resource o)上显示:java.lang.Error: 无法解析的编译问题:
 标记“(”上有语法错误,应为 ;
 标记“,”上有语法错误,应为 ;
 标记“,”上有语法错误,应为 ;
 标记“,”上有语法错误,应为 ;
 标记“)”上有语法错误,应为 ;

 at jena.examples.ontology.classHierarchy.main.main(main.java:85)
Exception in thread "main"


--  作者:jpz6311whu
--  发布时间:6/8/2006 8:19:00 PM

--  
你把owlDemoData.rdf贴出来看看
--  作者:wolf_xjf
--  发布时间:6/8/2006 8:31:00 PM

--  
<?xml version="1.0" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
          xmlns:owl="http://www.w3.org/2002/07/owl#"
          xml:base="urn:x-hp:eg/"
          xmlns="urn:x-hp:eg/">
<Computer rdf:about="urn:x-hp:eg/whiteBoxZX">
<hasMotherBoard rdf:resource="urn:x-hp:eg/nForce" />
<hasBundle>
<GameBundle rdf:about="urn:x-hp:eg/actionPack" />
</hasBundle>
</Computer>
<Computer rdf:about="urn:x-hp:eg/whiteBoxZX">
<hasMotherBoard>
<rdf:Description rdf:about="urn:x-hp:eg/unknownMB">
<hasGraphics rdf:resource="urn:x-hp:eg/gamingGraphics" />
</rdf:Description>
</hasMotherBoard>
</Computer>
<GamingComputer rdf:about="urn:x-hp:eg/alienBox51" />
<Computer rdf:about="urn:x-hp:eg/bigName42">
<hasMotherBoard rdf:resource="urn:x-hp:eg/bigNameSpecialMB" />
<hasBundle rdf:resource="urn:x-hp:eg/binNameSpecialBundle" />
</Computer>
<Computer rdf:about="urn:x-hp:eg/bigName42">
<hasMotherBoard rdf:resource="urn:x-hp:eg/nForce2" />
<hasBundle rdf:resource="urn:x-hp:eg/binNameSpecialBundle" />
</Computer>
<rdf:Description rdf:about="urn:x-hp:eg/bigNameSpecialMB">
<owl:differentFrom rdf:resource="urn:x-hp:eg/nForce2" />
</rdf:Description>
</rdf:RDF>

W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
42.969ms