Difference between revisions of "PrF UG classes add superclass"

From Protege Wiki
Jump to: navigation, search
(Automated import of articles)
 
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
== Adding a Superclass ==
 
== Adding a Superclass ==
  
{{PrF_UG_TOC_classes}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_classes}}<div id='prf_ug'></noinclude>
  
 
Classes in {{#var:Pr}} can have more than one superclass.
 
Classes in {{#var:Pr}} can have more than one superclass.
Line 8: Line 8:
 
so by adding a superclass to a class,
 
so by adding a superclass to a class,
 
you are adding all of its slots as well.
 
you are adding all of its slots as well.
This topic covers the following:
 
 
<ul class='a'>
 
  <li><p>
 
    [[#Adding_a_Superclass_in_the_Superclasses_Pane|adding a superclass using the Superclasses pane]]
 
    </p>
 
 
  <li><p>
 
    [[#Adding_a_Superclass_Using_Drag-and-Drop|adding a superclass using drag-and-drop]]
 
    </p>
 
 
  <li><p>
 
    [[#Multiple_Superclasses_and_Inheritance|multiple superclasses and inheritance]]
 
    </p>
 
</ul>
 
  
 
<b>Note:</b> If you cannot see the <b>Superclasses</b> pane,
 
<b>Note:</b> If you cannot see the <b>Superclasses</b> pane,
 
your window may be too small.
 
your window may be too small.
You can see the pane by enlarging your window or by dragging the slider bar at the bottom of the
+
You can see the pane by enlarging your window
[[PrF_UG_classes_class_browser|Class Browser]].
+
or by dragging the slider bar at the bottom
See
+
of the [[PrF_UG_classes_class_browser|Class Browser]].
[[PrF_UG_windows_small_window|Working With a Small Window]]
+
See [[PrF_UG_windows_small_window|Working With a Small Window]]
 
for more information.
 
for more information.
  
Line 45: Line 30:
 
   <li><p>
 
   <li><p>
 
     Click the <b>Add Superclass</b>
 
     Click the <b>Add Superclass</b>
     [[Image:PrF_UG_classes_class.add.gif|classes_class.add]]
+
     ([[Image:PrF_UG_classes_class.add.gif|classes_class.add]]) button
     button in the
+
     in the [[PrF_UG_classes_superclasses_pane|Superclasses pane]]
    [[PrF_UG_classes_superclasses_pane|Superclasses pane]]
+
     (located at the bottom left of the Classes tab,
     (located at the bottom left of the Classes Tab,
+
     below the [[PrF_UG_classes_class_browser|Class Browser]]).
     below the
 
    [[PrF_UG_classes_class_browser|Class Browser]]).
 
 
     A <b>Select Classes</b> window will appear.
 
     A <b>Select Classes</b> window will appear.
   
 
    </p><p> <div>[[Image:PrF_UG_classes_superclass_pane.png|classes_superclass_pane]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_classes_superclass_pane.png|frame|none|
 +
          Superclasses pane, "Employee" selected]]</div>
  
 
   <li><p>
 
   <li><p>
Line 63: Line 46:
 
     click the first class,
 
     click the first class,
 
     then hold down the <b>Shift</b> key and click the last class in the range.
 
     then hold down the <b>Shift</b> key and click the last class in the range.
    </p><p> <div>[[Image:PrF_UG_classes_classes_select.png|classes_classes_select]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_classes_classes_select.png|frame|none|
 +
          Select Classes window, ":THING" selected]]</div>
 
</ol>
 
</ol>
  
 
<b>Note:</b> If nothing happens when the class is dropped over a new superclass,
 
<b>Note:</b> If nothing happens when the class is dropped over a new superclass,
 
the target class is not allowed to be a superclass of the dragged class.
 
the target class is not allowed to be a superclass of the dragged class.
For example,
+
For example, descendants of the dragged class are excluded.
descendants of the dragged class are excluded.
 
  
 
=== Adding a Superclass Using Drag-and-Drop ===
 
=== Adding a Superclass Using Drag-and-Drop ===
  
To add a superclass,
+
To add a superclass, using drag-and-drop
using drag-and-drop in the
+
in the [[PrF_UG_classes_class_browser|Class Browser]]:
[[PrF_UG_classes_class_browser|Class Browser]]:
 
  
 
<ol class='a'>
 
<ol class='a'>
Line 85: Line 67:
  
 
   <li><p>
 
   <li><p>
     Hold down the mouse button and drag the subclass over the additional superclass.
+
     Hold down the mouse button
 +
    and drag the subclass over the additional superclass.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     Hold down the <b>Ctrl</b> (<b>Cmd</b>) key and release the mouse button to drop the subclass.
+
     Hold down the <b>Ctrl</b> (<b>Cmd</b>) key
 +
    and release the mouse button to drop the subclass.
 
     The system will add the new superclass to the subclass.
 
     The system will add the new superclass to the subclass.
 
     </p>
 
     </p>
 
</ol>
 
</ol>
  
<b>Note:</b> If you do not hold down the <b>Ctrl</b>
+
<b>Note:</b>
(<b>Cmd</b>)
+
If you do not hold down the <b>Ctrl</b> (<b>Cmd</b>) key
key when releasing the mouse,
+
when releasing the mouse,
 
the operation is interpreted as
 
the operation is interpreted as
 
[[PrF_UG_classes_replace_superclass|Moving a Class]].
 
[[PrF_UG_classes_replace_superclass|Moving a Class]].
Line 105: Line 89:
 
which then inherits the slots and facets of all of its superclasses.
 
which then inherits the slots and facets of all of its superclasses.
 
For example,
 
For example,
the <b>Columnist</b> class in the <b>Newspaper</b> example has two occurrences in the Class Browser:
+
the <b>Columnist</b> class in the <b>Newspaper</b> example
 +
has two occurrences in the Class Browser:
 
one with the superclass <b>Author</b>,
 
one with the superclass <b>Author</b>,
 
and one with the superclass <b>Person</b>;
 
and one with the superclass <b>Person</b>;
 
it inherits slots from both superclasses.
 
it inherits slots from both superclasses.
  
</div>
+
 
 +
<noinclude></div></noinclude>

Latest revision as of 16:21, November 13, 2008

Adding a Superclass


Protege-Frames User's Guide
Classes
Classes Tab
Class Browser
Class Buttons
Class Hierarchy Window
Class Icons
Class Menu
Class Search Bar
Superclasses Pane
Class Editor
Constraints
Template Slots Pane
Template Slot Buttons
References Window
Creating a New Class
Creating Multiple Subclasses
Deleting a Class
Displaying the Class Editor
Editing a Class
Editing Template Slots
Finding a Class
Hiding a Class
Replacing a Superclass
Adding a Superclass
Jumping to A Superclass
Removing a Superclass
Viewing Class Relations
Classes & Instances Tab
Viewing References
Glossary, Editing Help

Classes in Protege can have more than one superclass. Classes inherit the properties of every one of their superclasses, so by adding a superclass to a class, you are adding all of its slots as well.

Note: If you cannot see the Superclasses pane, your window may be too small. You can see the pane by enlarging your window or by dragging the slider bar at the bottom of the Class Browser. See Working With a Small Window for more information.

Adding a Superclass in the Superclasses Pane

To add a superclass using the Superclasses pane:

  1. Select the subclass in the Class Browser.

  2. Click the Add Superclass (classes_class.add) button in the Superclasses pane (located at the bottom left of the Classes tab, below the Class Browser). A Select Classes window will appear.

    Superclasses pane, "Employee" selected
  3. Choose the additional superclass(es) you want from the Select Classes window. To highlight multiple classes, hold down the Ctrl (Cmd) key while clicking each class. To highlight a range of classes, click the first class, then hold down the Shift key and click the last class in the range.

    Select Classes window, ":THING" selected

Note: If nothing happens when the class is dropped over a new superclass, the target class is not allowed to be a superclass of the dragged class. For example, descendants of the dragged class are excluded.

Adding a Superclass Using Drag-and-Drop

To add a superclass, using drag-and-drop in the Class Browser:

  1. Select the subclass in the Class Browser.

  2. Hold down the mouse button and drag the subclass over the additional superclass.

  3. Hold down the Ctrl (Cmd) key and release the mouse button to drop the subclass. The system will add the new superclass to the subclass.

Note: If you do not hold down the Ctrl (Cmd) key when releasing the mouse, the operation is interpreted as Moving a Class.

Multiple Superclasses and Inheritance

Adding a superclass results in more than one superclass for a class, which then inherits the slots and facets of all of its superclasses. For example, the Columnist class in the Newspaper example has two occurrences in the Class Browser: one with the superclass Author, and one with the superclass Person; it inherits slots from both superclasses.