2

Suppose i have an OWL-class as following:

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

With :creator, :theme, :title and :date either an owl:ObjectProperty or owl:DataProperty.

For example:

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

How can i create an instance of this picture class ?

(I understand how i create an instance of an easy thing such as : <http://dbpedia.org/resource/Paris> rdf:type :location . would be an instance of a location)

4

1 回答 1

1

If you want to describe the class which may contain properties :creator, :theme, :title, and :date you should just describe the domain for all properties (no additional definitions in picture class are necessary):

:picture a owl:Class .

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

And so on.

If you want to describe the class which must contain these properties, cardinality constraints should be added:

: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 ...

In both cases the definition of an instance looks like following:

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

More about restriction you can learn, for example, from this document.

于 2012-05-25T22:59:38.267 回答