-- 作者:zihui
-- 发布时间:11/12/2009 11:45:00 AM
-- kaon2打不开owlx写的本体,但创建本体的时候又是owlx形式的
弄了半天没弄明白,希望前辈能够指点一二。 package ex04; import java.util.HashMap; import org.semanticweb.kaon2.api.DefaultOntologyResolver; import org.semanticweb.kaon2.api.KAON2Exception; import org.semanticweb.kaon2.api.KAON2Manager; import org.semanticweb.kaon2.api.Ontology; import org.semanticweb.kaon2.api.OntologyManager; import org.semanticweb.kaon2.api.owl.elements.Description; import org.semanticweb.kaon2.api.owl.elements.Individual; import org.semanticweb.kaon2.api.owl.elements.OWLClass; import org.semanticweb.kaon2.api.owl.elements.ObjectProperty; import org.semanticweb.kaon2.api.reasoner.Reasoner; public class Testincon { /** * @param args * @throws KAON2Exception * @throws InterruptedException */ public static void main(String[] args) throws KAON2Exception, InterruptedException { OntologyManager ontologyManager = KAON2Manager.newOntologyManager(); DefaultOntologyResolver resolver = new DefaultOntologyResolver(); resolver.registerReplacement("http://kaon2.semanticweb.org/example04","file:example04.xml"); ontologyManager.setOntologyResolver(resolver); System.out.println("adfa;;;;;;;;;;;;;;;kaf"); Ontology ontology = ontologyManager.openOntology("http://kaon2.semanticweb.org/example04",new HashMap<String,Object>()); } } Exception in thread "main" org.semanticweb.kaon2.api.KAON2Exception: Error in parsing. at org.semanticweb.kaon2.sdb.a(Unknown Source) at org.semanticweb.kaon2.dx.parseOntology(Unknown Source) at org.semanticweb.kaon2.gr.a(Unknown Source) at org.semanticweb.kaon2.er.b(Unknown Source) at org.semanticweb.kaon2.er.a(Unknown Source) at org.semanticweb.kaon2.be.b(Unknown Source) at org.semanticweb.kaon2.be.f(Unknown Source) at org.semanticweb.kaon2.ud.openOntology(Unknown Source) at org.semanticweb.kaon2.ud.openOntology(Unknown Source) at ex04.Testincon.main(Testincon.java:31) Caused by: java.lang.IllegalArgumentException at org.semanticweb.kaon2.sdb.a(Unknown Source) at org.semanticweb.kaon2.sdb.b(Unknown Source) at org.semanticweb.kaon2.sdb.c(Unknown Source) at org.semanticweb.kaon2.dy.<init>(Unknown Source) at org.semanticweb.kaon2.ey.<init>(Unknown Source) at org.semanticweb.kaon2.hy.a(Unknown Source) at org.semanticweb.kaon2.sdb.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)adfa;;;;;;;;;;;;;;;kaf at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) ... 10 more
|