Superclass-Subclass Inheritance

NPCL provides limited support for inheritance from one type to another.

The rules for constraint inheritance are as follows:

  1. A type inherits constraints from all superclasses of the same meta-type. A Topic Type inherits only from superclasses which are also Topic Types, an Occurrence Type inherits only from Occurrence Types and so on.

    It is allowed for a type to have topics of different meta-types in its set of superclasses, they are just ignored for the purposes of determining inheritance.

  2. Only constraints are inherited. Other aspects such as facets and extension values (described later) are not inherited.

    Note

    The most important effect of this rule is that datatype, Minimum Value, Maximum Value and Value Pattern facets are not inherited by Occurrence Types - you must always express these facets directly on each subclass type.

  3. If multiple superclasses define the same constraint, the type will inherit a constraint with cardinality facets that satisfy all superclass definitions of the constraint. In other words, the minimum cardinality will be the highest value defined by any superclass, and the maximum cardinality will be the lowest value defined by any superclass. If the result is that the maximum cardinality drops below the minimum cardinality, this is reported as an error.

Abstract Types

To support the creation of flexible type hierarchies, NPCL supports the concept of topics that are not Topic Types, Occurrence Types, Role Types or Association Types appearing in the type hierarchy. These topics are referred to as "Abstract Types". Abstract Types can be useful if you have a large, complex type hierarchy but want to limit which types can be created by users. . An abstract type is simply a topic that participates in the class hierarchy of an ontology, but is not itself one of the specific meta-types.

Note

An Abstract Type cannot participate in the definition of any constraints and does not have any facets. If you want to use a type in the type hierarchy to define a common set of constraints that are to be inherited by subclasses, create the type as an instance of one of the meta-types and set the Is Abstract Facet on that type to "true" to prevent users from creating instances of the type.