-------------------------------------------------------
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="http://www.w3.org/2002/07/owl#Thing" />
<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是不相交的