隨筆-204  評論-149  文章-0  trackbacks-0

          http://www.transwiki.org/wiki/index.php/OWL%E6%8C%87%E5%8D%97_%E6%8E%A8%E8%8D%90%E6%A0%87%E5%87%86-4#equivalentClass.2C_equivalentProperty (本體介紹)

          http://imarine.blog.163.com/blog/static/5138018320071119110889/(本體查詢)

          http://bbs.w3china.org/dispbbs.asp?boardID=2&ID=74918/ (本體查詢)


          -------------------------------------------------------
          rdfs:subClassOf 描述

           <owl:Class rdf:ID="Wine">
             <rdfs:subClassOf rdf:resource="&food;PotableLiquid"/>
             <rdfs:label xml:lang="en">wine</rdfs:label>
             <rdfs:label xml:lang="fr">vin</rdfs:label>
           </owl:Class>

          Wine PotableLiquid
          --------------------------------------------------------
          ObjectProperty   描述 wine hasWinDescriptor WineDescriptor

           <owl:ObjectProperty rdf:ID="hasWineDescriptor">
             <rdfs:domain rdf:resource="#Wine" />
             <rdfs:range  rdf:resource="#WineDescriptor" />
           </owl:ObjectProperty>


          -------------------------------------------------------
          DatatypeProperty 描述 VintageYear is 1998

            <owl:DatatypeProperty rdf:ID="yearValue">
              <rdfs:domain rdf:resource="#VintageYear" />   
              <rdfs:range  rdf:resource="&xsd;positiveInteger" />
            </owl:DatatypeProperty>
           
            <VintageYear rdf:ID="Year1998">
              <yearValue rdf:datatype="&xsd;positiveInteger">1998</yearValue>
            </VintageYear>

            <owl:ObjectProperty rdf:ID="hasVintageYear">
              <rdf:type rdf:resource="&owl;FunctionalProperty" />
              <rdfs:domain rdf:resource="#Vintage" />
              <rdfs:range  rdf:resource="#VintageYear" />
            </owl:ObjectProperty>

          Vintage has VintageYear that is 1998 ------ 葡萄酒的年份是1998 或 1998的葡萄酒

          --------------------------------------------------------
          個體(individual) 描述

           <owl:Class rdf:ID="WineGrape">
             <rdfs:subClassOf rdf:resource="&food;Grape" />
           </owl:Class>
           <WineGrape rdf:ID="CabernetSauvignonGrape" />

          CabernetSauvignonGrape is WineGrape ---- 赤霞珠葡萄樹

          ----------------------屬性特性------------------------
          TransitiveProperty 描述
          SymmetricProperty  描述

          <owl:Class rdf:ID="Region" />

          <owl:ObjectProperty rdf:ID="locatedIn">
             <rdf:type rdf:resource="&owl;TransitiveProperty" />
             <rdfs:domain rdf:resource="    <rdfs:range rdf:resource="#Region" />
          </owl:ObjectProperty>

          <owl:ObjectProperty rdf:ID="adjacentRegion">
            <rdf:type rdf:resource="&owl;SymmetricProperty" />
            <rdfs:domain rdf:resource="#Region" />
            <rdfs:range rdf:resource="#Region" />
          </owl:ObjectProperty>

          --------------------------------------------
          FunctionalProperty   描述 一個給定的 Vintage個體只能使用hasVintageYear屬性與單獨一個年份相關聯

           <owl:Class rdf:ID="VintageYear" />
           <owl:ObjectProperty rdf:ID="hasVintageYear">
             <rdf:type rdf:resource="&owl;FunctionalProperty" />
             <rdfs:domain rdf:resource="#Vintage" />
             <rdfs:range  rdf:resource="#VintageYear" />
           </owl:ObjectProperty>
          ---------------------------------------------
           inverseOf  描述 各種葡萄酒都有制造商

           <owl:ObjectProperty rdf:ID="hasMaker">
             <rdf:type rdf:resource="&owl;FunctionalProperty" />
           </owl:ObjectProperty>  
           <owl:ObjectProperty rdf:ID="producesWine">
             <owl:inverseOf rdf:resource="#hasMaker" />
           </owl:ObjectProperty>

          ---------------------------------------------
           InverseFunctionalProperty 

           <owl:ObjectProperty rdf:ID="hasMaker" />
           <owl:ObjectProperty rdf:ID="producesWine">
             <rdf:type rdf:resource="&owl;InverseFunctionalProperty" />
             <owl:inverseOf rdf:resource="#hasMaker" />
           </owl:ObjectProperty>

           owl:InverseFunctional意味著屬性的值域中的元素為定義域中的每個元素提供了一個唯一的標識


           ---屬性限制------
           -------------------------
           allValuesFrom   描述 Wine的制造商必須是Winery。
           owl:someValuesFrom替換owl:allValuesFrom,那就意味著至少有一個Wine類實例的hasMaker屬性是指向一個Winery類的個體的。

           <owl:Class rdf:ID="Wine">
             <rdfs:subClassOf rdf:resource="&food;PotableLiquid" />
             ...
             <rdfs:subClassOf>
               <owl:Restriction>
                 <owl:onProperty rdf:resource="#hasMaker" />
                 <owl:allValuesFrom rdf:resource="#Winery" />
               </owl:Restriction>
             </rdfs:subClassOf>
            
             ...
           </owl:Class>

           -------------------------------------------------------
           owl:cardinality  描述  允許對一個關系中的元素數目作出精確的限制

            <owl:Class rdf:ID="Vintage">
             <rdfs:subClassOf>
               <owl:Restriction>
                 <owl:onProperty rdf:resource="#hasVintageYear"/>
                 <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
               </owl:Restriction>
             </rdfs:subClassOf>
           </owl:Class>

           每瓶葡萄酒只有一個年度

           -------------------------------------------------------
           hasValue  描述 一個個體只要至少有“一個”屬性值等于hasValue的資源,這一個體就是該類的成員。

            <owl:Class rdf:ID="Burgundy">
             ...
             <rdfs:subClassOf>
               <owl:Restriction>
                 <owl:onProperty rdf:resource="#hasSugar" />
                 <owl:hasValue rdf:resource="#Dry" />
               </owl:Restriction>
             </rdfs:subClassOf>
           </owl:Class>

           所有的Burgundy酒都是干(dry)的酒。也即,它們的hasSugar屬性必須至少有一個是值等于Dry(干的)

          ------------------------------------------------------
           本體映射
           類和屬性之間的等價關系--equivalentClass, equivalentProperty

           <owl:Class rdf:ID="TexasThings">
             <owl:equivalentClass>
               <owl:Restriction>
                 <owl:onProperty rdf:resource="#locatedIn" />
                 <owl:someValuesFrom rdf:resource="#TexasRegion" />
               </owl:Restriction>
             </owl:equivalentClass>
           </owl:Class>

           TexasThings指的是那些恰好位于TexasRegion的事物。使用owl:equivalentClass 和使用rdfs:subClassOf 的不同就像必要條件和充要條件的不同一樣。如果是使用subClassOf的話,位于TexasRegion的事物不一定是TexasThings。但是,如果使用owl:equivalentClass,位于TexasRegion的事物一定屬于TexasThings類。

          ------------------------------------------------------
          個體間的同一性 -sameAs

           <Wine rdf:ID="MikesFavoriteWine>
               <owl:sameAs rdf:resource="#StGenevieveTexasWhite" />
           </Wine>

           修飾(或引用)兩個類用sameAs還是用equivalentClass效果是不同的。用sameAs的時候,把一個類解釋為一個個體,就像在OWL Full中一樣,這有利于對本體進行分類。

          -----------------------------------------------------
           不同的個體
          ------------------------------------------------------
          differentFrom

           <WineSugar rdf:ID="Dry" />
           
           <WineSugar rdf:ID="Sweet">
             <owl:differentFrom rdf:resource="#Dry"/> 
           </WineSugar>
           
           <WineSugar rdf:ID="OffDry">
             <owl:differentFrom rdf:resource="#Dry"/>
             <owl:differentFrom rdf:resource="#Sweet"/>
           </WineSugar>

           ---------------------------------------------------
          AllDifferent

           <owl:AllDifferent>
             <owl:distinctMembers rdf:parseType="Collection">
               <vin:WineColor rdf:about="#Red" />
               <vin:WineColor rdf:about="#White" />
               <vin:WineColor rdf:about="#Rose" />
             </owl:distinctMembers>
           </owl:AllDifferent>

           owl:distinctMembers屬性聲明只能和owl:AllDifferent屬性聲明一起結合使用。

           -----------------------------------------------------
           intersectionOf

           <owl:Class rdf:ID="WhiteWine">
             <owl:intersectionOf rdf:parseType="Collection">
               <owl:Class rdf:about="#Wine" />
               <owl:Restriction>
                 <owl:onProperty rdf:resource="#hasColor" />
                 <owl:hasValue rdf:resource="#White" />
               </owl:Restriction>
             </owl:intersectionOf>
           </owl:Class>

           WhiteWine恰好是類Wine與所有顏色是白色的事物的集合的交集

           -----------------------------------------------------
           unionOf

           <owl:Class rdf:ID="Fruit">
             <owl:unionOf rdf:parseType="Collection">
               <owl:Class rdf:about="#SweetFruit" />
               <owl:Class rdf:about="#NonSweetFruit" />
             </owl:unionOf>
           </owl:Class>

           ------------------------------------------------------
           complementOf 從某個論域(domain of discourse)選出不屬于某個類的所有個體

           <owl:Class rdf:ID="NonFrenchWine">
             <owl:intersectionOf rdf:parseType="Collection">
               <owl:Class rdf:about="#Wine"/>
              
               <owl:Class>
                 <owl:complementOf>
                   <owl:Restriction>
                     <owl:onProperty rdf:resource="#locatedIn" />
                     <owl:hasValue rdf:resource="#FrenchRegion" />
                   </owl:Restriction>
                 </owl:complementOf>
               </owl:Class>
             </owl:intersectionOf>
           </owl:Class>

           -----------------------------------------------------------
           oneOf  枚舉

           <owl:Class rdf:ID="WineColor">
             <rdfs:subClassOf rdf:resource="#WineDescriptor"/>
             <owl:oneOf rdf:parseType="Collection">
               <owl:Thing rdf:about="#White"/>
               <owl:Thing rdf:about="#Rose"/>
               <owl:Thing rdf:about="#Red"/>
             </owl:oneOf>
           </owl:Class>

           有效的個體聲明

           -----------------------------------------------------------
           disjointWith  不相交類  保證了屬于某一個類的個體不能同時又是另一個指定類的實例

           <owl:Class rdf:ID="Pasta">
             <rdfs:subClassOf rdf:resource="#EdibleThing"/>
             <owl:disjointWith rdf:resource="#Meat"/>
             <owl:disjointWith rdf:resource="#Fowl"/>
             <owl:disjointWith rdf:resource="#Seafood"/>
             <owl:disjointWith rdf:resource="#Dessert"/>
             <owl:disjointWith rdf:resource="#Fruit"/>
           </owl:Class>

          Pasta與其它所有類是不相交的。例如,它并沒有保證Meat和Fruit是不相交的

          主站蜘蛛池模板: 虞城县| 正蓝旗| 绍兴县| 灌南县| 襄汾县| 通城县| 五华县| 永平县| 花莲市| 银川市| 营山县| 永春县| 涿鹿县| 三穗县| 江西省| 南投市| 台山市| 大城县| 凤山县| 当涂县| 克拉玛依市| 通榆县| 高州市| 布尔津县| 抚顺县| 大埔县| 蓝田县| 鄂尔多斯市| 沂水县| 宁南县| 丽江市| 崇信县| 竹北市| 曲周县| 迁安市| 阿图什市| 施秉县| 大埔县| 福建省| 黄石市| 肇州县|