Changing the Metaclass of Subclasses

Note: Before you create and use metaclasses, you should be confident with the basic Protégé interface and be comfortable designing a project, and creating and modifying classes, slots, forms and instances.

When you change the metaclass of a class, all of its subclasses will retain their previous metaclass. This ensures that you do not propagate changes when you do not want to. However, often you will want existing subclasses to have the same metaclass as their parents. Protégé provides an option to quickly change the metaclasses of all the classes subordinate to a given class. Note that you only have to do this once; by default, new classes use the metaclass of their direct superclass.

You can only change the metaclasses to match the metaclass of the selected class. If the selected class has :STANDARD-CLASS as its metaclass, all subclasses will lose any additional metaclass information.

To do work with metaclasses, you must have added one or more metaclasses to your project, either by creating them directly, or by including a project that already has metaclasses. This example uses the wines project, which includes a Wine template that supplies metaclass structure. 

To change the metaclass of all existing subclasses of a given class:

  1. In the Class Relationship Pane, find the class whose sublcasses you want to change. 
  2. Click the right mouse button and select "Change metaclass of subclasses." 
  3. A dialog box pops up for verification. Click OK to continue.
     
  4. The change is made and all subordinate classes now have the metaclass of the selected class.

Next: The Classes & Instances Tab

Classes Table of Contents