![](/img/trans.png)
[英]How to describe a property including inverseOf to an instance in OWL-RDF/XML syntax?
[英]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.