将知识陈述添加到Protege中的OWL本体中) [英] Adding statements of knowledge to an OWL Ontology in Protege)

查看:69
本文介绍了将知识陈述添加到Protege中的OWL本体中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的本体论中,我有三个班级,分别是 Player Team Competition .我还具有两个对象属性,即 employs 和 competesIn . employs 的域是 Team ,范围 Player competesIn 的域是 Team 播放器和范围竞争.

In my Ontology I have three classes, Player, Team, and Competition. I also have the two object properties, employs, and competesIn. The domain of employs is Team, and the range Player, the domain of competesIn is Team or Player and the range Competition.

我希望本体论推断,如果 Team 使用了 Player ,并且 Team 参加了 Competition ,那么 Player 也会参加该竞争.有没有什么方法可以将此信息添加到本体中,而无需为本体中的每个个人都放置{Player} competesIn {Competition}?

I want the Ontology to infer that if a Player is employed by a Team and that Team competes in a Competition then the Player also competes in that Competition. Is there any way to add this information to an Ontology without putting in the {Player} competesIn {Competition} for every single individual in the ontology?

推荐答案

首先,如果您提供了最小的本体作为起点,则回答起来会更容易.幸运的是,这非常简单.这是在Turtle序列化中:

First, it would be easier to answer this if you had provided the minimal ontology as a starting point. Fortunately, it's pretty simple. Here it is in the Turtle serialization:

@prefix :      <https://stackoverflow.com/q/22688901/1281433/competitions#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<https://stackoverflow.com/q/22688901/1281433/competitions>
        a       owl:Ontology .

:Player  a      owl:Class .
:Team   a       owl:Class .
:Competition  a  owl:Class .

:employs  a          owl:ObjectProperty ;
        rdfs:domain  :Team ;
        rdfs:range   :Player .

:competesIn  a       owl:ObjectProperty ;
        rdfs:domain  [ a            owl:Class ;
                       owl:unionOf  ( :Player :Team )
                     ] ;
        rdfs:range   :Competition .

我们实际上并不需要在属性上使用域和范围声明来进行这项工作,但是自从您提到它们以来,无论如何我都将它们包括在内.您要表达这样的说法:如果团队雇用一名球员,并且该团队参加比赛,那么该球员参加比赛."从逻辑上讲,我们可以表示为:

We don't actually need the domain and range declarations on the property to make this work, but I've included them anyway, since you mentioned them. You're trying to express the statement that "If team employs a player and the team competes in a competition, then the player competes in the competition." Logically, we can represent that as:

雇用(?team,?player)∧ CompetitionsIn(?team,?competition)→ CompetitionsIn(?player,?competition)

employs(?team,?player) ∧ competesIn(?team,?competition) → competesIn(?player,?competition)

对我们之间的关系以及我们希望获得的关系进行描绘很有用:

It's useful to draw a picture of what the relations that we have are, and what we'd like to get:

实线箭头是我们实际拥有的,虚线箭头是我们想要推断的.我们可以使用OWL中的子属性链来完成此操作.沿实线箭头有一条路径或属性链,从玩家到竞争.路径的第一条边沿相反方向的箭头,因此它是一个反向属性(employs -1 ),第二条边条沿向前方向的箭头跟随,它只是竞争.我们试图说的是,无论哪里有这样的道路,在道路的起点和终点之间都存在着competsIn关系.该链写为"employs -1 •而我们要断言这是CompetitionsIn的子属性:

The solid arrows are what we actually have, and the dashed arrow is what we'd like to infer. We can do this using a subproperty chain in OWL. There's path, or chain of properties, from ?player to ?competiton along the solid arrows. The first edge of the path follows an arrow in reverse direction, so it's an inverse property (employs-1), and the second edge follows an arrow in the forward direction, it's simply competesIn. We're trying to say that wherever there's such a path, there's competesIn relationship between the beginning and end of the path. The chain is written as "employs-1 • competesIn" and we want to assert that it's a subproperty of competesIn:

雇用 -1 •竞争⊑比赛

employs-1 • competesIn ⊑ competesIn

在Protégé中,它看起来像这样:

In Protégé, this looks like this:

这给我们留下了最后的本体:

This leaves us with the final ontology:

@prefix :      <https://stackoverflow.com/q/22688901/1281433/competitions#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

:Player  a      owl:Class .
:Team   a       owl:Class .
:Competition  a  owl:Class .

<https://stackoverflow.com/q/22688901/1281433/competitions>
        a       owl:Ontology .

:employs  a          owl:ObjectProperty ;
        rdfs:domain  :Team ;
        rdfs:range   :Player .

:competesIn  a                  owl:ObjectProperty ;
        rdfs:domain             [ a            owl:Class ;
                                  owl:unionOf  ( :Player :Team )
                                ] ;
        rdfs:range              :Competition ;
        owl:propertyChainAxiom  ( [ owl:inverseOf
                          :employs ] :competesIn ) .

限制适用于此的主题

最初的问题中没有提到,但是在评论中透露,除球员以外的其他任何东西都可以被团队使用,其中一些不应该被推断为可以参加比赛.仍然可以解决,但要完成一些.诀窍是要认识到您需要一种新的公理形式:

Restricting the subjects that this applies to

It wasn't mentioned in the original question, but was revealed in the comments that things other than Players can can be employed by a Team, and some of those things should not be inferred to compete in a competition. This can still be handled, but it gets a little bit more complete. The trick is to realize that you need a new axiom of the form:

p•雇用 -1 •竞争⊑竞争

p • employs-1 • competesIn ⊑ competesIn

其中,p是一些特殊属性,可将每个玩家与自己联系起来.构造这样的属性称为rolification.另一个Stack Overflow问题, OWL 2 rolification 以及链接的学术出版物对此技术进行了详细描述.从这个问题.还有其他有关堆栈溢出的答案也涉及到泛化.还有

where p is some special property that relates each player to himself or herself. Constructing such a property is is called rolification. That technique has been described in some detail in another Stack Overflow question, OWL 2 rolification, as well as the academic publication that's linked from that question. There are some other answers on Stack Overflow that involve rolification, too. There are also some on answers.semanticweb.com. At any rate, the idea is to define a new property, RPlayer corresponding to the class, and to define the class Player with the axiom:

玩家≡ R Player 一些自己

这表示x仅当 R Player (x,x)时是 Player ,这正是我们所拥有的属性需要填写 p .这为我们提供了以下本体:

This says that x is a Player if and only if RPlayer(x,x), and that's exactly the property that we need to fill in for p. This gives us the following ontology:

@prefix :      <https://stackoverflow.com/q/22688901/1281433/competitions#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<https://stackoverflow.com/q/22688901/1281433/competitions>
        a       owl:Ontology .

:R_Player  a    owl:ObjectProperty .

:employs  a          owl:ObjectProperty ;
        rdfs:domain  :Team ;
        rdfs:range   :Player .

:competesIn  a                  owl:ObjectProperty ;
        rdfs:domain             [ a            owl:Class ;
                                  owl:unionOf  ( :Player :Team )
                                ] ;
        rdfs:range              :Competition ;
        owl:propertyChainAxiom  ( :R_Player [ owl:inverseOf
                          :employs ] :competesIn ) .

:Team   a       owl:Class .

:Competition  a  owl:Class .

:Player  a                   owl:Class ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  :R_Player
                             ] .

这篇关于将知识陈述添加到Protege中的OWL本体中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆