2

Let's say we have two classes named People and Disease. These classes are related by the Object Property has.

:People :has :Disease

People has subclass (or individual) John, and Disease has subclass (or individual) Cancer.

:John a :People
:Cancer a :Disease

How can we get the relationship between these subclasses by inference?

:John :has :Cancer
scotthenninger
  • 3,613
  • 1
  • 12
  • 23
MJ Park
  • 303
  • 1
  • 10
  • Are you saying that you want to infer that John has Cancer because John is a People and People have diseases? That doesn't make sense, so it may be a good idea to be a bit clearer on what facts you have and what you want to infer. (And singular nouns are better for class names - i.e. `:Person` instead of `:People`. – scotthenninger May 11 '16 at 04:41

1 Answers1

4

Before you can get to an answer, there are a number of misconceptions you'll need to resolve.

First, subclass and individual are very different concepts. Individuals (instances) are members of classes. Subclass denotes a class is a subset of another class, meaning that an implication (via inference) is that all members of a subclass are members of the (super)class. (Just for reference: there is no concept of inheritance in OWL.)

Second class-level properties, such as :People :has :Disease have no meaning for class individuals. The way to define a property's relationships to classes is to set the domain and range of the property. (Just using :has as a property name indicates a wide set of misconceptions, possibly from other types of languages.) So I'd suggest the name :hasDisease and the assertions:

:hasDisease rdfs:domain :People .
:hasDisease rdfs:range :Disease .

Third, you can assert that :John :hasDisease :Cancer and infer that John has a disease, given that :Cancer is a subclass of :Disease. This requires a standard RDFS reasoner. Also, given the domain and range definitions above, and an assertion :Joy :hasDisease :Gout, an RDFS reasoner will infer that :Joy a :Person and :Gout a :Disease.

There are a few OWL primers out there that you can find via Google. I'd suggest going over some of these to get a basic understanding of how OWL and reasoning profiles work.

scotthenninger
  • 3,613
  • 1
  • 12
  • 23
  • Thanks for your suggestion. I read [this primer](https://www.w3.org/TR/owl2-primer/), and I wonder if my understanding is right: The primer says, technically, the subclass relationship between classes is transitive. That is, let's say a class `person` has the property of `hasTwoLegs`, then its subclass `John` also has the same property relationship. However, If `John` is an individual, then it doesn't have the property `hasTwoLegs`. Why? shouldn't it have the property because it is a MEMBER of the class `person`? and I wonder if there's any way to get this inference result. – MJ Park May 11 '16 at 04:22
  • 2
    Yes, the subclass relationship is transitive. But the only meaning for subclass in RDFS is class membership. A member of a subclass is a member of the class. Nothing else. Hence properties are not "inherited" by the instances or subclasses. Again, properties are related to classes via domain and range with the aforementioned implications. Nothing else. It's confusing, as it does not use OO principles. Think of an OWL class as a set, and that may be a better principle to start with. Also, an "individual" is a member of a class (aka an "instance"). – scotthenninger May 11 '16 at 04:37