以文本方式查看主题

-  W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL  (http://bbs.xml.org.cn/index.asp)
--  『 Web Services & Semantic Web Services 』  (http://bbs.xml.org.cn/list.asp?boardid=10)
----  服务发现与匹配系统架构设计——如何用protege的owls-editor奖wsdl转化成owl  (http://bbs.xml.org.cn/dispbbs.asp?boardid=10&rootid=&id=122204)


--  作者:xufeng5264
--  发布时间:10/31/2011 2:06:00 PM

--  服务发现与匹配系统架构设计——如何用protege的owls-editor奖wsdl转化成owl

大家好,我现在要开发一个基于语义的服务发现与匹配系统,大家看看我的架构有没有问题?
此主题相关图片如下:
按此在新窗口浏览图片

此主题相关图片如下:
按此在新窗口浏览图片
现在遇到了问题,就是如何用owls-editor生成可解析的描述web service的owl文件,我直接单击右下角的import wsdl按钮保存生成的owl文件无法被owls-api解析,
无法解析首先表现在
Service service = ont.getService();
语句得到的service为空(null)
代码如下:
package newTest1;
import java.net.URI;
import org.mindswap.owl.OWLFactory;
import org.mindswap.owl.OWLKnowledgeBase;
import org.mindswap.owl.OWLOntology;
import org.mindswap.owls.OWLSFactory;
import org.mindswap.owls.process.Process;
import org.mindswap.owls.process.execution.ProcessExecutionEngine;
import org.mindswap.owls.service.Service;
import org.mindswap.query.ValueMap;

public class OntoTest {

 public static void main(String[] args)throws Exception {

  URI uri = new URI("http://localhost:8088/newxufeng/shownumber.owl");

        // create a KB  
        OWLKnowledgeBase kb = OWLFactory.createKB();
        
        // set the Reasoner
        kb.setReasoner("Pellet");

        // create a generic reader and a 1.0 writer
        OWLOntology ont = kb.read(uri);
    
        // get the service
        Service service = ont.getService();
        
        // get the process of the service
        Process process = service.getProcess();

        // create an execution engine
        ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();

        // create an empty value map
        ValueMap values = new ValueMap();
        
        // set the value of input parameter
        values.setDataValue(process.getInput("InputString"), "man");    
        // execute the process with the given input bindings
     
        values = exec.execute(process, values);
    
        // get the output value as a string
        String outValue = values.getStringValue(process.getOutput());
        
        // display the result
        System.out.println("Output = " + outValue);

大家共同研讨一下吧,因为导出owl文件的方法有误还是代码错误?


--  作者:hyb22ndf
--  发布时间:3/19/2012 10:54:00 AM

--  
我现在也在做这方面的研究——服务匹配的方法研究,很多地方不是很懂,请问能否加为好友,探讨一下,或者说给我指点迷津吧,谢啦,加我QQ吧,754457756
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
4,889.648ms