【问题标题】:OWL. How to express that siblings has common parent?猫头鹰。如何表达兄弟姐妹有共同的父母?
【发布时间】:2015-09-03 02:22:11
【问题描述】:

我用海龟符号写了一个简单的文件,其中戴夫是玛丽的父亲,玛丽是杰克的妹妹。我想要 Dave 有两个孩子 Jack 和 Mary 的理由。

:Human a rdfs:Class .

:Man rdfs:subClassOf :Human ;
  owl:disjointWith :Woman .
:Woman rdfs:subClassOf :Human ;
  owl:disjointWith :Man .


:hasChild a rdf:Property ;
  owl:inverseOf :hasParent ;
  rdfs:domain :Human ;
  rdfs:range :Human.

:fatherOf owl:InverseFunctionalProperty rdf:Property ;
  owl:inverseOf :hasFather ;
  rdfs:subPropertyOf :hasChild ;
  rdfs:domain :Man ;
  rdfs:range :Human.

:motherOf owl:InverseFunctionalProperty rdf:Property ;
  owl:inverseOf :hasMother ;
  rdfs:subPropertyOf :hasChild ;
  rdfs:domain :Woman ;
  rdfs:range :Human.


:siblingOf a owl:SymmetricProperty, owl:TransitiveProperty ;
  owl:inverseOf :hasSibling ;
  rdfs:domain :Human ;
  rdfs:range :Human.

:brotherOf a rdf:Property ;
  owl:inverseOf :hasBrother ;
  rdfs:subPropertyOf :siblingOf ;
  rdfs:domain :Man ;
  rdfs:range :Human.

:sisterOf a rdf:Property ;
  owl:inverseOf :hasSister ;
  rdfs:subPropertyOf :siblingOf ;
  rdfs:domain :Woman ;
  rdfs:range :Human.



[] rdf:type owl:Axiom ;
   owl:subject    :Man ;
   owl:predicate  rdfs:subClassOf ;
   owl:object     :Human ;
   rdfs:label     "States that every man is a human."^^xsd:string .

[] rdf:type owl:Axiom ;
   owl:subject    :Woman ;
   owl:predicate  rdfs:subClassOf ;
   owl:object     :Human ;
   rdfs:label     "States that every woman is a human."^^xsd:string .


:Dave a :Man .

:Jack a :Man ;
   :hasSister :Mary .

:Mary a :Woman ;
   :hasFather :Dave .

我读过http://www.w3.org/TR/owl-ref/#Propertyhttp://www.w3.org/TR/2002/WD-owl-semantics-20021108/syntax.html#2.3.1.3,但仍然不明白如何表达这个简单的事实。

【问题讨论】:

标签: rdf semantics semantic-web owl


【解决方案1】:

戴夫是玛丽的父亲,玛丽是杰克的妹妹。我想要戴夫有两个孩子杰克和玛丽的理由。

如果您忽略了兄弟姐妹有不同父母的可能性(例如,共同的父母和不同的父母),那么您可以使用子属性链来做到这一点。如果您有以下数据:

        Dave →hasChild Mary →hasSibling Jack

那么你会想要使用以下规则:

        hasChild • hasSibling ⊑有孩子

这可以让你推断:

        Dave →hasChild Jack

在 Turtle 中可能如下所示:

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

a:Jack  a       owl:NamedIndividual .

a:Dave  a           owl:NamedIndividual ;
        a:hasChild  a:Mary .

a:hasChild  a                   owl:ObjectProperty ;
        owl:propertyChainAxiom  ( a:hasChild a:hasSibling ) .

a:Mary  a             owl:NamedIndividual ;
        a:hasSibling  a:Jack .

a:hasSibling  a  owl:ObjectProperty .

a:      a       owl:Ontology .

这是 Protege 中得出的结论:

【讨论】:

  • 我们知道Jack :hasSibling MaryMary :hasSibling Jack,由于传递性Mary :hasSibling MaryJack :hasSibling Jack。我们如何重新定义:hasSibling 属性?
  • @4ell 我不太确定你在问什么。你能举个例子说明你想从中推断出什么吗?
  • 从事实Jack :hasSibling Mary 我只想推断Mary :hasSibling Jack 不包括 :hasSibling 本身,如Jack :hasSibling Jack
  • @4ell 我不确定你能否在 OWL 中做到这一点。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-04
  • 2013-06-07
  • 1970-01-01
  • 2014-08-31
相关资源
最近更新 更多