【问题标题】:Correct way to describe inferred property with OWL and RDF用 OWL 和 RDF 描述推断属性的正确方法
【发布时间】:2018-06-06 21:45:51
【问题描述】:

我正在尝试使用 OWL 编写推理规则。

鉴于以下情况:

  • 文档被归类为具有类别 - 比如说“合同法”
  • 有一个父类“法律”,子类“合同法”
  • 我想推断该文档也被归类为“法律”

声明:

@prefix : <http://example.com/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:Document rdf:type owl:Class .
:Category rdf:type owl:Class .

:documentHasCategory rdf:type owl:ObjectProperty ;
                rdfs:domain :Document ;
                rdfs:range :Category .

:hasSubCategory rdf:type owl:ObjectProperty ;
                rdfs:domain :Category ;
                rdfs:range :Category .

:category1 rdf:type :Category ;
      rdfs:label "Law" ;
      :hasSubCategory :category2 .

:category2 rdf:type :Category ;
      rdfs:label "Contract Law".

:doc1 rdf:type :Document ;
     :documentHasCategory :category2 .

我应该如何编写推理语句以将“法律”类别添加到文档中?我试过了:

:inferredCategory rdf:type owl:ObjectProperty ;
                 rdfs:domain :Document ;
                 rdfs:range :Category ;
                 owl:propertyChainAxiom ( :documentHasCategory :hasSubCategory ) .

但我没有看到任何推断的语句(我正在使用 GraphDB)。

owl:propertyChainAxiom 是解决此问题的正确方法吗? 我的海龟语法错了吗?

【问题讨论】:

  • 将这些类别建模为 OWL 类或查看 stackoverflow.com/q/48015890/7879193(您应该为您的存储库选择 OWL-RL GraphDB“规则集”)。
  • 对不起,我不确定您所说的“将这些类别建模为 OWL 类”是什么意思。不是吗?
  • 我的意思是,作为文档类,doc1 a :Document, :Category1
  • 你得原谅我,我还是不听。这与使用 rdf:type 语句定义它们有什么不同吗?请尽可能明确 - 谢谢!

标签: rdf owl rdfs graphdb


【解决方案1】:

我不尊重 hasSubCategory 谓词的方向,因此实际上没有任何内容符合 propertyChain 规则。

像这样定义推理就可以了:

:hasParentCategory rdf:type owl:ObjectProperty ;
    owl:inverseOf :hasChildCategory .

:documentHasInferredCategory rdf:type owl:ObjectProperty ;
                rdfs:domain :Document ;
                rdfs:range :Category ;
                owl:propertyChainAxiom ( :documentHasCategory :hasParentCategory ) .

【讨论】:

    猜你喜欢
    • 2013-08-08
    • 2016-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-22
    • 2011-08-31
    • 1970-01-01
    • 2022-11-15
    相关资源
    最近更新 更多