Difference between revisions of "PrF UG slots make inverse slot"

From Protege Wiki
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
== Creating an Inverse Slot Relationship ==
 
== Creating an Inverse Slot Relationship ==
  
{{PrF_UG_TOC_slots}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_slots}}<div id='prf_ug'></noinclude>
  
The Inverse Slots widget on the Slot Editor allows you to create an inverse relationship between two slots of type Class or Instance.
+
The Inverse Slots widget on the Slot Editor allows you to create an inverse relationship
 +
between two slots of type Class or Instance.
  
 
<ul class='a'>
 
<ul class='a'>
Line 22: Line 23:
 
For an inverse relationship to work correctly,
 
For an inverse relationship to work correctly,
 
your two slots and the classes where they appear must be designed appropriately.
 
your two slots and the classes where they appear must be designed appropriately.
For slots of type Instance,
+
For slots of type Instance, the following situation provides optimal results:
the following situation provides optimal results:
 
  
 
<ul class='a'>
 
<ul class='a'>
 
   <li><p>
 
   <li><p>
     All classes where the first slot is attached (i.e.,
+
     All classes where the first slot is attached
    the domain of the slot) appear in the
+
    (i.e., the domain of the slot) appear
    [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|Allowed Classes]]
+
    in the [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|
    pane for the second slot.
+
            Allowed Classes]] pane for the second slot.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     All classes where the second slot is attached appear in the
+
     All classes where the second slot is attached appear
    [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|Allowed Classes]]
+
    in the [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|
    pane for the first slot.
+
            Allowed Classes]] pane for the first slot.
 
     </p>
 
     </p>
 
</ul>
 
</ul>
  
However,
+
However, depending on the structure of your knowledge base,
depending on the structure of your knowledge base,
 
 
this may not be appropriate or feasible.
 
this may not be appropriate or feasible.
 
Other situations are also valid.
 
Other situations are also valid.
For example,
+
For example, suppose slots A and B are inverse slots.
suppose slots A and B are inverse slots.
 
 
If one of the allowed classes for slot A does not have B as one of its attached slots,
 
If one of the allowed classes for slot A does not have B as one of its attached slots,
 
all that happens is that inverse slot value does not get created for those instances.
 
all that happens is that inverse slot value does not get created for those instances.
The inverse relationship will still work normally for those allowed classes that <i>do</i> have slot B attached.
+
The inverse relationship will still work normally for those allowed classes
 +
that <i>do</i> have slot B attached.
  
 
A slot can have at most one inverse slot.
 
A slot can have at most one inverse slot.
 
For more information on designing an inverse slot relationship,
 
For more information on designing an inverse slot relationship,
see
+
see [[PrF_UG_slots_inverse_slots|Understanding Inverse Slots]].
[[PrF_UG_slots_inverse_slots|Understanding Inverse Slots]].
 
  
 
Note that if you create an inverse slot relationship after instances have been created,
 
Note that if you create an inverse slot relationship after instances have been created,
Line 66: Line 64:
 
<ol class='a'>
 
<ol class='a'>
 
   <li><p>
 
   <li><p>
     Open the
+
     Open the [[PrF_UG_slots_slot_editor|Slot Editor]]
    [[PrF_UG_slots_slot_editor|Slot Editor]]
 
 
     for one of the two slots;
 
     for one of the two slots;
 
     it does not matter which one you choose.
 
     it does not matter which one you choose.
     You can open the Slot Editor from the
+
     You can open the Slot Editor
    [[PrF_UG_classes_classes_tab|Classes Tab]]
+
    from the [[PrF_UG_classes_classes_tab|Classes tab]]
     or the
+
     or the [[PrF_UG_slots_slots_tab|Slots tab]].
    [[PrF_UG_slots_slots_tab|Slots Tab]].
 
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
 
     Click the <b>Add Slot</b>
 
     Click the <b>Add Slot</b>
     <div>[[Image:PrF_UG_slots_slot.add.gif|slots_slot.add]]</div>
+
     ([[Image:PrF_UG_slots_slot.add.gif|slots_slot.add]]) button
     button at the right of the Inverse Slot field.
+
     at the right of the Inverse Slot field.
     [[Image:PrF_UG_slots_inverse_slot_bar.png|slots_inverse_slot_bar]]
+
     </p>
     <b>Note:</b> If the button is grayed out,
+
    <div>[[Image:PrF_UG_slots_inverse_slot_bar.png|frame|none|
 +
          Inverse Slot field]]</div>
 +
    <p>
 +
     <b>Note:</b>
 +
    If the button is grayed out,
 
     you cannot create an inverse slot for the selected slot.
 
     you cannot create an inverse slot for the selected slot.
 
     Make sure that the slot is of type Class or Instance.
 
     Make sure that the slot is of type Class or Instance.
Line 89: Line 89:
 
     Select the slot you want to use from the <b>Select Slot</b> dialog box.
 
     Select the slot you want to use from the <b>Select Slot</b> dialog box.
 
     Only slots of type Class or Instance will appear.
 
     Only slots of type Class or Instance will appear.
   
 
    </p><p> <div>[[Image:PrF_UG_slots_slot_select.png|slots_slot_select]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_slots_slot_select.png|frame|none|
 +
          Select Slot dialog]]</div>
  
 
   <li><p>
 
   <li><p>
Line 99: Line 99:
 
</ol>
 
</ol>
  
You can view the Slot Editor of the second slot by double-clicking on its name in the Inverse Slot field or by using the <b>View Slot</b>
+
You can view the Slot Editor of the second slot
<div>[[Image:PrF_UG_slots_slot.view_top_level.gif|slots_slot.view_top_level]]</div>
+
by double-clicking on its name in the Inverse Slot field
button.
+
or by using the <b>View Slot</b>
 +
([[Image:PrF_UG_slots_slot.view_top_level.gif|slots_slot.view_top_level]]) button.
 
You will see that it automatically has the first slot as its inverse slot.
 
You will see that it automatically has the first slot as its inverse slot.
You may also wish to check that the Allowed Classes of each slot contains all the possible classes where the other slot will appear.
+
You may also wish to check that the Allowed Classes of each slot
 +
contains all the possible classes where the other slot will appear.
  
 
=== Creating a New Inverse Slot ===
 
=== Creating a New Inverse Slot ===
Line 111: Line 113:
 
<ol class='a'>
 
<ol class='a'>
 
   <li><p>
 
   <li><p>
     Open the
+
     Open the [[PrF_UG_slots_slot_editor|Slot Editor]]
    [[PrF_UG_slots_slot_editor|Slot Editor]]
 
 
     for the slot you want to create an inverse for.
 
     for the slot you want to create an inverse for.
     You can do this from either the Class Tab or the
+
     You can do this from either the Class tab
    [[PrF_UG_slots_slots_tab|Slots Tab]]:  
+
    or the [[PrF_UG_slots_slots_tab|Slots tab]]:  
 
     </p>
 
     </p>
  
Line 126: Line 127:
 
     <li><p>
 
     <li><p>
 
       On the Classes tab,
 
       On the Classes tab,
       double-click the slot in the list of Template Slots (or select the slot in the list of Template Slots and click the "View Top-Level Slot" button).
+
       double-click the slot in the list of Template Slots
 +
      (or select the slot in the list of Template Slots
 +
      and click the "View Top-Level Slot" button).
 
       </p>
 
       </p>
 
   </ul>
 
   </ul>
Line 132: Line 135:
 
   <li><p>
 
   <li><p>
 
     Click the <b>Create Slot</b>
 
     Click the <b>Create Slot</b>
     [[Image:PrF_UG_slots_slot.create.gif|slots_slot.create]]
+
     ([[Image:PrF_UG_slots_slot.create.gif|slots_slot.create]]) button
     button at the right of the Inverse Slot Editor.
+
     at the right of the Inverse Slot Editor.
     [[Image:PrF_UG_slots_inverse_slot_bar.png|slots_inverse_slot_bar]]<b>Note:</b> If the button is grayed out,
+
     </p>
 +
    <div>[[Image:PrF_UG_slots_inverse_slot_bar.png|frame|none|
 +
          Inverse Slot bar]]</div>
 +
    <p>
 +
    <b>Note:</b>
 +
    If the button is grayed out,
 
     you cannot create an inverse slot for the selected slot.
 
     you cannot create an inverse slot for the selected slot.
 
     Make sure it is of type Class or Instance.
 
     Make sure it is of type Class or Instance.
Line 141: Line 149:
 
   <li><p>
 
   <li><p>
 
     A new class of type Instance is created.
 
     A new class of type Instance is created.
     The
+
     The [[PrF_UG_slots_slot_editor|Slot Editor]]
    [[PrF_UG_slots_slot_editor|Slot Editor]]
 
 
     for the new slot opens automatically.
 
     for the new slot opens automatically.
   
 
    </p><p> <div>[[Image:PrF_UG_slots_inverse_slot_editor.png|slots_inverse_slot_editor]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_slots_inverse_slot_editor.png|frame|none|
 +
          inverse-of-sections dialog]]</div>
  
 
   <li><p>
 
   <li><p>
Line 153: Line 160:
  
 
   <li><p>
 
   <li><p>
     The classes where your original slot appears will be automatically entered in the
+
     The classes where your original slot appears will be automatically entered
    [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|Allowed Classes]]
+
    in the [[PrF_UG_slots_value_type_instance#Setting_the_Value_Type_to_Instance|
    field.
+
            Allowed Classes]] field.
 
     Modify this list if necessary.
 
     Modify this list if necessary.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     The classes in the Allowed Classes field of the original slot will be added to the Domain field.
+
     The classes in the Allowed Classes field of the original slot
 +
    will be added to the Domain field.
 
     Modify this list if necessary.
 
     Modify this list if necessary.
     Remember that attaching a slot to a class also attaches it to all subclasses of the class.
+
     Remember that attaching a slot to a class also attaches it
 +
    to all subclasses of the class.
 
     </p>
 
     </p>
  
Line 173: Line 182:
  
 
Removing the inverse slot relationship removes the link between the two classes.
 
Removing the inverse slot relationship removes the link between the two classes.
Note that,
+
Note that, if you remove an inverse slot relationship after instances have been created,
if you remove an inverse slot relationship after instances have been created,
 
 
existing values that were created by the inverse slot relationship are <i>not</i> removed.
 
existing values that were created by the inverse slot relationship are <i>not</i> removed.
 
Removing an inverse slot only affects the values of new instances.
 
Removing an inverse slot only affects the values of new instances.
Line 186: Line 194:
 
   <li><p>
 
   <li><p>
 
     Click the <b>Remove</b>
 
     Click the <b>Remove</b>
     [[Image:PrF_UG_slots_slot.remove.gif|slots_slot.remove]]
+
     ([[Image:PrF_UG_slots_slot.remove.gif|slots_slot.remove]]) button
     button at the right of the <b>Inverse Slot</b> field.
+
     at the right of the <b>Inverse Slot</b> field.
 
     The slot relationship will be removed.
 
     The slot relationship will be removed.
 
     </p>
 
     </p>
Line 194: Line 202:
 
=== Replacing an Inverse Slot ===
 
=== Replacing an Inverse Slot ===
  
Replacing the inverse slot relationship at a slot removes the link to the original inverse slot and makes a link with a different,
+
Replacing the inverse slot relationship at a slot removes the link to the original inverse slot
existing,
+
and makes a link with a different, existing, slot.
slot.
+
Note that, if you replace an inverse slot relationship after instances have been created,
Note that,
+
existing values that reflect the original (replaced) inverse slot relationship are retained.
if you replace an inverse slot relationship after instances have been created,
 
existing values that reflect the original
 
(replaced)
 
inverse slot relationship are retained.
 
 
Replacing an inverse slot only affects the values of new instance.
 
Replacing an inverse slot only affects the values of new instance.
 
To replace an inverse relationship:
 
To replace an inverse relationship:
Line 212: Line 216:
 
   <li><p>
 
   <li><p>
 
     Click the <b>Add Slot</b>
 
     Click the <b>Add Slot</b>
     [[Image:PrF_UG_slots_slot.add.gif|slots_slot.add]]
+
     ([[Image:PrF_UG_slots_slot.add.gif|slots_slot.add]]) button
     button at the right of the Inverse Slot field.
+
     at the right of the Inverse Slot field.
 
     </p>
 
     </p>
  
Line 223: Line 227:
 
     Click <b>OK</b>.
 
     Click <b>OK</b>.
 
     The new slot becomes the inverse slot of the current slot.
 
     The new slot becomes the inverse slot of the current slot.
     The original inverse slot is now unlinked from the slot where you made the change and no longer has an inverse slot.
+
     The original inverse slot is now unlinked from the slot
 +
    where you made the change and no longer has an inverse slot.
 
     </p>
 
     </p>
 
</ol>
 
</ol>
  
  
</div>
+
<noinclude></div></noinclude>

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

Creating an Inverse Slot Relationship


Protege-Frames User's Guide
Slots
The Slots Tab
The Slot Browser
The Slot Buttons
The Slot Menu
The Slot Editor
The Value Type Menu
The Any Value Type
The Boolean Value Type
The Class Value Type
The Float Value Type
The Instance Value Type
The Integer Value Type
The String Value Type
The Symbol Value Type
Creating a New Slot
Viewing a Slot
Editing a Top-Level Slot
Overriding Slot Properties at a Class
Editing Slot Properties
Removing a Slot from a Class
Deleting a Slot from the Project
Adding a Slot to a Class
Removing Overrides From a Slot
Understanding Inverse Slots
Creating an Inverse Slot Relationship
Working with Subslots
Finding a Slot
The Slot Hierarchy Window
The Slot Icons
The Superslots Pane
Glossary, Editing Help

The Inverse Slots widget on the Slot Editor allows you to create an inverse relationship between two slots of type Class or Instance.

  • You can create an inverse slot relationship in one of two ways: linking two existing slots and creating a new slot as the inverse of an existing slot

  • You can also modify inverse slot relationships, removing the inverse slot link between two slots or replacing an inverse slot with another slot.

For an inverse relationship to work correctly, your two slots and the classes where they appear must be designed appropriately. For slots of type Instance, the following situation provides optimal results:

  • All classes where the first slot is attached (i.e., the domain of the slot) appear in the Allowed Classes pane for the second slot.

  • All classes where the second slot is attached appear in the Allowed Classes pane for the first slot.

However, depending on the structure of your knowledge base, this may not be appropriate or feasible. Other situations are also valid. For example, suppose slots A and B are inverse slots. If one of the allowed classes for slot A does not have B as one of its attached slots, all that happens is that inverse slot value does not get created for those instances. The inverse relationship will still work normally for those allowed classes that do have slot B attached.

A slot can have at most one inverse slot. For more information on designing an inverse slot relationship, see Understanding Inverse Slots.

Note that if you create an inverse slot relationship after instances have been created, existing instances will not display the inverse slot information.

Linking Two Existing Slots

To create an inverse slot relationship between two existing slots, the slots you choose must be of value type Class or Instance. To create the relationship:

  1. Open the Slot Editor for one of the two slots; it does not matter which one you choose. You can open the Slot Editor from the Classes tab or the Slots tab.

  2. Click the Add Slot (slots_slot.add) button at the right of the Inverse Slot field.

    Inverse Slot field

    Note: If the button is grayed out, you cannot create an inverse slot for the selected slot. Make sure that the slot is of type Class or Instance.

  3. Select the slot you want to use from the Select Slot dialog box. Only slots of type Class or Instance will appear.

    Select Slot dialog
  4. Click OK. The two slots will now be inverses of each other.

You can view the Slot Editor of the second slot by double-clicking on its name in the Inverse Slot field or by using the View Slot (slots_slot.view_top_level) button. You will see that it automatically has the first slot as its inverse slot. You may also wish to check that the Allowed Classes of each slot contains all the possible classes where the other slot will appear.

Creating a New Inverse Slot

To create a new slot and make it the inverse of a slot:

  1. Open the Slot Editor for the slot you want to create an inverse for. You can do this from either the Class tab or the Slots tab:

    • On the Slots tab, select the slot from the list of slots in the Slot Browser pane.

    • On the Classes tab, double-click the slot in the list of Template Slots (or select the slot in the list of Template Slots and click the "View Top-Level Slot" button).

  2. Click the Create Slot (slots_slot.create) button at the right of the Inverse Slot Editor.

    Inverse Slot bar

    Note: If the button is grayed out, you cannot create an inverse slot for the selected slot. Make sure it is of type Class or Instance.

  3. A new class of type Instance is created. The Slot Editor for the new slot opens automatically.

    inverse-of-sections dialog
  4. Name the slot.

  5. The classes where your original slot appears will be automatically entered in the Allowed Classes field. Modify this list if necessary.

  6. The classes in the Allowed Classes field of the original slot will be added to the Domain field. Modify this list if necessary. Remember that attaching a slot to a class also attaches it to all subclasses of the class.

  7. Make any other changes you wish to the slot definition.

Removing an Inverse Slot Relationship

Removing the inverse slot relationship removes the link between the two classes. Note that, if you remove an inverse slot relationship after instances have been created, existing values that were created by the inverse slot relationship are not removed. Removing an inverse slot only affects the values of new instances. To remove the inverse slot relationship between two slots:

  1. Highlight the Inverse Slot field in the Slot Editor for either one of the two slots.

  2. Click the Remove (slots_slot.remove) button at the right of the Inverse Slot field. The slot relationship will be removed.

Replacing an Inverse Slot

Replacing the inverse slot relationship at a slot removes the link to the original inverse slot and makes a link with a different, existing, slot. Note that, if you replace an inverse slot relationship after instances have been created, existing values that reflect the original (replaced) inverse slot relationship are retained. Replacing an inverse slot only affects the values of new instance. To replace an inverse relationship:

  1. Select the slot you want to have a different inverse.

  2. Click the Add Slot (slots_slot.add) button at the right of the Inverse Slot field.

  3. Select the slot you want from the Select Slot dialog box.

  4. Click OK. The new slot becomes the inverse slot of the current slot. The original inverse slot is now unlinked from the slot where you made the change and no longer has an inverse slot.