以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  kaon2打不开owlx写的本体,但创建本体的时候又是owlx形式的  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=78167)


--  作者: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


--  作者:gqi
--  发布时间:11/12/2009 8:17:00 PM

--  
你直接保存为OWL-RDF不就行了。
--  作者:zihui
--  发布时间:11/13/2009 11:42:00 AM

--  
保存为OWL_rdf也不行。。。


Exception in thread "main" org.semanticweb.kaon2.api.KAON2Exception: Error in parsing.
 at org.semanticweb.kaon2.ew.a(Unknown Source)
 at org.semanticweb.kaon2.cw.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:29)
Caused by: org.semanticweb.kaon2.ydb: [line=58:column=55] URI 'http://kaon2.semanticweb.org/example04#project#semanticWeb' cannot be resolved against curent base URI http://kaon2.semanticweb.org/example04
 at org.semanticweb.kaon2.rdb.a(Unknown Source)
 at org.semanticweb.kaon2.rdb.e(Unknown Source)
 at org.semanticweb.kaon2.rdb.e(Unknown Source)
 at org.semanticweb.kaon2.sw.a(Unknown Source)
 at org.semanticweb.kaon2.rdb.startElement(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
 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)
 at org.semanticweb.kaon2.rdb.a(Unknown Source)
 ... 10 more
Caused by: java.lang.IllegalArgumentException
 at java.net.URI.create(Unknown Source)
 at java.net.URI.resolve(Unknown Source)
 ... 28 more
Caused by: java.net.URISyntaxException: Illegal character in fragment at index 46: http://kaon2.semanticweb.org/example04#project#semanticWeb
 at java.net.URI$Parser.fail(Unknown Source)
 at java.net.URI$Parser.checkChars(Unknown Source)
 at java.net.URI$Parser.parse(Unknown Source)
 at java.net.URI.<init>(Unknown Source)
 ... 30 more


--  作者:zihui
--  发布时间:11/13/2009 11:53:00 AM

--  
Individual的uri写错了,谢谢!
--  作者:Humphrey
--  发布时间:11/15/2009 2:58:00 PM

--  
owlx形式?!它是怎样一种文档形式,属于哪种工具可以支持的呢?
--  作者:zihui
--  发布时间:11/23/2009 9:05:00 AM

--  一种xml形式的ow文件格式kaon2支持l
----------------------
--  作者:zihui
--  发布时间:11/23/2009 9:06:00 AM

--  
owl
--  作者:Humphrey
--  发布时间:11/23/2009 2:40:00 PM

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