5

Is it possible in protege (Thus in owl) to describe a class depending if it has some properties?

For example

I have a class Home, and I want to say that every instance that has property1 and property2 and property2 is considered an instance of that class?

Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253

1 Answers1

18

Suppose you have a class Duck and you want to say that if something walks like a Duck, and talks like a Duck, then it is a Duck. You can do that with a class axiom:

        ((walksLike some Duck) and (talksLike some Duck)) SubClassOf Duck

A subclass axiom like this, where the left hand side is not just a class name, but is a complex class expression, is called a General Class Axiom. You can enter these in Protégé, under the Active Ontology tab:

General Class Axiom in Protege

For more about general class axioms, you may find Being complex on the left-hand-side: General Concept Inclusions useful.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Many thanks but I was looking for something different. First, I do have a name for this class, for example, but in your case, the class doesn't have a name. Second, i don't know the value of the relationship (property), and I don't care about the value, I just care that the instance does really have that property and that is enough for me, could you help please? – Marco Dinatsoli Apr 19 '15 at 09:48
  • 1
    If you have a name for your class then you can reverse the axiom described by Joshua: `YourClassName SubClassOf (talksLike some Duck)`; if the type of the filler is not important, i.e., you don't care those are Ducks, you can use Thing instead. `YourClassName SubClassOf (talksLike some Thing)`; – Ignazio Apr 19 '15 at 10:36
  • 1
    @MarcoDinatsoli Which of the following are you trying to say: (i) "**IF** something has values for properties P1 and P2, **THEN** it is an instance of C."; or (ii) "**IF** something is an instance of C, **THEN** is has values for properties P1 and P2"? – Joshua Taylor Apr 19 '15 at 11:12
  • @JoshuaTaylor the first one, but in more presice words, i am trying to define a class, with all his instances has value (random value) for two properties, and i know the class name. (note, i can use equevlent, but in the assignment, i can't use direct subclass of ) – Marco Dinatsoli Apr 19 '15 at 22:55
  • @MarcoDinatsoli Well, if you only want one direction ("if A then B", but not "if B then A"), you need a subclass relationship. An equivalent class relationship will always give you both directions. The "some" restriction doesn't specify a particular value, just that there is some value from a particular class. E.g., (Human subClassOf (hasMother some Human)) doesn't specify anyone's particular mother, but just says that every Human has a Human mother. Anyhow, instead of (walksLike some Duck) you can say (walksLike some Thing), since all individuals are Things, or (walksLike min 1). – Joshua Taylor Apr 20 '15 at 00:30
  • @JoshuaTaylor I tried your suggestion as this `and (hasGarden min 1 ) and (hasSwimmingPool value true)` where hasGarden has a range boolean, and I got error in the protege, i couldn't click okay until i change it to `and (hasGarden min 1 boolean ) and (hasSwimmingPool value true)` is that correct please? – Marco Dinatsoli Apr 20 '15 at 12:38
  • @Marco Ah, I thought you were using object properties; yes, for datatype properties you might have to specify the datatype there. But `(hasSwimmingPool value true)` says that the actual value for "hasSwimmingPool" will be true, not just that there is a value for "hasSwimmingPool". Earlier you said **I don't know the value of the relationship (property), and I don't care about the value, I just care that the instance does really have that property**, so it should probably be (hasSwimmingPool some boolean) or (hasSwimmingPool min 1 boolean) [those are equivalent]. – Joshua Taylor Apr 20 '15 at 13:32