rdf - 猫头鹰。如何表达 sibling 有共同的 parent ?

标签 rdf semantics semantic-web owl

我用乌龟表示法编写了简单的文件,其中戴夫是玛丽的父亲,玛丽是 jack 的妹妹。我想要戴夫有两个 child jack 和玛丽的理由。

: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/#Property , http://www.w3.org/TR/2002/WD-owl-semantics-20021108/syntax.html#2.3.1.3但还是不明白如何表达这个简单的事实。

最佳答案

Dave is father of Mary and Mary sister of Jack. I want reason that Dave have two childs Jack and Mary.

如果您忽略 sibling 具有不同 parent 的可能性(例如,共同的 parent 和不同的 parent ),那么您可以使用子属性(property)链来做到这一点。如果您有如下数据:

        戴夫→hasChild玛丽→hasSibling jack

那么您需要使用以下规则:

        hasChild • hasSibling ⊑ hasChild

这可以让你推断:

        戴夫 →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 中得出的结论:

sibling inference

关于rdf - 猫头鹰。如何表达 sibling 有共同的 parent ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30898534/

相关文章:

html - 文章页面中的 H1 - 站点标题或文章标题?

php - 如何在 php 中对本地 rdf 文件运行 sparql 查询

java - 无法扩展 Node_Literal Jena 类

java - JENA - 从 RDF 中获取值(value)

unicode - 如何在unicode中表示理货/五条门?

html - 通过 css 保持语义和事物的可塑性

apache - 405 方法不允许 : PUT http://localhost:3030/dataset/data? 默认

mysql - Jena SDB(一个关系数据库支持的 RDF 存储)如何处理 SPARQL 查询?

firefox - 更新 Firefox 插件在某些机器上失败

java - 将列表中的值输入 sparql 查询