<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    一路拾遺
    Collect By Finding All The Way ......
    posts - 81,comments - 41,trackbacks - 0

    Maryland 大學(xué)計算機(jī)系的Evren Sirin 開發(fā)。OWL-S API的類庫主要建立在Axis, Jena 以及Pellet上。
     
    Apache Axis 是Apache Web Service項目中的子項目,其最初起源于IBM的"SOAP4J",應(yīng)該屬于最早的一批用于構(gòu)造基于SOAP應(yīng)用的Framework。它支持WSDL1.1,可自動由Java Object生成WSDL。
     
    Jena主要用來處理RDF,主要使用Jena的推理能力從本體推斷模型知識。
     
    Pellet是一個開源的基于JAVA的OWL推理機(jī)。
     
    包中還自帶兩個jar包形式的java類庫,owl-s.jar和upnp.jar。
    該OWL-S API的主要功能如下:
    讀/寫服務(wù)描述:
    OWL-S API中有兩個重要的接口:OWLOntology和OWLKnowledgeBase。OWLOntology代表了存儲在單個文件中的信息,而 OWLKnowledgeBase是許多Ontology的集合。RDF數(shù)據(jù)可以加載到OWLOntology上,只有OWLOntology對象才能組 合起來。OWLKnowledgeBase中只有一個Ontology是用來存儲數(shù)據(jù)的(例如執(zhí)行之后,新的實例會被加到這個OWLOntology上。
     
    函 數(shù)OWLKnowledgeBase.read(URI)從給定的Ontology讀取信息,并產(chǎn)生OWLOntology。函數(shù) OWLOntology.getService()用來獲取ontology中的服務(wù)實例。如果有許多服務(wù),則用 OWLOntology.getServices()獲取。然后,函數(shù)OWLKnowledgeBase.readService(URI)以及 OWLKnowledgeBase.readServices(URI)將會讀取服務(wù)。如果函數(shù)調(diào)用發(fā)生錯誤將會產(chǎn)生null輸出。
     
    函數(shù)OWLOntology.write(Writer)可以使包含服務(wù)的ontology組合起來。
     
    這是一個例子:


     // create a URI for the service (note that this is a 0.9 version file)  
        URI uri = new URI("http://www.mindswap.org/2004/owl-s/0.9/ZipCodeFinder.owl");
        
    // create a KB 
        OWLKnowledgeBase kb = OWLFactory.createKB();

        
    // create a generic reader and a 1.0 writer
        OWLOntology ont = kb.read(uri);
       
        
    // get the service
        Service service = ont.getService();
       
        
    // write the output to console (a file stream can also be used here)
        ont.write(System.out);


    將舊服務(wù)描述轉(zhuǎn)換為新描述。
     
    驗證
     
    緩存Ontology
     
     
    執(zhí)行服務(wù):
    執(zhí) 行服務(wù)意味著執(zhí)行它的process。Process應(yīng)該有有效的grounding說明,以便有效的調(diào)用服務(wù)。WSDL和UPnP的grounding 由API支持,函數(shù)ProcessExecutionEngine.execute(Process, ValueMap)可以執(zhí)行一個process,ValueMap表示輸入的值,這個函數(shù)返回輸出值。
    舉例如下:
     


     // create an execution engine
        ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();
        
    // load the service description
        Service service = kb.readService("http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl");
        
    // get the process of the service
        Process process = service.getProcess();

        
    // create an empty value map
        ValueMap values = new ValueMap();
       
        
    // set the value of input parameter
        values.setDataValue(process.getInput("InputString"), "computer");   
        
    // 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);

    執(zhí)行跟蹤功能:

    當(dāng)執(zhí)行復(fù)雜的服務(wù)時,知道執(zhí)行的過程是很有用的,ProcessExecutionListener就是為這一目的設(shè)計的。 ProcessExecutionEngine.addExecutionListener(ProcessExecutionListener)就可以 為執(zhí)行器添加這么一個監(jiān)聽器。
     
    生成復(fù)合過程
     
    可以用程序產(chǎn)生服務(wù)的descriptions, profile或者processes描述。OWLOntology接口實現(xiàn)了這個功能。
     

    /**
       *
       * Create a new Sequence from the processes of the given services and put them in a new
       * Service.
       *
       * 
    @param services List of Services
       * 
    @param baseURI The base URI for the generated service
       * 
    @return The Service which is a Sequence of the given services
       
    */
      Service createSequenceService(List services, String baseURI) {  
        
    // create an empty ontology
        OWLOntology ont = OWLFactory.createOntology();
        
    // create a new service
        Service service = ont.createService(URI.create(baseURI + "Service"));
        
    // create a new composite process
        CompositeProcess process = ont.createCompositeProcess(URI.create(baseURI + "Process"));    

        
    // create a new sequence construct
        Sequence sequence = ont.createSequence();
        
    // put the sequence into composite process
        compositeProcess.setComposedOf(sequence);
       
        
    for(int i = 0; i < services.size(); i++) { 
          
    // get the service from the list
          Service s = (Service) services.get(i);
          
    // get the process fron the service
          Process p = s.getProcess();
         
          
    // create a perform construct
          Perform perform = ont.createPreform();
          perform.setProcess(p);
          
    // put the process into the sequence
          sequence.addComponent(p);

          
    // create data flow if necessary

        }

        
    // create profile

        
    // create grounding

        
    return service;
      }

     
    支持功能。

    API中包含了org.mindswap.owls.wsdl這個包,可以用來讀寫WSDL描述的服務(wù)。執(zhí)行OWL-S服務(wù)就是通過這個包實現(xiàn)的。這個功能是建立在AXIS包1.1上的。
    posted on 2008-07-23 16:51 胖胖泡泡 閱讀(539) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲永久中文字幕在线| 99蜜桃在线观看免费视频网站| 亚洲激情电影在线| 亚洲精品无码永久在线观看你懂的| 免费国产小视频在线观看| 99精品一区二区免费视频| 丝袜足液精子免费视频| 日本红怡院亚洲红怡院最新| 日本a级片免费看| 亚洲免费综合色在线视频| 99久久免费看国产精品| 免费观看一区二区三区| 国产成人精品免费大全| 国产精品成人亚洲| 久久亚洲精品11p| 亚洲欧美熟妇综合久久久久 | 色网站在线免费观看| 亚洲一卡2卡三卡4卡无卡下载| 亚洲国产日产无码精品| 永久黄网站色视频免费直播| 日韩色视频一区二区三区亚洲 | 青青青国产在线观看免费| 四虎国产精品永久免费网址 | 亚洲免费在线播放| 亚洲成年轻人电影网站www| 亚洲色爱图小说专区| 亚洲精品乱码久久久久久自慰| jlzzjlzz亚洲乱熟在线播放| 亚洲午夜成人精品电影在线观看| 国产特级淫片免费看| 免费人成视网站在线观看不卡| 国产小视频免费观看| 免费很黄很色裸乳在线观看| 免费国产在线观看| 亚洲成人一区二区| 91手机看片国产永久免费| 4虎永免费最新永久免费地址| 免费观看黄色的网站| 香蕉视频在线免费看| 中文字幕免费观看全部电影| 国内永久免费crm系统z在线|