2013-11-24 21 views
1

我有2個屬性,例如'hasColor'和'hasFinish'。我想用本體論表達本體類A的屬性'hasColor'和'hasFinish'等於(owl:equivalentProperty)。但是對於本體類B,屬性'hasColor'和'hasFinish'是不相等的。本體屬性之間的等價關係

我該如何做到這一點?

一種方法可能是創建'classColor'和'hasFinish'屬性作爲範圍,並將它們設置爲相等。然後創建另一個'hasColor'和'hasFinish'屬性作爲範圍,並且沒有相等的關係。但這是正確的方法嗎?

+0

當你說他們和B類不一樣時,你的意思是他們不應該有山姆e值(例如,你不能有'b1 hasFinish x; hasColor x')或只是它們不必具有相同的值(例如,'b2 hasFinish x; hasColor y'(with'x!= y')是_permitted_)?兩種關係可以是明顯的,但仍然有重疊。最重要的是,你可能並不需要確定兩個關係是相同的,但實際上它們最終可能具有相同的擴展。 –

回答

2

目前尚不完全清楚您的意思是通過製作兩個屬性un -equal。默認情況下,兩個屬性可以是不同的,所以你不必對做任何特殊的處理,讓它們不等於。如果問題得到澄清,那麼可能會增加更多的信息。

這不是完全瑣碎的說,例如,

∀ A,X。 A(一)→(hasFinish(A,X)⇔ hasColor(A,X))

在OWL

,但你可以做到這一點。如果你想對所有班級說這個,你可以像你指出的那樣使用owl:equivalentProperty。現在,當你說p是等效的屬性r,你也可以說,

P⊑ r
r⊑ p

也就是說,pr的每一個都是另一個的子屬性。在OWL 2(但不幸的是,不是OWL 2 DL,如安東尼齊默爾曼在評論中指出的),你可以斷言一個屬性是一個鏈性質的,例如一個超性質,

hasFather• hasBrother⊑ hasUncle

其中說,如果某人有一個有兄弟的父親,那麼這個父親的兄弟就是那個人的叔叔。

還有一個叫做rolification的概念,在OWL 2 rolification中有更多描述,它是創建一個屬性的過程,該屬性對應於一個類,該類將該類的每個個體與自身相關聯。對於你類,將有一個關係- [R ,其涉及每個其自身,並且僅涉及那些實例。如果你再看看一個物業鏈如

R A• hasFinish

你會發現它的真正hasFinish的子屬性,其中第一個參數是一個。這意味着,你可以說hasFinish和hasColor是A類相同通過做兩個子屬性斷言:

[R 一個及子彈; hasColor⊑ hasFinish
R A• hasFinish⊑ hasColor

這些假設類型A的個人是這些陳述的主題。如果A實際上是此處的範圍,那麼您只需使用

∀ a,x。 A(a)→ hasFinish(x,a)⇔ hasColor(x,a))
hasColor• R A⊑ hasFinish
hasFinish• R A⊑ hasColor

獲取屬性[R 一個,你需要一個≡ ∃ [R 一個 .Self

添加定義

你的本體。在門徒新,這將是這樣的:

enter image description here enter image description here enter image description here

所得本體的樣子(在RDF/XML):

<rdf:RDF 
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    xmlns:owl="http://www.w3.org/2002/07/owl#" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
    xmlns="http://example.org/ep#" 
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> 
    <owl:Ontology rdf:about="http://example.org/ep"/> 
    <owl:Class rdf:about="http://example.org/ep#A"> 
    <owl:equivalentClass> 
     <owl:Restriction> 
     <owl:onProperty> 
      <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/> 
     </owl:onProperty> 
     <owl:hasSelf rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean" 
     >true</owl:hasSelf> 
     </owl:Restriction> 
    </owl:equivalentClass> 
    </owl:Class> 
    <owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish"> 
    <owl:propertyChainAxiom rdf:parseType="Collection"> 
     <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/> 
     <owl:ObjectProperty rdf:about="http://example.org/ep#hasColor"/> 
    </owl:propertyChainAxiom> 
    </owl:ObjectProperty> 
    <owl:ObjectProperty rdf:about="http://example.org/ep#hasColor"> 
    <owl:propertyChainAxiom rdf:parseType="Collection"> 
     <owl:ObjectProperty rdf:about="http://example.org/ep#R_A"/> 
     <owl:ObjectProperty rdf:about="http://example.org/ep#hasFinish"/> 
    </owl:propertyChainAxiom> 
    </owl:ObjectProperty> 
</rdf:RDF> 

和烏龜:

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

:hasFinish a     owl:ObjectProperty ; 
     owl:propertyChainAxiom (:R_A :hasColor) . 

:A  a     owl:Class ; 
     owl:equivalentClass [ a    owl:Restriction ; 
           owl:hasSelf  true ; 
           owl:onProperty :R_A 
          ] . 

:hasColor a     owl:ObjectProperty ; 
     owl:propertyChainAxiom (:R_A :hasFinish) . 

<http://example.org/ep> 
     a  owl:Ontology . 

:R_A a  owl:ObjectProperty . 
+0

嗨,約書亞,謝謝你的回答,我會研究它以更多地瞭解本體。但是我意識到我的問題並不清楚。我知道屬性相等(owl:sameAs構造)而不是等價(owl:equivalentProperty構造)。所以我想說,如果實例屬於類A,那麼屬性hasColor和hasFinish是相等的(owl:sameAs) - 我將它們看作具有相同含義的屬性,但如果這些屬性與類B的個人一起使用,那麼我想要將它們視爲具有不同含義的不同屬性。我認爲這可能不可能與貓頭鷹語法? – user3024710

+0

約書亞,優秀的答案。但是,請注意,您使用的構造不在OWL 2 DL中。因此,一些reasoners可能無法推斷它(例如,Pellet,HermiT)。其他reasoners可能能夠處理這種結構,但只能通過不完整。 –

+0

user3024710,從您在這裏的評論中,我產生一種印象,你誤解了貓頭鷹的概念:sameAs。在所有可能的情況下,如果'x'和'y'只是一件事物的可互換名稱,'x'就是'owl:sameAs'事物'y'。沒有上下文相關的sameAs。 –