I have a confusion about OWL class and subclass property inheritance. Some posts are saying there is no inheritance in OWL (OWL: How to get inheritance of property relations between two classes from those of superclasses?, http://answers.semanticweb.com/questions/619/rdfs-owl-inheritance-with-josekipellet). However, I have found some opposite discussion as well. For example "A Semantic Web Primer for Object-Oriented Software Developers" page (https://www.w3.org/TR/sw-oosd-primer/) mentioned that for both object-oriented language, OWL & RDF: "Classes can be arranged in a subclass hierarchy with inheritance" (section 3.3). https://www.w3.org/TR/rdf-schema/#ch_subclassof mentioned that "The property rdfs:subClassOf is an instance of rdf:Property that is used to state that all the instances of one class are instances of another." Hence, it is confusing to me. Now I have following questions:
If not then
Consider following example. Are all the properties of "Lecturer" and "Student" will be available to "Person" class?
Example:
--------
### Classes ###
:CSModule rdf:type owl:Class ;
rdfs:subClassOf :Module .
:Lecturer rdf:type owl:Class ;
rdfs:subClassOf :Person .
:Student rdf:type owl:Class ;
rdfs:subClassOf :Person .
:Module rdf:type owl:Class .
:Person rdf:type owl:Class .
### Object Properties ###
:studies rdf:type owl:ObjectProperty ;
rdfs:domain :Student ;
rdfs:range :Module .
:teaches rdf:type owl:ObjectProperty ;
rdfs:domain :Lecturer ;
rdfs:range :Module .
### Data properties ###
:name rdf:type owl:DatatypeProperty ;
rdfs:domain :Person ;
rdfs:range xsd:string .
:staffID rdf:type owl:DatatypeProperty ;
rdfs:domain :Lecturer ;
rdfs:range xsd:integer .
:studentID rdf:type owl:DatatypeProperty ;
rdfs:domain :Student ;
rdfs:range xsd:integer .
### Individuals ###
:CS101 rdf:type owl:NamedIndividual ,
:CSModule .
:Lecturer1 rdf:type owl:NamedIndividual ,
:Lecturer ;
:teaches :CS101 ;
:name "Dr.John" ;
:staffID 7777 .
:Student1 rdf:type owl:NamedIndividual ,
:Student ;
:studies :CS101 ;
:name "James" ;
:studentID 1234 .
If someone provide me an answer with a good example that will be very helpful. Thank you in advance.
NOTE: owl:Class is defined as a subclass of rdfs:Class . The rationale for having a separate OWL class construct lies in the restrictions on OWL DL (and thus also on OWL Lite), which imply that not all RDFS classes are legal OWL DL classes.
owl:Thing is about what your are trying to represent and model. It's the concept that seats in the top of all other concepts and it has to be present on the top by definition.
The class whose properties and methods are inherited is known as the Parent class. And the class that inherits the properties from the parent class is the Child class.
Like object-oriented language, is rdfs:subclassOf inherits property from super class?
To say that the domain of property p is the class D means that when you have a triple
x p y
you can infer the triple
x rdf:type D
There's no notion of inheritance of a property. If you know that E is a subclass of D, and you see the triples
e p y
e rdf:type E
E rdfs:subClassOf D
you now have two ways to know that e rdf:type D. The first is because e p y implies e rdf:type D. The second is because you know that e is an E and E is a subclass of D, e is also a D.
What is the meaning of inheritance in RDF/OWL?
Classes in RDF and OWL are sets. When you know that E is a subclass of D, it means that every element of E is an element of D; that is, the set of individuals of E is a subset of the set of individuals of D.
Similarly for properties. If q is a subproperty of p, it means that x q y implies x p y.
Is it possible to construct object-oriented language type class-subclass inheritance with OWL/RDF?
It's not really clear what you mean here. You'd need to specify exactly what you mean by OO-langueg type class-subclass inheritance. You get a lot of the same behaviors. E.g., if you know that every instance of D has a particular, then you know that every instance of E does, too, by virtue of the fact that every instance of E is an instance of D. E.g., if you have
D SubClassOf (hasColor some Color)
then you can infer that
E SubClassOf (hasColor some Color)
so in that sense there's inheritance.
Consider following example. Are all the properties of "Lecturer" and "Student" will be available to "Person" class?
"Available" might be misleading. There's no sense in which properties are available or not available to a class (i.e., to the individuals in a class). If you have a hierarchy like:
Lecturer rdfs:subClassOf Person
teachesCourse rdfs:domain Lecturer
teachesCourse rdfs:range Course
that means that when you see a triple
Jones teachesCourse Calculus
you can infer that
Jones rdf:type Lecturer
Jones rdf:type Person
Calculus rdf:type Course
The property teachesCourse is "available" to every Person, in a sense, but as soon as it is used, it means that that Person must be a Lecturer. That's really pretty similar to what you'd have in an object oriented programming language, isn't it? E.g., if you have in Java:
class Person { }
class Lecturer {
Course[] getCourses() { /* ... */ }
}
then there can be instances of Person that have a getCourses() method. It just happens that those instances of Person must be instances of Lecturer, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With