簡體   English   中英

用OWL和RDF描述推論屬性的正確方法

[英]Correct way to describe inferred property with OWL and RDF

我正在嘗試使用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是解決此問題的正確方法嗎? 我的海龜語法錯誤嗎?

我沒有尊重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 ) .

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM