Difference between revisions of "PrF UG meta create class use meta"

From Protege Wiki
Jump to: navigation, search
(Automated import of articles)
 
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
== Creating a Class Using a Metaclass ==
 
== Creating a Class Using a Metaclass ==
  
{{PrF_UG_TOC_meta}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_meta}}<div id='prf_ug'></noinclude>
  
 
If you have non-standard metaclasses in your project,
 
If you have non-standard metaclasses in your project,
 
you can select the metaclass you want to use when you create a class.
 
you can select the metaclass you want to use when you create a class.
You can add metaclasses either by
+
You can add metaclasses either
[[PrF_UG_meta_metaclass_create|creating]]
+
by [[PrF_UG_meta_metaclass_create|creating]] them directly,
them directly,
+
or by [[PrF_UG_projects_including_a_project|including]]
or by
 
[[PrF_UG_projects_including_a_project|including]]
 
 
a project that already has metaclasses.
 
a project that already has metaclasses.
  
By default,
+
By default, when you create a class using the <b>Create Class</b>
when you create a class using the <b>Create Class</b>
+
([[Image:PrF_UG_classes_class.create.gif|classes_class.create]]) button,
<div>[[Image:PrF_UG_classes_class.create.gif|classes_class.create]]</div>
 
button,
 
 
you use the metaclass of the direct superclass as the metaclass for the new class.
 
you use the metaclass of the direct superclass as the metaclass for the new class.
(Unless you have made changes,
+
(Unless you have made changes, this is the default <b>:STANDARD-CLASS</b>.)
this is the default <b>:STANDARD-CLASS</b>.)
 
 
If you have used a non-standard metaclass for a class,
 
If you have used a non-standard metaclass for a class,
 
every new subclass you create for the class will also use the selected metaclass.
 
every new subclass you create for the class will also use the selected metaclass.
Line 29: Line 24:
 
<ol class='a'>
 
<ol class='a'>
 
   <li><p>
 
   <li><p>
     In the
+
     In the [[PrF_UG_classes_class_window|Class Browser]],
    [[PrF_UG_classes_class_window|Class Browser]],
 
 
     select the class that you want as the superclass of the new class.
 
     select the class that you want as the superclass of the new class.
   
 
    </p><p> <div>[[Image:PrF_UG_meta_select_superclass.png|metaclasses_select_superclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_select_superclass.png|frame|none|
 +
          Class Browser, "White wine" selected]]</div>
  
 
   <li><p>
 
   <li><p>
 
     Click the right mouse button and select "Create subclass using metaclass..."
 
     Click the right mouse button and select "Create subclass using metaclass..."
   
 
    </p><p> <div>[[Image:PrF_UG_meta_menu_create_using_metaclass.png|metaclasses_menu_create_using_metaclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_menu_create_using_metaclass.png|frame|none|
 +
          "Create subclass using ..." selected in menu]]</div>
  
 
   <li><p>
 
   <li><p>
Line 46: Line 40:
 
     which are the classes you can use when creating a class.
 
     which are the classes you can use when creating a class.
 
     You cannot create a class as an instance of an Abstract metaclass.
 
     You cannot create a class as an instance of an Abstract metaclass.
   
 
    </p><p> <div>[[Image:PrF_UG_meta_select_metaclass.png|metaclasses_select_metaclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_select_metaclass.png|frame|none|
 +
          Select Metaclass dialog, "Wine template" selected]</div>
  
 
   <li><p>
 
   <li><p>
Line 57: Line 51:
 
     In the <b>Wineries</b> example,
 
     In the <b>Wineries</b> example,
 
     there is an extra entry field called Best Wineries,
 
     there is an extra entry field called Best Wineries,
     displayed below the Template Slots Pane in the Class Editor.
+
     displayed below the Template Slots pane in the Class Editor.
 
     The name of the metaclass you used will be displayed at the top of the Class Editor,
 
     The name of the metaclass you used will be displayed at the top of the Class Editor,
 
     immediately after the name of the class.
 
     immediately after the name of the class.
    </p><p> <div>[[Image:PrF_UG_meta_create_class_with_metaclass.png|metaclasses_create_class_with_metaclass]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_meta_create_class_with_metaclass.png|frame|none|
 +
          Class Browser, "wines_Class_2" selected]]</div>
  
 
   <li><p>
 
   <li><p>
     Use the
+
     Use the [[PrF_UG_classes_class_editor|Class Editor]]
    [[PrF_UG_classes_class_editor|Class Editor]]
+
     to name the class, choose its role, create constraints, and create and edit slots.
     to name the class,
 
    choose its role,
 
    create constraints,
 
    and create and edit slots.
 
 
     </p>
 
     </p>
 
</ol>
 
</ol>
  
  
</div>
+
<noinclude></div></noinclude>

Latest revision as of 18:24, November 13, 2008

Creating a Class Using a Metaclass


Protege-Frames User's Guide
Metaclasses
Understanding Metaclasses
Example: Creating and Using a Metaclass
Looking at :STANDARD- CLASS
Creating a Metaclass
Creating a Class Using a Metaclass
Changing the Metaclass of a Class
Changing the Metaclass of Subclasses
Setting the Default Metaclass
Customizing the Class or Slot Editor
Understanding Slot Metaclasses
Creating a Slot Metaclass
Changing the Slot Metaclass of a Slot
Creating a Subslot Using a Slot Metaclass
Changing the Slot Metaclass of Subslots
Setting the Default Slot Metaclass
Glossary, Editing Help

If you have non-standard metaclasses in your project, you can select the metaclass you want to use when you create a class. You can add metaclasses either by creating them directly, or by including a project that already has metaclasses.

By default, when you create a class using the Create Class (classes_class.create) button, you use the metaclass of the direct superclass as the metaclass for the new class. (Unless you have made changes, this is the default :STANDARD-CLASS.) If you have used a non-standard metaclass for a class, every new subclass you create for the class will also use the selected metaclass. When you create a class using a non-standard metaclass, the class is given the attributes specified by the selected metaclass.

To create a class using a specified metaclass:

  1. In the Class Browser, select the class that you want as the superclass of the new class.

    Class Browser, "White wine" selected
  2. Click the right mouse button and select "Create subclass using metaclass..."

    "Create subclass using ..." selected in menu
  3. A dialog box will display the Concrete metaclasses, which are the classes you can use when creating a class. You cannot create a class as an instance of an Abstract metaclass.

    [[Image:PrF_UG_meta_select_metaclass.png|frame|none| Select Metaclass dialog, "Wine template" selected]
  4. Select the metaclass that has the properties that you want and click OK. The new class will be added under the highlighted class. It will have the Class Editor from the selected metaclass, with entry fields determined by the template slots of the metaclass. In the Wineries example, there is an extra entry field called Best Wineries, displayed below the Template Slots pane in the Class Editor. The name of the metaclass you used will be displayed at the top of the Class Editor, immediately after the name of the class.

    Class Browser, "wines_Class_2" selected
  5. Use the Class Editor to name the class, choose its role, create constraints, and create and edit slots.