如何创建具有相同对象属性的多个关系? [英] How to create multiple relations with same object property?
问题描述
我正在使用protege 5开发本体.我已经创建了has_composition
作为对象属性.在我的本体中,相同的object_property用于不同的域及其各自的范围,例如A的has_composition
是B,C的has_composition
是D,E和F.
I am using protege 5 for developing ontology. I have created has_composition
as object property. In my ontology the same object_property is used for different domains and their respective range, like has_composition
of A is B and has_composition
of C and D is E and F.
如何为该映射建模?
推荐答案
OWL(本体Web语言,定义本体的本体)不允许对您要尝试的操作进行建模.
OWL (Ontology Web Language, the ontology that defines ontologies) does not allow to model what you're trying to do.
我可以想到的解决方法是使用子属性.想象一下以下课程:
A workaround I can think of is to use sub-properties. Imagine the following classes:
-
Pizza
-
TomatoSauce
-
ChocolateCake
-
Chocolate
Pizza
TomatoSauce
ChocolateCake
Chocolate
如果您想定义诸如这样的关系
If you want to define relations such as
- A
Pizza
has_composition
TomatoSauce
和 - A
ChocolateCake
has_composition
Chocolate
- A
Pizza
has_composition
TomatoSauce
, and - A
ChocolateCake
has_composition
Chocolate
然后定义以下关系:
-
has_composition
:无域也无范围(或例如Dish
和Ingredient
之类的通用超类)-
has_tomato_sauce
:域Pizza
,范围TomatoSauce
-
has_chocolate
:域ChocolateCake
,范围Chocolate
has_composition
: No domain nor range (or a common superclass such asDish
andIngredient
for example)has_tomato_sauce
: DomainPizza
, rangeTomatoSauce
has_chocolate
: DomainChocolateCake
, rangeChocolate
这将允许推理机(计算推断的软件)推断出,如果
something
has_chocolate
a_chocolate
,则This will allow the reasoner (the software that computes inferences) to infer that if
something
has_chocolate
a_chocolate
, then-
something
rdf:type
Chocolate
(由has_chocolate
的域推断); -
something
has_composition
a_chocolate
(因为has_chocolate
是has_composition
的子属性).
something
rdf:type
Chocolate
(inferred by the domain ofhas_chocolate
);something
has_composition
a_chocolate
(becausehas_chocolate
is a sub-property ofhas_composition
).
您可以在我制作的这个要点中查看该示例.
You can check out this example in this Gist I made.
下载它,打开它,然后启动推理机.您将看到黄色的推断的语句.
Download it, open it, and start the reasoner. You will see the inferred statements in yellow.
这篇关于如何创建具有相同对象属性的多个关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-