Reputation: 3674
How do I create a defined class using an annotation property in an OWL ontology?
Currently, I have created a defined class by using an object property hasSubject.
The defined class:
I would prefer to create this class by re-using the annotation 'Subject' from the DC-Terms set instead of a custom object property.
Is it possible to create a defined class with an annotation property? How would I do that in Protégé?
Upvotes: 3
Views: 3949
Reputation: 85843
You can't use annotation properties in OWL class restrictions. You can use object properties and datatype properties, but not annotation properties. In particular, the abstract syntax for an existential restriction like
isSubjectOf some Film
is, from 8.2.1 Existenial Quantification:
ObjectSomeValuesFrom
:= 'ObjectSomeValuesFrom'
'('
ObjectPropertyExpression ClassExpression')'
You won't have an ObjectPropertyExpression when you're working with an annotation property.
What you can do, however, is declare dcterms:subject as an object property in your ontology, and then you'll be able to use it. According to the documentation on dcterms:subject, the IRI is http://purl.org/dc/terms/subject. You'd declare that in Protege like any other object property:
Then you can use it in class expressions:
Do note that the documentation for dcterms:subject says:
Note: This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration.
That means that that you're actually saying something a bit more restrictive. By declaring dcterms:subject as an object property, you'll be able to infer that whenever "X dcterms:subject Y", both X and Y are instances of owl:Thing, as well as whatever else you might say about the domain and range of the property. Since other people might not use dcterms:subject as an object property, they might not expect those inferences.
Here's what the ontology ends up as:
@prefix : <http://stackoverflow.com/q/29317444/1281433/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://stackoverflow.com/q/29317444/1281433/> .
<http://stackoverflow.com/q/29317444/1281433/> rdf:type owl:Ontology .
#################################################################
#
# Object Properties
#
#################################################################
### http://purl.org/dc/terms/subject
<http://purl.org/dc/terms/subject> rdf:type owl:ObjectProperty .
#################################################################
#
# Classes
#
#################################################################
### http://stackoverflow.com/q/29317444/1281433/FilmSubjectComposer
:FilmSubjectComposer rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Class ;
owl:intersectionOf ( <http://stackoverflow.com/q/29317444/1281433/#Composer>
[ rdf:type owl:Restriction ;
owl:onProperty [ owl:inverseOf <http://purl.org/dc/terms/subject>
] ;
owl:someValuesFrom <http://stackoverflow.com/q/29317444/1281433/#Film>
]
)
] .
### http://stackoverflow.com/q/29317444/1281433/#Composer
<http://stackoverflow.com/q/29317444/1281433/#Composer> rdf:type owl:Class .
### http://stackoverflow.com/q/29317444/1281433/#Film
<http://stackoverflow.com/q/29317444/1281433/#Film> rdf:type owl:Class .
### Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net
Upvotes: 6