Is-a
In knowledge representation, ontology components and ontology engineering, including for object-oriented programming and design, is-a is a subsumptive relationship between abstractions, wherein one class A is a subclass of another class B.
In other words, type A is a subtype of type B when A's specification implies B's specification. That is, any object that satisfies A's specification also satisfies B's specification, because B's specification is weaker.
For example, a cat 'is a' animal, but not vice versa. All cats are animals, but not all animals are cats.
Behaviour that is relevant to all animals is defined on an animal class, whereas behaviour that is relevant only for cats is defined in a cat class. By defining the cat class as 'extending' the animal class, all cats 'inherit' the behaviour defined for animals, without the need to explicitly code that behaviour for cats.
Related concepts
The is-a relationship is to be contrasted with the has-a relationship between types ; confusing the relations has-a and is-a is a common error when designing a model of the real-world relationship between an object and its subordinate. The is-a relationship may also be contrasted with the instance-of relationship between objects and types : see Type–token distinction.To summarize the relations, there are:
- hyperonym–hyponym relations between types defining a taxonomic hierarchy, where
- * for a subsumption relation: a hyponym has a type-of relationship with its hyperonym ;
- holonym–meronym relations between types defining a possessive hierarchy, where
- * for an aggregation relation:
- ** a holonym has a has-a relationship with its meronym,
- * for a composition relation:
- ** a meronym has a part-of relationship with its holonym,
- * for a containment relation:
- ** a meronym has a member-of relationship with its holonym ;
- concept–object relations between types and objects, where
- * a token has an instance-of relationship with its type.