亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? classhierarchy.java

?? RDF的解析例程
?? JAVA
字號:
/*****************************************************************************
 * Source code information
 * -----------------------
 * Original author    ICE
 * Author email       pearlriver1981@hotmail.com
 * Created            23-Mar-2006
 * Filename           $RCSfile: ClassHierarchy.java,v $
 * Revision           $Revision: 1.1 $
 * Release status     $State: Exp $
 *
 * Last modified on   $Date: 2005/10/06 17:49:07 $
 *               by   $Author: pearlriver $
 *
 * (c)
 *****************************************************************************/

// Package
///////////////
//
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.hp.hpl.jena.ontology.OntClass;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.Restriction;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.shared.PrefixMapping;
import com.hp.hpl.jena.util.iterator.Filter;



/**
 * <p>
 * Simple demonstration program to show how to list a hierarchy of classes. This
 * is not a complete solution to the problem (sub-classes of restrictions, for example,
 * are not shown).  It is inteded only to be illustrative of the general approach.
 * </p>
 */
public class ClassHierarchy {
    // Constants
    //////////////////////////////////

    // Static variables
    //////////////////////////////////

    // Instance variables
    //////////////////////////////////

    // OntModel 本體模型
    // Map  映射
    // m_anonCount 顧客數(shù)
    //////////////////////////////////
    protected OntModel m_model;
    private Map m_anonIDs = new HashMap();
    private int m_anonCount = 0;

    //所在離根的遠(yuǎn)近
    private HashMap weight = new HashMap();
    //所含兄弟節(jié)點的個數(shù)。
    private HashMap brotherNode = new HashMap();
    //所含的子節(jié)點的個數(shù)。
    private HashMap sonNode = new  HashMap();
    
    private int Scalingfactor = 1;
    



    // Constructors
    //////////////////////////////////

    // External signature methods
    //////////////////////////////////


    /** Show the sub-class hierarchy encoded by the given model */
    public HashMap showHierarchy( PrintStream out, OntModel m ) {		//Filter ,Boolean accept(Object O) 接不接受對象 看是否匿名。匿名的對象給過濾掉了。

        // create an iterator over the root classes that are not anonymous class expressions
        Iterator i = m.listHierarchyRootClasses()
                      .filterDrop( new Filter() {
                                    public boolean accept( Object o ) {
                                        return ((Resource) o).isAnon();
                                    }} );
      
        while (i.hasNext()) {
            showClass( out, (OntClass) i.next(), new ArrayList(), 0 );
           
        }
     
        return weight;
    }

    public HashMap  getBrotherCount()
    {
    	return brotherNode;
    }
    
    public HashMap getsonCount()
    {
    	return sonNode;
    }
    
    public HashMap getlevelCount()
    {
    	return weight;
    }

    //////////////////////////////////

    /** Present a class, then recurse down to the sub-classes.
     *  Use occurs check to prevent getting stuck in a loop
     */
    protected void showClass( PrintStream out, OntClass cls, List occurs, int depth ) {
    	
       
         int m_SonCount = 0;
        
        renderClassDescription( out, cls, depth );
        out.println();

        // recurse to the next level down
        if (cls.canAs( OntClass.class )  &&  !occurs.contains( cls )) {
        	
             int m_brotherCount = 0;
            for (Iterator i = cls.listSubClasses( true );  i.hasNext(); ) {
            	
                OntClass sub = (OntClass) i.next();
               //權(quán)重計算模塊-》根據(jù)圖的結(jié)構(gòu)計算。
         //基本原理:
               //1父節(jié)點擁有子節(jié)點數(shù)越多, 則子節(jié)點與父節(jié)點的關(guān)系越弱
               //2兄弟節(jié)點越多,與父節(jié)點關(guān)系越弱
               //3子節(jié)點越少,那么該節(jié)點的作用就越大。
               
               //1.一種方法根據(jù)深度計算某個參數(shù)的權(quán)重
                float  asa = (float)((float)(1) / (depth + 1)) ;
              
               //2.方法2:公式不同。
                // float asa = (float)((exp(0.6* depth) - exp((-0.6)*depth))/ (exp(0.6* depth) + exp((-0.6)*depth)))
                // 注意節(jié)點 跟節(jié)點的距離計算不同,有的計算 兩個節(jié)點在樹中的距離。
                //定義3(連接路徑).根據(jù)Vc∈C,H(c,Root)以及 關(guān)系的無環(huán)性,Cl和C2在本體0中的連接路徑有且只
                //有一條,記做path(cl,c2),而CI到msa(cI,C2)的父子鏈與C2到msa(cl,c2)的父子鏈的并集即為這樣的連接路徑,定義
                //如下:path(cI,C2)=pcc(cl,msa(cl,C2))~pcc(c2,msa(cI,C2)
                
                
                weight.put(cls.getLocalName(),Float.toString(asa));
               
                
                
                
                
                // we push this expression on the occurs list before we recurse
                occurs.add( cls );
                showClass( out, sub, occurs, depth + 1 );
                occurs.remove( cls );
                
                m_brotherCount ++ ;                             
                
            }
            sonNode.put(cls.getLocalName(),  Float.toString(m_brotherCount) );
            for (Iterator i = cls.listSubClasses( true );  i.hasNext(); ) {
                       OntClass sub = (OntClass) i.next();
            
              brotherNode.put(sub.getLocalName(),  Float.toString(m_brotherCount));
                               
                      // we push this expression on the occurs list before we recurse
                 
            }
            
            
            
      
            
            
            
        }
    }


    /**
     * <p>Render a description of the given class to the given output stream.</p>
     * @param out A print stream to write to
     * @param c The class to render
     */
    public void renderClassDescription( PrintStream out, OntClass c, int depth ) {
        indent( out, depth );

        if (c.isRestriction()) {
            renderRestriction( out, (Restriction) c.as( Restriction.class ) );
        }
        else {
            if (!c.isAnon()) {
             //   out.print( "Class " );
             //   renderURI( out, c.getModel(), c.getURI() );
             //   out.print( ' ' );
            }
            else {
                renderAnonymous( out, c, "class" );
            }
        }
    }

    /**
     * <p>Handle the case of rendering a restriction.</p>
     * @param out The print stream to write to
     * @param r The restriction to render
     */
    protected void renderRestriction( PrintStream out, Restriction r ) {
        if (!r.isAnon()) {
            out.print( "Restriction " );
            renderURI( out, r.getModel(), r.getURI() );
        }
        else {
            renderAnonymous( out, r, "restriction" );
        }

        out.print( " on property " );
        renderURI( out, r.getModel(), r.getOnProperty().getURI() );
    }

    /** Render a URI */
    protected void renderURI( PrintStream out, PrefixMapping prefixes, String uri ) {
        out.print( prefixes.shortForm( uri ) );
    }

    /** Render an anonymous class or restriction */
    protected void renderAnonymous( PrintStream out, Resource anon, String name ) {
        String anonID = (String) m_anonIDs.get( anon.getId() );
        if (anonID == null) {
            anonID = "a-" + m_anonCount++;
            m_anonIDs.put( anon.getId(), anonID );
        }

        out.print( "Anonymous ");
        out.print( name );
        out.print( " with ID " );
        out.print( anonID );
    }

    /** Generate the indentation */
    protected void indent( PrintStream out, int depth ) {
        for (int i = 0;  i < depth; i++) {
            out.print( "  " );
        }
    }


    //==============================================================================
    // Inner class definitions
    //==============================================================================

}


/*
    (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人一区二区| 国产黑丝在线一区二区三区| 国产乱码一区二区三区| 欧美写真视频网站| 国产三级一区二区三区| 午夜精品一区二区三区电影天堂| 国产成都精品91一区二区三| 欧美日韩一区二区三区免费看| 国产亚洲短视频| 六月丁香婷婷久久| 欧美丝袜丝nylons| 国产精品剧情在线亚洲| 极品少妇一区二区三区精品视频| 欧美日韩一二区| 中文字幕中文字幕一区| 国产高清在线观看免费不卡| 日韩欧美成人激情| 美女爽到高潮91| 欧美精品在欧美一区二区少妇| 亚洲精选视频在线| 91亚洲大成网污www| 国产女同性恋一区二区| 韩国成人精品a∨在线观看| 91精品国产乱码| 亚洲动漫第一页| 色噜噜狠狠一区二区三区果冻| 亚洲欧美怡红院| 99久久综合精品| 国产精品免费久久久久| 粉嫩久久99精品久久久久久夜| 26uuu成人网一区二区三区| 久久国产剧场电影| 精品国产免费人成电影在线观看四季| 日韩高清一区在线| 在线播放91灌醉迷j高跟美女| 亚洲高清视频中文字幕| 欧美午夜片在线观看| 婷婷成人激情在线网| 欧美日本乱大交xxxxx| 日韩精品免费专区| 欧美大片顶级少妇| 久久99九九99精品| 国产视频一区二区在线| 成人精品免费网站| 一区二区三区免费观看| 在线观看亚洲一区| 日韩精品国产欧美| 久久久一区二区| 99久久久久久| 洋洋成人永久网站入口| 3d动漫精品啪啪一区二区竹菊| 蜜臀av一区二区| 国产欧美日本一区二区三区| 91在线免费视频观看| 亚洲成在人线在线播放| 日韩欧美一级二级| 不卡一区在线观看| 日产精品久久久久久久性色| 久久亚洲精品小早川怜子| 成人av影视在线观看| 亚洲精品欧美专区| 欧美一级片在线| 成人app在线观看| 亚洲国产aⅴ成人精品无吗| 欧美精品一区二区三区高清aⅴ| 成人国产精品免费网站| 亚洲成人免费在线观看| 久久伊99综合婷婷久久伊| 91在线精品一区二区三区| 日韩va亚洲va欧美va久久| 国产嫩草影院久久久久| 日本久久一区二区| 国产麻豆视频精品| 天天色图综合网| 国产精品欧美极品| 欧美一区二区三区日韩视频| 国产a视频精品免费观看| 亚洲成人在线免费| 日韩美女视频19| 欧美精品一区视频| 欧美人体做爰大胆视频| 岛国av在线一区| 蜜桃一区二区三区在线| 亚洲激情在线播放| 日本一区二区三区国色天香| 欧美老女人第四色| 色婷婷综合久久久中文字幕| 国产盗摄一区二区| 青青草视频一区| 一区二区在线观看免费| 中文字幕不卡一区| 久久综合久久综合亚洲| 欧美久久久一区| 欧美性大战xxxxx久久久| 91色乱码一区二区三区| 成人免费观看av| 国产成人综合亚洲91猫咪| 另类综合日韩欧美亚洲| 日本不卡视频在线观看| 亚洲一级在线观看| 尤物在线观看一区| 国产精品毛片大码女人| 国产日韩精品一区二区三区在线| 日韩亚洲欧美一区| 日韩一区二区在线观看| 精品视频一区 二区 三区| av午夜精品一区二区三区| 成人毛片视频在线观看| 成人爽a毛片一区二区免费| 韩国视频一区二区| 九一九一国产精品| 裸体一区二区三区| 久99久精品视频免费观看| 九九**精品视频免费播放| 麻豆精品在线看| 精品在线视频一区| 久久福利资源站| 激情五月激情综合网| 国产伦精品一区二区三区免费| 激情文学综合插| 国产福利精品导航| 成人免费毛片a| 99re这里只有精品首页| 99re6这里只有精品视频在线观看| 99re成人在线| 欧美日韩在线直播| 日韩欧美一级在线播放| 久久精品人人爽人人爽| 国产精品亲子乱子伦xxxx裸| 最好看的中文字幕久久| 亚洲黄色性网站| 秋霞影院一区二区| 国产精品自拍一区| 91色porny在线视频| 欧美三级中文字| 欧美成人video| 国产精品视频免费| 亚洲综合色婷婷| 精品一区二区成人精品| 成人av网站在线观看| 欧美性高清videossexo| 日韩一区二区电影在线| 亚洲国产高清在线观看视频| 一卡二卡三卡日韩欧美| 全国精品久久少妇| 97久久精品人人做人人爽50路| 色悠久久久久综合欧美99| 欧美一级日韩一级| 日韩一区中文字幕| 琪琪一区二区三区| av亚洲精华国产精华精| 欧美男男青年gay1069videost | 美女精品自拍一二三四| 久久99精品国产麻豆婷婷| voyeur盗摄精品| 欧美视频中文一区二区三区在线观看| 欧美成人高清电影在线| 亚洲免费三区一区二区| 免费成人在线观看| 91年精品国产| 久久夜色精品国产噜噜av| 亚洲美女屁股眼交| 国产高清无密码一区二区三区| 欧美三级一区二区| 欧美国产激情二区三区| 蜜臀久久久久久久| 在线视频一区二区三| 久久午夜国产精品| 日韩有码一区二区三区| 色成年激情久久综合| 久久久精品人体av艺术| 日韩经典中文字幕一区| 91色婷婷久久久久合中文| 久久久久久亚洲综合影院红桃| 亚洲成人久久影院| 日本福利一区二区| 国产免费观看久久| 国产毛片一区二区| 在线成人免费视频| 夜夜嗨av一区二区三区中文字幕 | 亚洲理论在线观看| av资源站一区| 亚洲国产成人私人影院tom| 六月婷婷色综合| 日韩一级二级三级精品视频| 一卡二卡三卡日韩欧美| 色综合亚洲欧洲| 亚洲欧洲一区二区在线播放| 国产精品91一区二区| 久久亚洲精精品中文字幕早川悠里 | 欧美精品 国产精品| 亚洲精品国产无套在线观| 成人激情小说乱人伦| 国产色爱av资源综合区| 国产精品一区二区免费不卡 | 国产成人精品一区二区三区四区 | 欧美中文字幕一区二区三区亚洲| 国产精品久久久久9999吃药| 成人免费看片app下载| 中文字幕在线一区二区三区|