PrF UG slots make inverse slot
Creating an Inverse Slot Relationship
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:
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.
Click the Add Slot (
) button at the right of the 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.
Select the slot you want to use from the Select Slot dialog box. Only slots of type Class or Instance will appear.
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
() 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:
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).
Click the Create Slot (
) button at the right of the Inverse Slot Editor.
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.
A new class of type Instance is created. The Slot Editor for the new slot opens automatically.
Name the slot.
The classes where your original slot appears will be automatically entered in the Allowed Classes field. Modify this list if necessary.
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.
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:
Highlight the Inverse Slot field in the Slot Editor for either one of the two slots.
Click the 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:
Select the slot you want to have a different inverse.
Click the Add Slot (
) button at the right of the Inverse Slot field.
Select the slot you want from the Select Slot dialog box.
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.