【问题标题】:Adding statements of knowledge to an OWL Ontology in Protege)将知识陈述添加到 Protege 中的 OWL 本体)
【发布时间】:2014-03-27 13:18:47
【问题描述】:

在我的本体中,我有三个类,PlayerTeamCompetition。我还有两个对象属性,employscompetesInemploys的域是Team,范围PlayercompetesIn的域是Team 玩家和范围比赛

我希望本体推断出,如果 PlayerTeam 雇用,并且 Team 参加 Competition 那么玩家也参加了那个竞赛。有没有办法将此信息添加到本体中,而不需要为本体中的每个人添加 {Player} competesIn {Competition}?

【问题讨论】:

    标签: owl ontology protege description-logic


    【解决方案1】:

    首先,如果您提供了最小本体作为起点,那么回答这个问题会更容易。幸运的是,这很简单。在 Turtle 序列化中:

    @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 .
    

    我们实际上并不需要属性上的域和范围声明来完成这项工作,但无论如何我已经包含了它们,因为你提到了它们。你试图表达“如果球队雇佣了一名球员,球队在比赛中竞争,那么球员也在比赛中竞争”。从逻辑上讲,我们可以表示为:

    雇佣(?team,?player) &wedge; CompetitionsIn(?team,?competition) &rightarrow; CompetitionsIn(?player,?competition)

    画出我们所拥有的关系以及我们想要得到什么是很有用的:

    实线箭头是我们实际拥有的,虚线箭头是我们想要推断的。我们可以使用 OWL 中的子属性链来做到这一点。沿着实线箭头从 ?player 到 ?competition 存在路径或属性链。路径的第一条边沿反向箭头,所以它是一个反向属性(employs-1),第二条边沿正向箭头,它只是competitesIn。我们试图说,只要有这样的路径,就会在路径的起点和终点之间存在竞争关系。链写为“employs-1 &bullet; CompetitionsIn”,我们想断言它是competitsIn的子属性:

    雇用-1 &bullet;竞争在&sqsubseteq;参加比赛

    在 Protégé 中,如下所示:

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

    @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 ) .
    

    限制适用的主题

    最初的问题中没有提到,但在 cmets 中透露,除了球员之外的东西可以被团队使用,其中一些东西不应该被推断为参加比赛。这仍然可以处理,但它会变得更加完整。诀窍是意识到你需要一个新的公理形式:

    p &bullet;雇用-1 &bullet;竞争在&sqsubseteq;参加比赛

    其中 p 是将每个玩家与他或她自己联系起来的一些特殊属性。构建这样的属性称为 rolification。该技术已在另一个 Stack Overflow 问题OWL 2 rolification 以及与该问题相关联的学术出版物中进行了详细描述。还有一些其他的answers on Stack Overflow 也涉及到 rolification。还有some on answers.semanticweb.com。无论如何,想法是定义一个新的属性,对应于类的RPlayer,并用公理定义类Player

    玩家≡R玩家一些自我

    这表示 x 是一个 Player 当且仅当 RPlayer(x,x),而这正是我们p需要填写。这为我们提供了以下本体:

    @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
                                 ] .
    

    【讨论】:

    • 在employees-1 中如何表示'•' • 在Protege 中competesIn?谢谢。
    • 这就是我展示Protege截图的原因。是字母“o”。不过不要难过,我也花了一段时间才弄清楚。
    • 谢谢,我确实使用了字母“o”,但将其大写,这就是为什么我认为它不起作用。
    • 我遇到了一个我没有预料到的问题。我的本体不仅仅是一个团队雇用的球员。我有团队雇用员工,作为员工的子类,有经理、教练、球员等。链条导致推理器推断经理/教练是球员,这在我的本体中是不正确的。
    • 好吧,如果你使用一种叫做 rolification 的技术,你仍然可以获得你想要的行为。我现在只是在打电话,但稍后我会在答案中添加更多内容。
    猜你喜欢
    • 1970-01-01
    • 2014-12-03
    • 1970-01-01
    • 2014-05-03
    • 2017-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-01
    相关资源
    最近更新 更多