Understanding Inverse Slots
The Inverse Slot widget in the The Slot Form
allows you to create a reciprocal relationships between two slots, so that as
one slot is filled in at one instance, its inverse slot is automatically filled
in at another instance, according to the relationship you specified.
This section gives an overview of how to analyze a project and design inverse
slots. For information on how to use the user interface, see Creating an Inverse Slot Relationship.
For example, suppose you want to keep track of which editor(s) edit which
section(s). There is already a slot sections at the class Editor
which takes as values instances in the class Section. You could create an
inverse slot editor at the class Section which takes as values
instances in the class Editor. Now, at the instance Mr. Science
you assign the value Science to the slot sections. Then, at the
instance Science, Mr. Science automatically appears as a value for
the slot editor.
This section considers the most common relationship, an inverse slot
relationship between two instances.
To design and create inverse slots:
- First identify the inverse relationship.
- Second, analyze the Protégé components of the relationship.
- Finally create or assign the slots to the appropriate classes and create
the inverse slot relationship between them.
Identify the Relationship
This is a reciprocal relationship that always occurs: for example, if Mr.
Science edits the Science section, the Science section is edited by Mr. Science.
Different types of inverse relationships are possible. Take the following
criteria into consideration:
- You can restrict the relationship to a one-to-one correspondence OR
you can allow one or both of the slots to have multiple values. For example,
Chief Honcho edits a number of sections.
- The relationship can be between instances in different classes OR
instances in the same class. For example, likes and is_liked_by
would be a relationship where the slot and its inverse slot are both
attached to Person.
- A slot can be its own inverse. shares_ an_ office_ with would be a
candidate for an inverse relationship where the inverse slot was identical
with the original slot. This is a stronger tie than simply having instances
in the same class.
- The relationship must be reciprocal.
Analyze the Relationship in Protégé
Once you have identified the relationship in your ontology, you need to
analyze it in terms of your Protégé project. For an inverse slot relationship
between Instance slots, determine the following:
- What Protégé class(es) do you want for the first set of instances? Make
sure to choose a class or classes that are appropriate for the project. It
is most important to choose a class list that is not too small; that is, you
need to select a list of classes such that every possible instance is in one
of those classes. At the same time, for simplicity you want the class list
to be focused on the instances and not be too broad.
For example, in the newspaper project, one of the reporters, Larry
Tennis-Nut, is an eager beaver and sometimes edits the Sports section. It
would make sense to expand the list of classes to Editor and Reporter.
However, no salesmen or columnists are allowed to edit a section. Therefore,
while it would be possible to simply use the class Employee, it is
cleaner not to.
Call this first list of classes Class_List_A. It may well be a single
- If the second set of instances is different from the first, perform the
same analysis for the second set of instances. Here, we will restrict
ourselves to instances in the class Section.
Call this second list of classes Class_List_B. It may well be a
single class. It might also be identical to Class_List_A.
Based on this information, here is what you need to do in your Protégé
- Create a slot of type Instance which takes values in Class_List_A.
We'll call this original_slot.
- Create another slot of type Instance which takes values in Class_List_B.
We'll call this inverse_slot.
If the information is important in your ontology, it is likely that one or
both of these slots already exist in the project.
- Assign your Protégé slots to the appropriate classes. First, assign original_slot
to every class in Class_List_B.
Recall that the target values of original_slot are in Class_List_A.
Assigning the slot to Class_List_B is what creates the
cross-connection between the classes.
- Similarly, assign inverse_slot to every class in Class_List_A.
- Make inverse_slot the inverse of original_slot. You can
actually do this as soon as both slots are created.
Note that if you create an inverse slot relationship after some instances
have been created, existing instances will not display the inverse slot
the Inverse Slot Relationship
For information on how to use the Protégé interface to make an inverse
slot, see Creating an Inverse Slot Relationship.
Next: Creating an Inverse Slot Relationship
Slots Table of Contents