protege api使用过程中遇到的问题

1.stanford.edu被墙了,只好翻墙过去看

 

2.protege3.4.8运行JESS报错:

Exception running rule engine: error running Jess rule engine: Jess reported an error in routine inferOWLPropertyAssertionAxiom
 while executing (inferOWLPropertyAssertionAxiom ###### ?x #####)
 while executing defrule MAIN::########.
  Message: error occured when inferring OWL property assertion axiom: .

查到原因是:

http://comments.gmane.org/gmane.comp.misc.ontology.protege.owl/36680

原来是BUG,不能用子属性。好郁闷。

试了3.5a,好像问题更多,4.0都打不开owl文件....

退回3.4.6,还是不行

 

3.   SWRLRuleEngine ruleEngine = SWRLRuleEngineFactory.create("SWRLJessBridge",owlModel);
      ruleEngine.infer();

报错:

===========================================================================

2012-4-5 4:18:17 com.sun.xml.ws.server.sei.EndpointMethodHandler invoke
严重: edu.stanford.smi.protegex.owl.model.impl.DefaultRDFProperty
java.lang.ClassCastException: edu.stanford.smi.protegex.owl.model.impl.DefaultRDFProperty
        at edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getOWLDatatypeProperty(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.model.impl.DefaultSWRLImp.getRuleEnabledProperty(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.model.impl.DefaultSWRLImp.getIsRuleEnabledAnnotation(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.model.impl.DefaultSWRLImp.updateEnabledAndGroupInformation(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.model.impl.DefaultSWRLImp.isEnabled(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.owlapi.impl.OWLOntologyImpl.getSWRLRules(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.owlapi.impl.OWLDataFactoryImpl.getSWRLRules(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.bridge.impl.OWLAxiomProcessorImpl.importSWRLRules(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.bridge.impl.OWLAxiomProcessorImpl.processSWRLRules(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.bridge.impl.DefaultSWRLRuleEngine.importSWRLRulesAndOWLKnowledge(Unknown Source)
        at edu.stanford.smi.protegex.owl.swrl.bridge.impl.DefaultSWRLRuleEngine.infer(Unknown Source)
        at com.harveyhu.peanalysis.PEAnalysisSrv.getAnalysis(PEAnalysisSrv.java:113)
        at com.harveyhu.peanalysis.PEAnalysisSrvDelegate.getAnalysis(PEAnalysisSrvDelegate.java:9)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
        at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
        at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
        at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
        at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
        at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
        at java.lang.Thread.run(Unknown Source)
===================================================================================================

在官方论坛http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nabble.com寻求解答,无果

使劲google之,猜可能是

https://mailman.stanford.edu/pipermail/protege-owl/2010-July/014919.html
同样的问题。

修改JVM参数

-Dprotege.dir="C:\\Protege_3.4.6"

问题解决。

同时解决下面的WARNING:

===================================================================================================

WARNING: [Local Folder Repository] The specified file must be a directory. (D:\tomcat6\bin\plugins\edu.stanford.smi.protegex.owl) -- LocalFolderRepository.update()
Loading triples for: file:/d:/PhysicalExam.owl
    Completed triple loading after 817 ms
WARNING: Exception caught trying to parse http://swrl.stanford.edu/ontologies/3.3/swrla.owl for an ontology declaration -- java.io.IOException: java.net.UnknownHostException: swrl.stanford.edu
 at edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.searchForOntologyDeclaration(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.init(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.util.OntologyNameExtractor.<init>(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.update(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.impl.HTTPRepository.<init>(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.RepositoryManager.getRepository(Unknown Source)
 at edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.getRepository(Unknown Source)
 at edu.stanford.smi.protegex.owl.model.impl.AbstractOWLModel.loadImportedAssertions(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.processImports(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.loadTriples(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.run(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown Source)
 at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
 at edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown Source)
 at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown Source)
 at com.harveyhu.peanalysis.PEAnalysisSrv.getAnalysis(PEAnalysisSrv.java:81)
 at com.harveyhu.peanalysis.PEAnalysisSrvDelegate.getAnalysis(PEAnalysisSrvDelegate.java:9)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
 at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
 at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
 at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
 at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
 at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
 at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
 at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
 at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
 at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
 at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
 at java.lang.Thread.run(Unknown Source)
Caused by: Could not get input stream for http://swrl.stanford.edu/ontologies/3.3/swrla.owl
 at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown Source)
 at edu.stanford.smi.protegex.owl.repository.util.URLInputSource.getInputStream(Unknown Source)
 ... 51 more
Caused by: java.net.UnknownHostException: swrl.stanford.edu
 at java.net.PlainSocketImpl.connect(Unknown Source)
 at java.net.Socket.connect(Unknown Source)
 at sun.net.NetworkClient.doConnect(Unknown Source)
 at sun.net.www.http.HttpClient.openServer(Unknown Source)
 at sun.net.www.http.HttpClient.openServer(Unknown Source)
 at sun.net.www.http.HttpClient.<init>(Unknown Source)
 at sun.net.www.http.HttpClient.New(Unknown Source)
 at sun.net.www.http.HttpClient.New(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
 at edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser.getInputStream(Unknown Source)
 ... 52 more

==================================================================================================

前几天运行没问题的,突然报错,可能还是因为被墙了的原因。以前还可以通过网络获取http://swrl.stanford.edu/ontologies/3.3/swrla.owl

现在不行了,所以出错了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值