• 大小: 230KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-25
  • 语言: 其他
  • 标签: SemanticWeb  

资源简介

《Web3.0与SemanticWeb编程》配套源代码 《Web3.0与SemanticWeb编程》配套代码

资源截图

代码片段和文件信息

package net.semwebprogramming.chapter12;

import edu.uga.cs.lsdis.sawsdl.util.SAWSDLUtility;
import edu.uga.cs.lsdis.sawsdl.*;

import javax.xml.namespace.QName;
import java.io.File;
import java.util.Map;
import java.util.List;


public class SAWSDLExample {
 
    public static void main(String[] args) throws Exception{
        if (args.length >1 || args.length <1){
            System.out.println(“Need file name“);
            return;
        }
        
        System.setProperty(“javax.wsdl.factory.WSDLFactory“
                “edu.uga.cs.lsdis.sawsdl.impl.factory.WSDLFactoryImpl“);

        File wsdlURI = new File(args[0]);
        Definition definition = SAWSDLUtility.getDefinitionFromFile(wsdlURI);

        assert(definition!=null);
        System.out.println(“Definition created Successfully!“);
 
        Map portTypes = definition.getPortTypes();
        for (object key:portTypes.keySet()){
            PortType semanticPortType = definition.getSemanticPortType((QName)key);

            System.out.println(“Porttype QName ->“ + semanticPortType.getQName());
            System.out.println(“Model References ->“ + semanticPortType.getModelReferences() );

            List operations = semanticPortType.getOperations();

            for (object operation : operations) {
                System.out.println(“Operation ->“ + ((Operation) operation).getName());
            }

        }

        Map messages = definition.getMessages();
        for (object key:messages.keySet()){
            Message semanticMessage = definition.getSemanticMessage((QName)key);

            System.out.println(“Message QName ->“ + semanticMessage.getQName());

            Map parts = semanticMessage.getParts();

            for (object partKey : parts.keySet()) {
                Part semanticPart = semanticMessage.getSemanticPart((String) partKey);
                System.out.println(“part ->“ + semanticPart);
                System.out.println(“part model references ->“ + semanticPart.getModelReferences());
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-03-20 23:31  Chapter1\
     目录           0  2009-03-21 07:50  Chapter10\
     文件        6148  2009-03-21 07:50  Chapter10\.DS_Store
     目录           0  2009-03-21 07:52  __MACOSX\
     目录           0  2009-03-21 07:52  __MACOSX\Chapter10\
     文件          82  2009-03-21 07:50  __MACOSX\Chapter10\._.DS_Store
     目录           0  2009-03-21 07:50  Chapter10\SAWSDLExample\
     文件         449  2009-02-28 21:51  Chapter10\SAWSDLExample\.classpath
     文件        6148  2009-03-21 07:50  Chapter10\SAWSDLExample\.DS_Store
     目录           0  2009-03-21 07:52  __MACOSX\Chapter10\SAWSDLExample\
     文件          82  2009-03-21 07:50  __MACOSX\Chapter10\SAWSDLExample\._.DS_Store
     文件         372  2009-02-28 21:47  Chapter10\SAWSDLExample\.project
     目录           0  2009-02-28 21:47  Chapter10\SAWSDLExample\.settings\
     文件         617  2009-02-28 21:47  Chapter10\SAWSDLExample\.settings\org.eclipse.jdt.core.prefs
     目录           0  2009-02-28 21:47  Chapter10\SAWSDLExample\src\
     目录           0  2009-02-28 21:47  Chapter10\SAWSDLExample\src\net\
     目录           0  2009-02-28 21:47  Chapter10\SAWSDLExample\src\net\semwebprogramming\
     目录           0  2009-02-28 21:51  Chapter10\SAWSDLExample\src\net\semwebprogramming\chapter12\
     文件        2106  2009-02-28 21:53  Chapter10\SAWSDLExample\src\net\semwebprogramming\chapter12\SAWSDLExample.java
     目录           0  2009-03-21 07:50  Chapter11\
     文件        6148  2009-03-21 07:50  Chapter11\.DS_Store
     目录           0  2009-03-21 07:52  __MACOSX\Chapter11\
     文件          82  2009-03-21 07:50  __MACOSX\Chapter11\._.DS_Store
     目录           0  2009-03-21 07:50  Chapter11\rdfa\
     文件        1466  2009-02-28 19:12  Chapter11\rdfa\.classpath
     文件        6148  2009-03-21 07:50  Chapter11\rdfa\.DS_Store
     目录           0  2009-03-21 07:52  __MACOSX\Chapter11\rdfa\
     文件          82  2009-03-21 07:50  __MACOSX\Chapter11\rdfa\._.DS_Store
     文件         368  2009-02-28 19:12  Chapter11\rdfa\.project
     目录           0  2009-03-20 23:31  Chapter11\rdfa\bin\
     目录           0  2009-03-20 23:31  Chapter11\rdfa\input\
............此处省略378个文件信息

评论

共有 条评论

相关资源