-- 作者:glcyming
-- 发布时间:4/17/2012 6:19:00 PM
-- jena推理中文编码问题
这是用jena推理后输出的内容,怎么解决啊???请高手指点一下啊!!! ------------- | x | ============= | base:娑堣垂鎯呯华 | ------------- 在owl文件中加encoding=“gbk”后,就会出现错误: ERROR [main] (RDFDefaultErrorHandler.java:44) - (line 1 column 1): Content is not allowed in prolog. Exception in thread "main" com.hp.hpl.jena.shared.JenaException: org.xml.sax.SAXParseException: Content is not allowed in prolog. at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(RDFDefaultErrorHandler.java:45) at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:35) at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XMLHandler.java:225) at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError(XMLHandler.java:255) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142) at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158) at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145) at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:183) at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:192) at com.infoearth.LearnJena.loadModel(LearnJena.java:73) at com.infoearth.LearnJena.<init>(LearnJena.java:29) at com.infoearth.LearnJena.main(LearnJena.java:112) Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ... 18 more
|