2012-05-16 22 views
2

實例OWL-類的假設我有一個OWL-類如下:與unionOf(N3)

:picture rdf:type owl:Class ; 
      owl:unionOf(:creator :theme :title :date) . 

:creator隨着,:theme:title:date任一種owl:ObjectPropertyowl:DataProperty

例如:

:creator rdf:type owl:ObjectProperty ; 
      rdfs:comment "The creator of this picture." ; 
      rdfs:domain :picture ; 
      rdfs:range foaf:Person . 

我怎麼能創造這幅畫類的實例?

(我明白,我怎麼創造的一件容易的事情,例如一個實例:<http://dbpedia.org/resource/Paris> rdf:type :location .將是一個位置的一個實例)如果你想描述其可以包含屬性:creator:theme

+2

你不能,因爲你的類定義不是有效的OWL。你不能在屬性列表中使用'owl:unionOf'約束(值只能是類描述)。你能描述一下你試圖建模嗎? –

回答

1

:title:date你應該只描述所有屬性域(圖片類沒有額外的定義是必要的):

:picture a owl:Class . 

:creator rdfs:domain :picture ; 
     rdfs:range foaf:Person . 

等。

如果要形容這必須包含這些屬性的類,基數限制應增加:

:picture a owl:Class ; 
     rdfs:subClassOf [ 
      a owl:Restriction ; 
      owl:onProperty creator ; 
      owl:minCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> 
     ] 
     rdfs:subClassOf [ 
      a owl:Restriction ; 
      owl:onProperty theme ; 
      owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> 
     ] 
     ... etc ... 

在這兩種情況下,一個實例的定義看起來像下面:

:monaLisa a :picture ; 
      :creator :LeonardoDaVinci ; 
      ... 
      :date "1503-01-01"^^<http://www.w3.org/2001/XMLSchema#date> 

更多關於您可以學習的限制,例如,從this文檔。

相關問題