OWL指南 推荐标准-3
TransWiki - W3CHINA.ORG开放翻译计划(OTP)
摘要_文档状态_目录 第1节 第2节 第3节 第4节 第5节 第6节 第7节 鸣谢_词汇表_术语索引_参考文献 附录
3. Basic Elements
3. 基本元素(Basic Elements)
Most of the elements of an OWL ontology concern classes, properties, instances of classes, and relationships between these instances. This section presents the language components essential to introducing these elements.
一个OWL本体中的大部分元素是与类(class)、属性(property)、类的实例(instance)以及这些实例间的关系有关的。本节给出应用这些元素所必需的语言成分。
3.1. Simple Classes and Individuals
3.1. 简单的类和个体
Many uses of an ontology will depend on the ability to reason about individuals. In order to do this in a useful fashion we need to have a mechanism to describe the classes that individuals belong to and the properties that they inherit by virtue of class membership. We can always assert specific properties about individuals, but much of the power of ontologies comes from class-based reasoning.
许多情况下,使用本体是为了用它进行关于个体的推理。为了在一种有效的方式下做到这一点,我们需要一种机制来描述个体所属的类以及这些个体通过类成员关系而继承得到的属性。尽管我们总能为个体声明特定的属性,但是本体的大部分能力在于基于类的推理。
Sometimes we want to emphasize the distinction between a class as an object and a class as a set containing elements. We call the set of individuals that are members of a class the extension of the class.
有时,我们希望强调区分一个类是作为对象还是作为包含元素的集合。我们称由属于某个类的个体所构成的集合为该类的外延(extension)。
=3.1.1. Simple Named Classes
3.1.1. 简单的具名类
Class, rdfs:subClassOf
The most basic concepts in a domain should correspond to classes that are the roots of various taxonomic trees. Every individual in the OWL world is a member of the class owl:Thing. Thus each user-defined class is implicitly a subclass of owl:Thing. Domain specific root classes are defined by simply declaring a named class. OWL also defines the empty class, owl:Nothing.
一个领域中的最基本概念应分别对应于各个分类层次树的根。OWL中的所有个体都是类owl:Thing的成员。因此,各个用户自定义的类都隐含地是owl:Thing的一个子类。要定义特定领域的根类,只需将它们声明为一个具名类(named class)即可。OWL也可以定义空类,owl:Nothing。
For our sample wines domain, we create three root classes: Winery, Region, and ConsumableThing.
在我们所举的葡萄酒领域的例子中,我们创建三个根类:Winery,Region和ConsumableThing。
<owl:Class rdf:ID="Winery"/>
<owl:Class rdf:ID="Region"/>
<owl:Class rdf:ID="ConsumableThing"/>
Note that we have only said that there exist classes that have been given these names, indicated by the 'rdf:ID=' syntax. Formally, we know almost nothing about these classes other than their existence, despite the use of familiar English terms as labels. And while the classes exist, they may have no members. For all we know at the moment, these classes might as well have been called Thing1, Thing2, and Thing3.
注意:我们只是说这里有三个具有指定名称(通过语法“rdf:ID=”)的类。形式上,即使我们使用了熟悉的英语单词作为标签,但我们除了知道这些类的存在以外,仍不了解任何其他关于它们的信息。而这些类尽管存在,但它们可能没有成员。就所有目前我们所知道的信息而言,将这些类分别命名为Thing1、Thing2和Thing3与命名为上述名称没有什么区别。
It is important to remember that definitions may be incremental and distributed. In particular, we will have more to say about Winery later.
记住这一点很重要,即定义可以是增量的和分布式的。特别地,我们将在后面对Winery作更多的讨论。
The syntax rdf:ID="Region" is used to introduce a name, as part of its definition. This is the rdf:ID attribute (http://www.w3.org/TR/rdf-syntax-grammar/#idAttr) ([RDF (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#RDF1)], 7.2.22) that is like the familiar ID attribute defined by XML. Within this document, the Region class can now be referred to using #Region, e.g. rdf:resource="#Region". Other ontologies may reference this name using its complete form, "http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Region".
语法 rdf:ID="Region" 被用于引入一个名称(作为定义的一部分)。该rdf:ID属性(attribute) (http://www.w3.org/TR/rdf-syntax-grammar/#idAttr) ([RDF (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#RDF1)],7.2.22)类似于XML中的ID属性(attribute)。在这一文档中,我们现在可以用#Region来引用Region类,例如 rdf:resource="#Region"。而其他的本体可以通过"http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Region"这一完整形式来引用该名称。
Another form of reference uses the syntax rdf:about="#Region" to extend the definition of a resource. This use of the rdf:about="&ont;#x" syntax is a critical element in the creation of a distributed ontology. It permits the extension of the imported definition of x without modifying the original document and supports the incremental construction of a larger ontology.
另一种引用类的形式是用语法 rdf:about="#Region" 来扩展 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#DefiningIndividuals)对一个资源的定义。语法 rdf:about="&ont;#x" 的使用在分布式本体的创建中是一个关键要素。它允许导入x类的定义并对它进行扩展,而不需修改源定义文档,从而支持增量构建更大的本体。
It is now possible to refer to the classes we defined in other OWL constructs using their given identifier. For the first class, within this document, we can use the relative identifier, #Winery. Other documents may need to reference this class as well. The most reasonable way to do so is to provide namespace and entity definitions that include the defining document as a source:
现在,我们可以在其他OWL的构建中通过这些类的标识符来引用这些类。比如对于第一个类,同样也在该文档内的话,我们就可以使用相对标识符#Winery。由于其他文档可能也需要引用这个类,因此最合理的方式是提供命名空间和实体定义,在其中包含着这个类的定义文档作为定义源:
...
<!ENTITY vin "http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#" >
<!ENTITY food "http://www.w3.org/TR/2004/REC-owl-guide-20040210/food#" >
...
<rdf:RDF xmlns:vin ="http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#"
xmlns:food="http://www.w3.org/TR/2004/REC-owl-guide-20040210/food#" ... >
...
Given these definitions we can refer to the winery class either using the XML tag vin:Winery or the attribute value &vin;Winery. More literally, it is always possible to reference a resource using its full URI, here http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Winery.
给定上述定义后,我们便可以通过XML标签vin:Winery或属性(attribute)值&vin;Winery来引用winery类。更确切地说,我们总可以使用资源的完整URL来引用它们,比如这里我们可以用http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Winery 来引用Winery类。
The fundamental taxonomic constructor for classes is rdfs:subClassOf. It relates a more specific class to a more general class. If X is a subclass of Y, then every instance of X is also an instance of Y. The rdfs:subClassOf relation is transitive. If X is a subclass of Y and Y a subclass of Z then X is a subclass of Z.
rdfs:subClassOf是用于类的基本分类构造符。它将一个较具体的类与一个较一般的类关联。如果X是Y的一个子类(subclass),那么X的每个实例同时也都是Y的实例。rdfs:subClassOf关系是可传递的,即如果X是Y的一个子类,而Y又是Z的一个子类,那么X就是Z的一个子类。
<owl:Class rdf:ID="PotableLiquid">
<rdfs:subClassOf rdf:resource="#ConsumableThing" />
...
</owl:Class>
We define PotableLiquid (liquids suitable for drinking) to be a subclass of ConsumableThing.
上面,我们把PotableLiquid(可饮用的液体)定义为ConsumableThing的子类。
In the world of Web-based ontologies, both of these classes can be defined in a separate ontology that would provide the basic building blocks for a wide variety of food and drink ontologies, which is what we have done - they are defined in the food (http://www.w3.org/TR/2004/REC-owl-guide-20040210/food.rdf) ontology, which is imported (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#import) into the wine ontology. The food ontology includes a number of classes, for example Food, EdibleThing, MealCourse, and Shellfish, that do not belong in a collection of wine facts, but must be connected to the wine vocabulary if we are going to perform useful reasoning. Food and wine are mutually dependent, in order to satisfy our need to identify wine/food matches.
在基于Web的本体世界中,这两个类可定义在一个分散的本体中,而这个本体又可以作为各种不同的食物和饮料本体的基础。我们已在食物(food) (http://www.w3.org/TR/2004/REC-owl-guide-20040210/food.rdf)本体中定义了各种不同的食物和饮料本体,并将该食物本体导入 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#import)葡萄酒(wine)本体中。食物本体中包含了许多类,如Food、EdibleThing、MealCourse和Shellfish等不属于葡萄酒的事物,但是如果要做有用的推理,则必须将它们与葡萄酒本体中的词汇相关联。为了满足我们识别葡萄酒/食物对的需求,食物和葡萄酒本体是彼此独立的。
A class definition has two parts: a name introduction or reference and a list of restrictions. Each of the immediate contained expressions in the class definition further restricts the instances of the defined class. Instances of the class belong to the intersection of the restrictions. (Though see the details of owl:equivalentClass.) So far we have only seen examples that include a single restriction, forcing the new class to be a subclass of some other named class.
一个类的定义由两部分组成:引入或引用一个名称,以及一个限制列表。被直接包含在类定义中的各个表达式进一步限制了该类的实例,该类的实例属于所有这些限制的交集。(这里描述的是成为某个类的必要条件,关于描述成为某个类的充分必要条件,请参见owl:equivalentClass部分。)到目前为止,我们所看到的例子均为只包含单个限制:强制被描述的新类为某个其它具名类(named class)的子类。
At this point it is possible to create a simple (and incomplete) definition for the class Wine. Wine is a PotableLiquid. We also define Pasta as an EdibleThing.
至此,我们可以为Wine类创建一个简单的(和不完整的)定义。Wine是一个PortableLiquid。同时,我们将Pasta定义为一个EdibleThing。
<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>
<owl:Class rdf:ID="Pasta">
<rdfs:subClassOf rdf:resource="#EdibleThing" />
...
</owl:Class>
The rdfs:label entry provides an optional human readable name for this class. Presentation tools can make use of it. The "lang" attribute provides support for multiple languages. A label is like a comment and contributes nothing to the logical interpretation of an ontology.
rdfs:label是可选的,它为该类提供一个人类可读的名称。负责呈现的工具可以利用这个元素。“lang”属性为多语言提供了支持。一个label(标号)就像一个注释,不向本体的逻辑解释添加任何内容。
Our wine definition is still very incomplete. We know nothing about wines except that they are things and potable liquids, but we have sufficient information to create and reason about individuals.
葡萄酒的定义仍然是不完整的。我们除了知道葡萄酒是一种事物并且适于饮用以外,对它别无所知。但我们有足够的信息来创建个体和对个体进行推理。
3.1.2. Individuals
3.1.2. 个体
In addition to classes, we want to be able to describe their members. We normally think of these as individuals in our universe of things. An individual is minimally introduced by declaring it to be a member of a class.
除了描述类,我们还希望能够描述类的成员。我们通常认为类的成员是我们所关心的范畴中的一个个体(而不是另一个类或属性)。要引入一个个体(individual),只需将它们声明为某个类的成员。
<Region rdf:ID="CentralCoastRegion" />
Note that the following is identical in meaning to the example above.
注意:下面代码的含义与上面的例子相同。
<owl:Thing rdf:ID="CentralCoastRegion" />
<owl:Thing rdf:about="#CentralCoastRegion">
<rdf:type rdf:resource="#Region"/>
</owl:Thing>
rdf:type is an RDF property that ties an individual to a class of which it is a member.
rdf:type是一个RDF属性(RDF property),用于关联一个个体和它所属的类。
There are a couple of points to be made here. First, we have decided that CentralCoastRegion (a specific area) is member of Region, the class containing all geographical regions. Second, there is no requirement in the two-part example that the two elements need to be adjacent to one another, or even in the same file (though the names would need to be extended with a URI in such a case). We design Web ontologies to be distributed. They can be imported and augmented, creating derived ontologies.
这里有一些注意点。首先,我们已经决定CentralCoastRegion(一个特定的区域)是Region的成员。这里的Region类包含所有地理上的区域。其次,对于上述这一由两个元素构成的示例,并没有要求这两个陈述必须是相邻的、或必须位于同一文件中(尽管这些名字在这种情况下需要扩充一个URI)。Web本体被设计成为分布式的,我们可以通过导入和补充已有的本体来创建衍生的本体。
In order to have available a few more classes for the properties introduced in the next sections, we define a branch of the Grape taxonomy, with an individual denoting the Cabernet Sauvignon grape varietal. Grapes are defined in the food ontology:
为了得到更多的类用于将在下一节引入的属性,我们定义了一个Grape(葡萄)的层次分类以及一个代表Cabernet Sauvignon品种的葡萄的个体。Grapes在食物本体中是这样定义的:
<owl:Class rdf:ID="Grape">
...
</owl:Class>
And then in the wine ontology we have:
接着,我们在葡萄酒本体中有:
<owl:Class rdf:ID="WineGrape">
<rdfs:subClassOf rdf:resource="&food;Grape" />
</owl:Class>
<WineGrape rdf:ID="CabernetSauvignonGrape" />
As discussed in the next section, CabernetSauvignonGrape is an individual because it denotes a single grape varietal.
正如下一节将要讨论的,CabernetSauvignonGrape是一个个体,因为它代表的是某个单个葡萄品种。
3.1.3. Design for Use
3.1.3. 关于使用的设计
There are important issues regarding the distinction between a class and an individual in OWL. A class is simply a name and collection of properties that describe a set of individuals. Individuals are the members of those sets. Thus classes should correspond to naturally occurring sets of things in a domain of discourse, and individuals should correspond to actual entities that can be grouped into these classes.
关于OWL中类与个体的区别,有一些重要的问题。一个类仅是一个名称和一些描述某集合内个体的属性;而个体是该集合的成员。因此,类应自然地对应于与某论域中的事物的出现集合,而个体应对应于可被归入这些类的实际的实体。
In building ontologies, this distinction is frequently blurred in two ways:
在构建本体时,这个区别常常变得模糊不清,主要有两种情况:
- Levels of representation: In certain contexts something that is obviously a class can itself be considered an instance of something else. For example, in the wine ontology we have the notion of a Grape, which is intended to denote the set of all grape varietals. CabernetSauvingonGrape is an example instance of this class, as it denotes the actual grape varietal called Cabernet Sauvignon. However, CabernetSauvignonGrape could itself be considered a class, the set of all actual Cabernet Sauvignon grapes.
- 表示的层次: 在某些上下文中,某些事物明显是一个类,但同时其本身又可被视为另一个事物的实例。例如:在葡萄酒本体中,我们有Grape的概念,它是代表所有葡萄品种的集合。CabernetSauvingonGrape是这个类中的一个实例,它代表Cabernet Sauvignon这一葡萄品种。但是,CabernetSauvignonGrape其自身也可被视为一个类,即代表所有实际的 Cabernet Sauvignon葡萄这一集合的类。
- Subclass vs. instance: It is very easy to confuse the instance-of relationship with the subclass relationship. For example, it may seem arbitrary to choose to make CabernetSauvignonGrape an individual that is an instance of Grape, as opposed to a subclass of Grape. This is not an arbitrary decision. The Grape class denotes the set of all grape varietals, and therefore any subclass of Grape should denote a subset of these varietals. Thus, CabernetSauvignonGrape should be considered an instance of Grape, and not a subclass. It does not describe a subset of Grape varietals, it is a grape varietal.
- 子类 vs. 实例: 实例(instance-of)关系和子类(subclass)关系很容易被混淆。例如,也许看上去可以随意地将CabernetSauvignonGrape作为Grape的一个实例,而不是作为Grape的一个子类,但实际上这个决定并不是随意的。Grape类代表的是所有葡萄品种的集合,因此任何Grape的子类应代表这些品种的一个子集。因而,CabernetSauvignonGrape应被认为是Grape的一个实例,而不是一个子类。因为CabernetSauvignonGrape是一个葡萄品种,而不是一个葡萄品种的子类。
Note that the same distinction arises with the treatment of the Wine class. The Wine class actually denotes the set of all varieties of wine, not the set of actual bottles that someone may purchase. In an alternate ontology, each instance of Wine in the current ontology could instead designate a class consisting of all the bottles of wine of that type. It is easy to imagine an information system, such as an inventory system for a wine merchant, that needs to consider individual bottles of wine. The wine ontology as it currently exists would require the ability to treat classes as instances in order to support such an interpretation. Note that OWL Full permits such expressivity, allowing us to treat an instance of a wine variety simultaneously as a class whose instances are bottles of wine.
注意:对于Wine类也同样有着上述问题。Wine类实际上代表的是所有葡萄酒种类的集合,而不是某人可以购买的瓶装葡萄酒的集合。设想在另一个本体中,各个Wine类的实例代表一个类,该类是某类葡萄酒的瓶装葡萄酒的集合。容易设想这样一个信息系统,例如一个葡萄酒商的库存系统,它需要处理各个瓶装葡萄酒。葡萄酒本体需要有把类作为实例处理的能力,以支持该解释。注意:OWL Full是允许这样表达的,这使得我们可以同时将一个葡萄酒品种的实例视为一个类,而该类的实例是瓶装葡萄酒。
In a similar vein, the wines produced by wineries in specific years are considered vintages. In order to represent the notion of a vintage, we must determine where it fits in the current ontology. An instance of the Wine class, as discussed above, represents a single variety of wine produced by a single winery, for example FormanChardonnay.
同样的,葡萄酒厂在特定年份所生产的葡萄酒将被视为佳酒。为了表达佳酒这一概念,我们必须考虑将它置于当前本体中的何处。如前所述,一个Wine类的实例代表的是某葡萄酒厂所生产的某个单个葡萄酒种类,比如FormanChardonnay。
Adding that the wine produced in the year 2000 is considered a vintage poses a challenge, because we don't have the ability to represent a subset of a given wine individual. This vintage is not a new variety of wine, it is a special subset of the wine - that produced in the year 2000. An option would be to use OWL Full and treat the wine instances as classes with subclasses (subsets) denoting vintages. Another option is to use a workaround and to consider Vintage as a separate class whose instances have a relationship to the Wine they are a vintage of. For example, FormanChardonnay2000 is an individual Vintage with a vintageOf property whose value is the Wine, FormanChardonnay. We define the Vintage class below.
要表达“2000年生产的葡萄酒被视为佳酒”是有点复杂的,因为我们没有表达某种给定葡萄酒的个体的子集的能力。佳酒并不是一个新的葡萄酒种类,而是一个特殊的葡萄酒子集,即那些产于2000年的葡萄酒。一个方案是使用OWL Full,将Wine类的实例视为类,而后者的子类(子集)代表瓶装葡萄酒。另一个方案是使用变通手法,即将Vintage视为一个单独的类,Vintage的实例与代表它所属种类的Wine类相关联。例如,FormanChardonnay2000是一个Vintage类的个体,它通过vintageOf属性与Wine类的个体FormanChardonnay相关联。我们将在后面看到Vintage类的定义。
The point of this discussion is to note that the development of an ontology should be firmly driven by the intended usage. These issues also underlie one major difference between OWL Full and OWL DL. OWL Full allows the use of classes as instances and OWL DL does not. The wine ontology is designed to work in OWL DL, and as a result individuals like FormanChardonnay are not simultaneously treated as classes.
这里需要注意的一点是,一个本体的开发应坚定地由它的预定用途所驱动。这些问题也存在于OWL Full和OWL DL之间的一个重要区别。OWL Full允许将类(class)用作实例(instance),而OWL DL不允许。由于葡萄酒本体被预定为使用OWL DL,因此不会将个体(例如FormanChardonnay等)同时作为类来看待。
3.2. Simple Properties
3.2. 简单属性
This world of classes and individuals would be pretty uninteresting if we could only define taxonomies. Properties let us assert general facts about the members of classes and specific facts about individuals.
如果仅允许定义层次分类,那么这个类和个体的世界也许会变得颇为无趣。属性(propertyies)使得我们可以断言关于类成员的一般事实以及关于个体的具体事实。
3.2.1. Defining Properties
3.2.1. 定义属性(Defining Properties)
ObjectProperty, DatatypeProperty, rdfs:subPropertyOf, rdfs:domain, rdfs:range
A property is a binary relation. Two types of properties are distinguished:
- datatype properties, relations between instances of classes and RDF literals and XML Schema datatypes
- object properties, relations between instances of two classes. Note that the name object property is not intended to reflect a connection with the RDF (http://www.w3.org/RDF/) term rdf:object (http://www.w3.org/TR/rdf-schema/#ch_object) ([RDF (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#RDF1)], 5.3.4).
一个属性是一个二元关系。有两种类型的属性:
- 数据类型属性(datatype properties),类实例与RDF文字或XML Schema数据类型间的关系。
- 对象属性(object properties),两个类的实例间的关系。注意:对象属性这个名称并不是要反映与RDF (http://www.w3.org/RDF/)术语rdf:object (http://www.w3.org/TR/rdf-schema/#ch_object)([RDF (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#RDF1)],5.3.4)的联系。
When we define a property there are a number of ways to restrict the relation. The domain and range can be specified. The property can be defined to be a specialization (subproperty) of an existing property. More elaborate restrictions are possible and are described later (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#PropertyCharacteristics).
在我们定义一个属性的时候,有一些对该二元关系施加限定的方法。我们可以指定定义域(domain)和值域(range)。可以将一个属性定义为某个已有属性的特殊化(子属性)。要进行更详细的限定也是可能的,我们将在后面 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#PropertyCharacteristics)对此作出介绍。
<owl:ObjectProperty rdf:ID="madeFromGrape">
<rdfs:domain rdf:resource="#Wine"/>
<rdfs:range rdf:resource="#WineGrape"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="course">
<rdfs:domain rdf:resource="#Meal" />
<rdfs:range rdf:resource="#MealCourse" />
</owl:ObjectProperty>
In OWL, a sequence of elements without an explicit operator represents an implicit conjunction. The property madeFromGrape has a domain of Wine and a range of WineGrape. That is, it relates instances of the class Wine to instances of the class WineGrape. Multiple domains mean that the domain of the property is the intersection of the identified classes (and similarly for range).
在OWL中,不含显式操作符的元素序列代表一个隐式的合取(conjunction)。属性madeFromGrape的定义域(domain)为Wine,且值域(range)为WineGrape。也就是说,它把Wine类的实例关联到WineGrape类的实例。为同一属性声明多个定义域表明该属性的定义域是所有这些类的交集(多个值域声明也类似这样)。
Similarly, the property course ties a Meal to a MealCourse.
同样地,属性course将一个Meal与MealCourse相关联。
Note that the use of range and domain information in OWL is different from type information in a programming language. Among other things, types are used to check consistency in a programming language. In OWL, a range may be used to infer a type. For example, given:
注意:OWL中值域和定义域信息的使用与程序设计语言中的类型信息有所不同。在程序设计中,类型被用来检查程序设计语言的一致性。而在OWL中,一个值域可被用来推断一个类型。比如,根据下面这段代码:
<owl:Thing rdf:ID="LindemansBin65Chardonnay">
<madeFromGrape rdf:resource="#ChardonnayGrape" />
</owl:Thing> ┐
we can infer that LindemansBin65Chardonnay is a wine because the domain of madeFromGrape is Wine.
我们可以推断出,LindemansBin65Chardonnay是一种葡萄酒,因为madeFromGrape的定义域为Wine。
Properties, like classes, can be arranged in a hierarchy.
属性也可以像类一样按照层次结构来组织。
<owl:Class rdf:ID="WineDescriptor" />
<owl:Class rdf:ID="WineColor">
<rdfs:subClassOf rdf:resource="#WineDescriptor" />
...
</owl:Class>
<owl:ObjectProperty rdf:ID="hasWineDescriptor">
<rdfs:domain rdf:resource="#Wine" />
<rdfs:range rdf:resource="#WineDescriptor" />
</owl:ObjectProperty>
<owl:ObjectProperty rdf:ID="hasColor">
<rdfs:subPropertyOf rdf:resource="#hasWineDescriptor" />
<rdfs:range rdf:resource="#WineColor" />
...
</owl:ObjectProperty>
WineDescriptor properties relate wines to their color and components of their taste, including sweetness, body, and flavor. hasColor is a subproperty of the hasWineDescriptor property, with its range further restricted to WineColor. The rdfs:subPropertyOf relation in this case means that anything with a hasColor property with value X also has a hasWineDescriptor property with value X.
WineDescriptor属性将葡萄酒(wine)与它们的颜色(color)和味觉成分(包括甜、浓、口味)相关联。hasColor是hasWineDescriptor的子属性,hasColor与hasWineDescriptor的不同在于它的值域被进一步限定为WineColor。rdfs:subPropertyOf关系表示:任何事物如果具有一个值为X的hasColor属性,那么它同时具有一个值为X的hasWineDescriptor属性。
Next we introduce the locatedIn property, which relates things to the regions they are located in.
下面,我们介绍locatedIn属性,它将事物和事物所在的地区相关联。
<owl:ObjectProperty rdf:ID="locatedIn">
...
<rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing" />
<rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>
Notice how the domain and range of locatedIn are defined. The domain permits anything to be located in a region, including regions themselves. And the transitive (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#owl_TransitiveProperty) composition of this relation essentially creates a network of geographically included subregions and things. Those things that have nothing located in them can be of any class, while those that contain others must be regions.
请注意是如何定义locateIn的定义域和值域的。该定义域允许任何事物被置于某个区域中,包括该区域自身。这一关系的传递的 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#owl_TransitiveProperty)组合本质上构建了一个包含子区域和事物的地理网络。没有包含其他事物于其中的那些事物可以属于任意类,而包含其他事物或者区域的那些事物则必须是区域。
It is now possible to expand the definition of Wine to include the notion that a wine is made from at least one WineGrape. As with property definitions, class definitions have multiple subparts that are implicitly conjoined.
现在可以扩展Wine的定义来表达“一个葡萄酒是由至少一种WineGrape制成的”了。和属性定义一样,类定义也由多个隐含相联的部分组成。
<owl:Class rdf:ID="Wine">
<rdfs:subClassOf rdf:resource="&food;PotableLiquid"/>
<rdfs:subClassOf>
|
<owl:Restriction> |
</rdfs:subClassOf>
...
</owl:Class>
The highlighted subclass restriction above
上述被高亮的子类限定
<owl:Restriction>
<owl:onProperty rdf:resource="#madeFromGrape"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
defines an unnamed class that represents the set of things with at least one madeFromGrape property. We call these anonymous classes. Including this restriction in the Wine class definition body states that things that are wines are also members of this anonymous class. That is, every individual wine must participate in at least one madeFromGrape relation.
定义了一个无名类(unnamed class),该无名类代表至少具有一个madeFromGrape属性的事物集合。我们称这些类为匿名类。在Wine类的定义中包含该限定表明属于Wine类的事物,也是该匿名类的成员。也就是说,任何葡萄酒都必须参与至少一个madeFromGrape关系。
We can now describe the class of Vintages, discussed previously (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#vintageIntro).
现在,我们可以描述前面 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#vintageIntro)所提到的Vintage类了。
<owl:Class rdf:ID="Vintage">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#vintageOf"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class> ┐
The property vintageOf ties a Vintage to a Wine.
vintageOf属性将一个Vintage关联到Wine。
<owl:ObjectProperty rdf:ID="vintageOf">
<rdfs:domain rdf:resource="#Vintage" />
<rdfs:range rdf:resource="#Wine" />
</owl:ObjectProperty> ┐
We relate Vintages to their years in the next section.
我们将在下一节把Vintages关联到它们的生产年份。
3.2.2. Properties and Datatypes
3.2.2. 属性和数据类型
We distinguish properties according to whether they relate individuals to individuals (object properties) or individuals to datatypes (datatype properties). Datatype properties may range over RDF literals or simple types defined in accordance with XML Schema datatypes (http://www.w3.org/TR/xmlschema-2/).
根据是将个体关联到个体、还是将个体关联到数据类型,我们可以区分两类属性:前者称为对象属性(object properties);后者称为数据类型属性(datatype properties)。数据类型属性的值域范围是RDF文字或者是XML Schema数据类型 (http://www.w3.org/TR/xmlschema-2/)中定义的那些简单类型(simple types)。
OWL uses most of the built-in XML Schema datatypes. References to these datatypes are by means of the URI reference for the datatype, http://www.w3.org/2001/XMLSchema. The following datatypes are recommended for use with OWL:
OWL使用XML Schema内嵌数据类型中的大部分。对这些数据类型的引用是通过对http://www.w3.org/2001/XMLSchema 这个URI引用进行的。下列数据类型是推荐在OWL中使用的:
xsd:string xsd:normalizedString xsd:boolean
xsd:decimal xsd:float xsd:double
xsd:integer xsd:nonNegativeInteger xsd:positiveInteger
xsd:nonPositiveInteger xsd:negativeInteger
xsd:long xsd:int xsd:short xsd:byte
xsd:unsignedLong xsd:unsignedInt xsd:unsignedShort xsd:unsignedByte
xsd:hexBinary xsd:base64Binary
xsd:dateTime xsd:time xsd:date xsd:gYearMonth
xsd:gYear xsd:gMonthDay xsd:gDay xsd:gMonth
xsd:anyURI xsd:token xsd:language
xsd:NMTOKEN xsd:Name xsd:NCName
The above datatypes, plus rdfs:Literal, form the built-in OWL datatypes. All OWL reasoners are required to support the xsd:integer and xsd:string datatypes.
上面的数据类型,连同rdfs:Literal构成了OWL的内嵌数据类型。所有的OWL推理机都应支持xsd:integer和xsd:string数据类型。
Other built-in XML Schema datatypes may be used in OWL Full, but with caveats described in the OWL Semantics and Abstract Syntax (http://www.w3.org/TR/2004/REC-owl-semantics-20040210/syntax.html) documentation.
其他XML Schema内嵌数据类型可被在OWL Full中,但在OWL Semantics and Abstract Syntax (http://www.w3.org/TR/2004/REC-owl-semantics-20040210/syntax.html)中给出了一些警告。
<owl:Class rdf:ID="VintageYear" />
<owl:DatatypeProperty rdf:ID="yearValue">
<rdfs:domain rdf:resource="#VintageYear" />
<rdfs:range rdf:resource="&xsd;positiveInteger"/>
</owl:DatatypeProperty>
The yearValue property relates VintageYears to positive integer values. We introduce the hasVintageYear property, which relates a Vintage to a VintageYear below. (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#FunctionalProperty)
yearValue属性将VintageYears与一个整数值相关联。我们将引入hasVintageYear属性,它将一个Vintage关联到一个VintageYear(如下 (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#FunctionalProperty))。
The OWL Reference (http://www.w3.org/TR/2004/REC-owl-ref-20040210/#EnumeratedDatatype) ([Reference], 6.2) describes the use of owl:oneOf and rdf:List and rdf:rest to define an enumerated datatype. The example shows how to construct the owl:DatatypeProperty, tennisGameScore, with a range equal to the elements of the list of integer values {0, 15, 30, 40}.
OWL Reference (http://www.w3.org/TR/2004/REC-owl-ref-20040210/#EnumeratedDatatype)([Reference],6.2)描述了owl:oneOf的使用、以及用rdf:List和rdf:rest来定义一个枚举数据类型,那里有个例子展示了如何构建一个值域为整数值列表{0, 15, 30, 40}的数据类型属性tennisGameScore。
3.2.3. Properties of Individuals
3.2.3. 个体的属性
First we describe Region and Winery individuals, and then we define our first wine, a Cabernet Sauvignon.
首先,我们描述Region和Winery个体,然后我们定义第一个葡萄酒Cabernet Sauvignon。
<Region rdf:ID="SantaCruzMountainsRegion">
<locatedIn rdf:resource="#CaliforniaRegion" />
</Region>
<Winery rdf:ID="SantaCruzMountainVineyard" />
<CabernetSauvignon
rdf:ID="SantaCruzMountainVineyardCabernetSauvignon" >
<locatedIn rdf:resource="#SantaCruzMountainsRegion"/>
<hasMaker rdf:resource="#SantaCruzMountainVineyard" />
</CabernetSauvignon>
This is still incomplete. There are other aspects of the wine flavor that are defined in the full ontology. But the pieces are falling together. We could begin reasoning about what menu items in our food ontology this wine might accompany. We know from the definition above that the Santa Cruz Mountain Vineyard makes it. Because it is a Cabernet Sauvignon (see wine.rdf (http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine.rdf)), we know it is a dry, red wine.
这仍然是不完整的。完整的本体中存在关于葡萄酒口味的其他方面的定义。但这些片断将会慢慢地揍齐为一个整体。我们不妨先开始推理葡萄酒将会与食物本体中的什么菜单项相伴。我们从上述定义得知,它将是Santa Cruz Mountain Vineyard。因为它是一种Cabernet Sauvignon(定义参见wine.rdf (http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine.rdf)),我们知道它是一种干的(dry)、红色(red)葡萄酒(参见wine.rdf (http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine.rdf))。
Datatype properties can be added to individuals in a similar fashion. Below we describe an instance of VintageYear and tie it to a specific value of type &xsd:positiveInteger.
可以用同样的方式给个体增加数据类型属性。下面,我们描述一个VintageYear的实例,并将它关联到一个特定的&xsd;positiveInteger类型的值。
<VintageYear rdf:ID="Year1998">
<yearValue rdf:datatype="&xsd;positiveInteger">1998</yearValue>
</VintageYear>
3.3. Property Characteristics
3.3. 属性特性
The next few sections describe the mechanisms used to further specify properties. It is possible to specify property characteristics, which provides a powerful mechanism for enhanced reasoning about a property.
接下来的几节描述了用以进一步说明属性的机制。我们可以对属性的特性进行详细的说明,这就提供了一种强有力的机制以增强对于一个属性的推理。
3.3.1. TransitiveProperty
3.3.1. TransitiveProperty
If a property, P, is specified as transitive then for any x, y, and z:
P(x,y) and P(y,z) implies P(x,z)
The property locatedIn is transitive.
如果一个属性P被声明为传递属性,那么对于任意的x,y和z:
P(x,y) 与 P(y,z) 蕴含 P(x,z)
属性locatedIn是传递属性。
<owl:ObjectProperty rdf:ID="locatedIn">
<rdf:type rdf:resource="&owl;TransitiveProperty" />
<rdfs:domain rdf:resource="&owl;Thing" />
<rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>
<Region rdf:ID="SantaCruzMountainsRegion">
<locatedIn rdf:resource="#CaliforniaRegion" />
</Region>
<Region rdf:ID="CaliforniaRegion">
<locatedIn rdf:resource="#USRegion" />
</Region>
Because the SantaCruzMountainsRegion is locatedIn the CaliforniaRegion, then it must also be locatedIn the USRegion, since locatedIn is transitive.
因为圣克鲁斯山地区(SantaCruzMountainsRegion)位于(locatedIn)加利福尼亚地区(CaliforniaRegion),那么它也应该位于(locatedIn)美国地区(USRegion),因为属性locatedIn是传递属性。
3.3.2. SymmetricProperty
3.3.2. SymmetricProperty
If a property, P, is tagged as symmetric then for any x and y:
P(x,y) iff P(y,x)
如果一个属性P被声明为对称属性,那么对于任意的x和y:
P(x,y)当且仅当P(y,x)
The property adjacentRegion is symmetric, while locatedIn is not. To be more precise, locatedIn is not intended to be symmetric. Nothing in the wine ontology at present prevents it from being symmetric.
adjacentRegion属性是对称属性,而locatedIn属性则不是。更准确地说,locatedIn属性是没有被规定为对称属性。在当前的葡萄酒本体中没有任何限制,让它不能成为对称属性。
<owl:ObjectProperty rdf:ID="adjacentRegion">
<rdf:type rdf:resource="&owl;SymmetricProperty" />
<rdfs:domain rdf:resource="#Region" />
<rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>
<Region rdf:ID="MendocinoRegion">
<locatedIn rdf:resource="#CaliforniaRegion" />
<adjacentRegion rdf:resource="#SonomaRegion" />
</Region>
The MendocinoRegion is adjacent to the SonomaRegion and vice-versa. The MendocinoRegion is located in the CaliforniaRegion but not vice versa.
MendocinoRegion地区与SonomaRegion地区相邻,反过来也是这样。MendocinoRegion地区位于CaliforniaRegion地区,但是反过来并不成立。
3.3.3. FunctionalProperty
3.3.3. FunctionalProperty
If a property, P, is tagged as functional then for all x, y, and z:
P(x,y) and P(x,z) implies y = z
如果一个属性P被标记为函数型属性,那么对于所有的x, y, 和z:
P(x,y) 与P(x,z) 蕴含 y = z
In our wine ontology, hasVintageYear is functional. A wine has a unique vintage year. That is, a given individual Vintage can only be associated with a single year using the hasVintageYear property. It is not a requirement of a owl:FunctionalProperty that all elements of the domain have values. See the discussion of Vintage cardinality.
在我们的葡萄酒本体中,hasVintageYear属性是函数型属性。一种葡萄酒有着一个特定的制造年份。也即,一个给定的Vintage个体只能使用hasVintageYear属性与单独一个年份相关联。owl:FunctionalProperty并不要求该属性的定义域的所有元素都有值。请参见关于Vintage的基数的讨论。
<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>
3.3.4. inverseOf
3.3.4. inverseOf
If a property, P1, is tagged as the owl:inverseOf P2, then for all x and y:
P1(x,y) iff P2(y,x)
如果一个属性P1被标记为属性P2的逆(owl:inverseOf), 那么对于所有的x 和 y:
P1(x,y) 当且仅当P2(y,x)
Note that the syntax for owl:inverseOf takes a property name as an argument. A iff B means (A implies B) and (B implies A).
请注意owl:inverseOf的语法,它仅仅使用一个属性名作为参数。A 当且仅当B 意思是 (A 蕴含 B)并且(B蕴含A).
<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>
Wines have makers, which in the definition of Wine are restricted to Winerys. Then each Winery produces the set of wines that identify it as maker.
各种葡萄酒都有制造商,这些制造商在Wine类的定义中被限制为酿酒厂(Winery)。而每个酿酒厂生产的酒均以该酿酒厂为制造商。
3.3.5. InverseFunctionalProperty
3.3.5. InverseFunctionalProperty
If a property, P, is tagged as InverseFunctional then for all x, y and z:
P(y,x) and P(z,x) implies y = z
如果一个属性P被标记为反函数型的(InverseFunctional),那么对于所有的x, y 和 z:
P(y,x) 与 P(z,x) 蕴含 y = z
Notice that producesWine in the preceding section is inverse functional. The reason is that the inverse of a functional property must be inverse functional. We could have defined hasMaker and producesWine as follows and achieved the identical effect as the preceding example.
我们可以注意到,在前面的章节中提到的producesWine属性是反函数型属性。因为一个函数型属性的逆必定是反函数型的。我们也能够如下定义hasMaker属性和 producesWine 属性以达到和前例中相同的效果。
<owl:ObjectProperty rdf:ID="hasMaker" />
<owl:ObjectProperty rdf:ID="producesWine">
<rdf:type rdf:resource="&owl;InverseFunctionalProperty" />
<owl:inverseOf rdf:resource="#hasMaker" />
</owl:ObjectProperty> ?
Think of the elements of the range in an inverse functional property as defining a unique key in the database sense. owl:InverseFunctional implies that the elements of the range provide a unique identifier for each element of the domain.
反函数型属性的值域中的元素可以看成是在数据库意义上定义一个唯一的键值。owl:InverseFunctional意味着属性的值域中的元素为定义域中的每个元素提供了一个唯一的标识。
In OWL Full, we can tag a DatatypeProperty as inverseFunctional. This permits us to identify a string as a unique key. In OWL DL literals are disjoint from owl:Thing, which is why OWL DL does not permit InverseFunctional to be applied to DatatypeProperty.
在OWL Full中,DatatypeProperty属性可以被声明为一个反函数型属性。这就使得我们能够使用一个字符串作为一个唯一的键值。在OWL DL中,文字(literal)与owl:Thing是不相交的,因此OWL DL不允许将InverseFunctional属性声明应用到DatatypeProperty属性。
3.4. Property Restrictions
3.4. 属性限制
In addition to designating property characteristics, it is possible to further constrain the range of a property in specific contexts in a variety of ways. We do this with property restrictions. The various forms described below can only be used within the context of an owl:Restriction. The owl:onProperty element indicates the restricted property.
除了能够指定属性特性,我们还能够使用多种方法进一步在一个明确的上下文中限制属性的值域。这是通过“属性限制”来完成的。下面描述的多种形式仅在owl:Restriction的上下文中才能使用。owl:onProperty元素指出了受限制的属性。
3.4.1. allValuesFrom, someValuesFrom
3.4.1. allValuesFrom, someValuesFrom
We have already seen one way to restrict the types of the elements that make up a property. The mechanisms to date have been global in that they apply to all instances of the property. These next two, allValuesFrom and someValuesFrom, are local to their containing class definition.
我们已经发现了一种限制组成属性的元素的类型的方法。到现在为止,我们所讲述的机制都是全局的(global),因为这些机制都会应用到属性的所有实例。而接下来要讲述的两个属性限制机制,allValuesFrom与 someValuesFrom,则是 局部的(local),它们仅仅在包含它们的类的定义中起作用。
The owl:allValuesFrom restriction requires that for every instance of the class that has instances of the specified property, the values of the property are all members of the class indicated by the owl:allValuesFrom clause.
owl:allValuesFrom属性限制要求:对于每一个有指定属性实例的类实例,该属性的值必须是由owl:allValuesFrom从句指定的类的成员。
<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>
The maker of a Wine must be a Winery. The allValuesFrom restriction is on the hasMaker property of this Wine class only. Makers of Cheese are not constrained by this local restriction.
owl:someValuesFrom is similar. If we replaced owl:allValuesFrom with owl:someValuesFrom in the example above, it would mean that at least one of the hasMaker properties of a Wine must point to an individual that is a Winery.
Wine的制造商必须是Winery。allValuesFrom限制仅仅应用在Wine的hasMaker 属性上。Cheese的制造商并不受这一局部限制的约束。
owl:someValuesFrom限制与之相似。在上个例子中,如果我们用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:someValuesFrom rdf:resource="#Winery" />
</owl:Restriction>
</rdfs:subClassOf>
...
</owl:Class> ?
The difference between the two formulations is the difference between a universal and existential quantification.
这两种限制形式间的不同就是全称量词与存在量词间的不同。
Relation Implications
关系 含意
allValuesFrom For all wines, if they have makers, all the makers are wineries.
allValuesFrom 对于所有的葡萄酒,如果它们有制造商,那么所有的制造商都是酿酒厂。
someValuesFrom For all wines, they have at least one maker that is a winery.
someValuesFrom 对于所有的葡萄酒,它们中至少有一个的制造商是酿酒厂。
The first does not require a wine to have a maker. If it does have one or more, they must all be wineries. The second requires that there be at least one maker that is a winery, but there may be makers that are not wineries.
前者并不要求一种葡萄酒一定要有一个制造商。如果它确实有一个或多个制造商,那么这些制造商必须全部都是酿酒厂。后者要求至少有一个制造商是酿酒厂,但是可以存在不是酿酒厂的制造商。
3.4.2. Cardinality
3.4.2. 基数限制
We have already seen examples of cardinality constraints. To date, they have been assertions about minimum cardinality. Even more straight-forward is owl:cardinality, which permits the specification of exactly the number of elements in a relation. For example, we specify Vintage to be a class with exactly one VintageYear.
在前面我们已经看到过关于基数约束的例子了。到目前为止的例子中,这些约束都是关于最小基数的所作出的断言。更为直接的方法是使用owl:cardinality,这一约束允许对一个关系中的元素数目作出精确的限制。例如,我们可以将Vintage标识为恰好含有一个VintageYear的类。
<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>
We specified hasVintageYear to be a functional property, which is the same as saying that every Vintage has at most one VintageYear. This application of that property to Vintage using the cardinality restriction asserts something stronger, that every Vintage has exactly one VintageYear.
Cardinality expressions with values limited to 0 or 1 are part of OWL Lite. This permits the user to indicate 'at least one', 'no more than one', and 'exactly one'. Positive integer values other than 0 and 1 are permitted in OWL DL. owl:maxCardinality can be used to specify an upper bound. owl:minCardinality can be used to specify a lower bound. In combination, the two can be used to limit the property's cardinality to a numeric interval.
我们标识hasVintageYear属性为一个函数型属性,也即意味着每个Vintage有至多一个VintageYear。而如果对Vintage类的hasVintageYear属性使用基数限制则是对其作出了更强的断言,它表明了每个Vintage有恰好一个VintageYear。
值域限制在0和1的基数表达式(Cardinality expressions)是OWL Lite的一部分。这使得用户能够表示“至少一个”,“不超过一个”,和“恰好一个”这几种意思。OWL DL中还允许使用除0与1以外的正整数值。owl:maxCardinality能够用来指定一个上界。owl:minCardinality能够用来指定一个下界。使用二者的组合就能够将一个属性的基数限制为一个数值区间。
3.4.3. hasValue [OWL DL (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#OWL_DL_tag) ]
3.4.3. hasValue [OWL DL (http://www.w3.org/TR/2004/REC-owl-guide-20040210/#OWL_DL_tag) ]
hasValue allows us to specify classes based on the existence of particular property values. Hence, an individual will be a member of such a class whenever at least one of its property values is equal to the hasValue resource.
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>
Here we declare that all Burgundy wines are dry. That is, their hasSugar property must have at least one value that is equal to Dry.
As for allValuesFrom and someValuesFrom, this is a local restriction. It holds for hasSugar as applied to Burgundy.
这里我们声明了所有的Burgundy酒都是干(dry)的酒。也即,它们的hasSugar属性必须至少有一个是值等于Dry(干的)。
与allValuesFrom 和someValuesFrom类似,这是一个局部的限制。它仅仅对Burgundy类的hasSugar属性作出限制。


