I do not think that you can express this in your current class hierarchy using OWL alone. If I understand correctly, you already have the axioms
John watches YouTube
YouTube a InternetChannel
InternetChannel availableOn only AdvancedTV
AdvancedTV inverse owns only RichPerson
but cannot infer the intermediate inference John a (owns some AdvancedTV)
that would let you conclude that John a RichPerson
.
If you had the additional axiom “if some person P watches some channel C, then P owns some television T and C is available on T,” then the reasoning would work as follows: “Since John watches YouTube, John would have to own some television on which YouTube is available. Since YouTube is an internet channel, the television would have to be an advanced television. Since John would then own an advanced television, he would be a rich person.”
The limitation in OWL
However, I do not think that that axiom can be expressed in OWL. Descriptions logics (of which OWL is one) are a subset of first-order logic, and can only express first-order sentences that use only two variables. The axiom above seems to require three:
- ∀ p, c: watches(p,c) → (∃ t: owns(p,t) ∧ availableOn(c,t))
I have not been able to rewrite that in such a way that it uses only two variables, so I do not think that it can be expressed in OWL. That means that you will need to change something in your ontology to make this work. As I see it, there are a few options:
- You could turn your channel class hierarchy and introduce some individuals to represent channel types.
- Instead of using a watches relationship that only related persons and channels, you could use a three place relation watchesOn that relates a person, the channel that they watch, and the television on which they watch the channel.
The first option might be a bit quicker to implement, but I think that the second option is a bit more flexible in the long run, better represents the information at hand, and makes for a cleaner overall representation.
Representing Channel Types with Individuals
If you changed the channel subclass hierarchy into a collection of channel types, e.g., instead of YouTube a InternetChannel
, you were to say YouTube hasChannelType Internet
, then you say things like
watches some (hasChannelType value Internet) SubClassOf owns some AdvancedTV
which says that “if someone watches something that has channel type internet, then that someone owns an advanced television.” Since John watches YouTube, and YouTube has channel type Internet, then John owns an advanced television. Since advanced televisions are owned only by rich people, John must be a rich person.
That axiom is a general class axiom. It does not have a simple class name on the left hand side, but rather a class expression. These do not come up all that often, but as discussed in Being complex on the left-hand-side: General Concept Inclusion, they are very useful on occasion.
That article provides an example of creating them in Protégé, as well. To enter a general class axiom in Protégé, go to the Active Ontology tab, and find the General class axioms tab within it. Then you can enter the axiom verbatim, and it should look like this:
Changing watches to watchesOn
Alternatively, you can replace the binary relation watches with a 3-place relation watchesOn which would associate a person with with the channel that they watch and the television on which they watch it. This has the nice advantage that in the case where an individual owns multiple televisions, some can still be primitive while others are advanced. (The first solution just says that if someone watches an internet channel, then they own an advanced television, but it doesn't capture the fact that the person uses that television to watch the internet channel.) To replace the binary relation watches(Person,Channel) with the tertiary watchesOn(Person,Channel,Television) we follow the approach given in the W3C Working Group Note, Defining N-ary Relations on the Semantic Web. We introduce a class (not a property) watchesOn, each of whose instances represents an occurrence of the watchesOn relationship, and three properties, hasWatcher, hasWatchedChannel, hasWatchedTelevision which relate instance of watchesOn with the person, channel, and television, respectively, that are involved in the relationship. Instances of watchesOn will often be blank nodes. For instance, watchesOn(John,YouTube,JohnsTelevision) can be represented in RDF as:
[] a :watchesOn ;
:hasWatcher :John ;
:hasWatchedChannel :YouTube ;
:hasWatchedTelevision :JohnsTelevision .
With this kind of representation, we can state lots of useful facts. For instance, to say that if a person watches something on a television, then they own that television, we assert:
inverse(hasWatcher) o hasWatchedTelevision SubPropertyOf owns
This is like saying
hasWatcher(?w,?person) ∧ hasWatchedTelevision(?w,?television) → owns(?person,?television) .
You can also say that televisions on which internet channels are watched are advanced televisions. This requires a general class axiom, as in the first solution, but in this case, it is:
inverse (hasWatchedTelevision) some (hasWatchedChannel some InternetChannel) SubClassOf AdvancedTV
which is like saying
hasWatchedTelevision(?w,?television) ∧ hasWatchedChannel(?w,?channel) ∧ InternetChannel(?channel) → AdvancedTV(?television) .
With both of those axioms in place, we can infer that John owns JohnsTelevision
and that JohnsTelevision a AdvancedTV
. If we add one more class axiom, namely that if a person owns an advanced television, then they are rich, i.e.,
owns some AdvancedTV SubClassOf RichPerson
then we can infer that John a RichPerson
.
This kind of representation is nice in that using restrictions, we can assert, for instance, that John watches YouTube on some television, without stating which television he watches it on. This requires adding a type assertion to John, namely:
John a inverse hasWatcher some (hasWatchedChannel value YouTube and
hasWatchedTelevision some Television)
This says that John watches YouTube on some television, but does not say which television. By our earlier axioms, the reasoner can still infer that whatever television it happens to be, it must be an advanced television, and John must own it. The reasoner can then still infer that John is a rich person.
This works even one step farther. We do not even need to specify which channel John watched, but just that it is an internet channel:
John a inverse hasWatcher some (hasWatchedChannel some InternetChannel and
hasWatchedTelevision some Television)
and the reasoner can still infer that John is rich person. To top things off, the class expression
inverse hasWatcher some (hasWatchedChannel some InternetChannel and
hasWatchedTelevision some Television)
consists of those individuals that watch some internet channel on some television. The reasoner can tell us that this class expression is a subclass of RichPerson
, which means that these kinds of inferences work not just for John
, but anything in this class: