Difference between revisions of "PrF UG slots inverse slots"

From Protege Wiki
Jump to: navigation, search
(Automated import of articles)
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
== Understanding Inverse Slots ==
 
== Understanding Inverse Slots ==
  
{{PrF_UG_TOC_slots}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_slots}}<div id='prf_ug'></noinclude>
  
This topic gives an overview of how to analyze a project and design inverse slots in {{#var:PrF}}.
+
This topic gives an overview of how to analyze a project
 +
and design inverse slots in {{#var:PrF}}.
 
An inverse slot relationship is a reciprocal relationship between two slots.
 
An inverse slot relationship is a reciprocal relationship between two slots.
 
Whenever one slot is filled in at one instance,
 
Whenever one slot is filled in at one instance,
 
its inverse slot is automatically filled in at another instance,
 
its inverse slot is automatically filled in at another instance,
 
according to the relationship you specified.
 
according to the relationship you specified.
This topic describes the most common relationship - an inverse slot relationship between two instances,
+
 
 +
This topic describes the most common relationship -
 +
an inverse slot relationship between two instances,
 
including the following steps:
 
including the following steps:
 +
identifying an inverse relationship,
 +
analyzing the {{#var:PrF}} components of the relationship,
 +
implementing the relationship in {{#var:PrF}}.
  
<ul class='a'>
+
You create inverse slots using the <b>Inverse Slot</b> widget
  <li><p>
+
in the [[PrF_UG_slots_slot_editor|Slot Editor]].
    [[#Example|an example]]
 
    </p>
 
 
 
  <li><p>
 
    [[#Identifying_the_Relationship|identifying an inverse relationship]];
 
    </p>
 
 
 
  <li><p>
 
    [[#Analyzing_the_Relationship_for_Protege-frames|analyzing the {{#var:PrF}} components of the relationship]]
 
    </p>
 
 
 
  <li><p>
 
    [[#Steps_Required_for_Implementing_the_Relationship|steps in implementing the relationship in {{#var:PrF}}]]
 
    </p>
 
</ul>
 
 
 
You create inverse slots using the <b>Inverse Slot</b> widget in the
 
[[PrF_UG_slots_slot_editor|Slot Editor]].
 
 
For more information on how to use the user interface,
 
For more information on how to use the user interface,
see
+
see [[PrF_UG_slots_make_inverse_slot|Creating an Inverse Slot Relationship]].
[[PrF_UG_slots_make_inverse_slot|Creating an Inverse Slot Relationship]].
+
Note that if you create an inverse slot relationship
Note that if you create an inverse slot relationship after one or more instances have been created,
+
after one or more instances have been created,
 
existing instances will not display the inverse slot information.
 
existing instances will not display the inverse slot information.
  
 
=== Example ===
 
=== Example ===
  
For example,
+
For example, suppose you want to keep track at the section level
suppose you want to keep track at the section level of which editor(s) edit which section(s).
+
of which editor(s) edit which section(s).
 
There is already a slot named <i>sections</i> at the class <b>Editor</b>;
 
There is already a slot named <i>sections</i> at the class <b>Editor</b>;
 
it takes instances in the class <b>Section</b> as values:
 
it takes instances in the class <b>Section</b> as values:
  
<div>[[Image:PrF_UG_slots_slot_sections.png|slots_slot_sections]]</div>
+
<div>[[Image:PrF_UG_slots_slot_sections.png|frame|none|
 +
      sections slot]]</div>
  
You could create an inverse slot named <i>editor</i> at the class <b>Section</b> which takes instances in the class <b>Editor</b> as values:
+
You could create an inverse slot named <i>editor</i> at the class <b>Section</b>
 +
which takes instances in the class <b>Editor</b> as values:
  
<div>[[Image:PrF_UG_slots_slot_editor_inverse.png|slots_slot_editor_inverse]]</div>
+
<div>[[Image:PrF_UG_slots_slot_editor_inverse.png|frame|none|
 +
      editor (inverse) slot]]</div>
  
Now,
+
Now, when you edit the instance <b>Mr. Science</b>
when you edit the instance <b>Mr.
+
to assign the value <b>Science</b> to the slot <i>sections</i>,
Science</b> to assign the value <b>Science</b> to the slot <i>sections</i>,
 
 
the inverse relationship is tracked by {{#var:PrF}}.
 
the inverse relationship is tracked by {{#var:PrF}}.
At the instance <b>Science</b>,
+
At the instance <b>Science</b>, <b>Mr. Science</b> automatically appears
<b>Mr.
+
as a value for the slot <i>editor</i>.
Science</b> automatically appears as a value for the slot <i>editor</i>.
 
  
 
=== Identifying the Relationship ===
 
=== Identifying the Relationship ===
  
First you must determine if an inverse slot will appropriately represent the structure of your knowledge base.
+
First, you must determine if an inverse slot
 +
will appropriately represent the structure of your knowledge base.
 
An inverse slot represents a reciprocal relationship that always occurs.
 
An inverse slot represents a reciprocal relationship that always occurs.
For example,
+
For example, if Mr. Science edits the Science section,
if Mr.
+
the Science section is edited by Mr. Science.
Science edits the Science section,
+
{{#var:PrF}} supports several different types of inverse relationships:
the Science section is edited by Mr.
 
Science. {{#var:PrF}} supports several different types of inverse relationships:
 
  
 
<ol class='a'>
 
<ol class='a'>
Line 77: Line 65:
 
     The relationship can be a one-to-one correspondence,
 
     The relationship can be a one-to-one correspondence,
 
     or one or both of the slots can have multiple values.
 
     or one or both of the slots can have multiple values.
     For example,
+
     For example, Chief Honcho edits a number of sections.
    Chief Honcho edits a number of sections.
 
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
 
     The relationship can be between instances in different classes or instances in the same class.
 
     The relationship can be between instances in different classes or instances in the same class.
     For example,
+
     For example, <i>likes</i> and <i>is_liked_by</i> would be a relationship
    <i>likes</i> and <i>is_liked_by</i> would be a relationship where the slot and its inverse slot are both attached to <b>Person</b>.
+
    where the slot and its inverse slot are both attached to <b>Person</b>.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     A slot can be its own inverse. <i>shares_ an_ office_ with </i> would be a candidate for an inverse relationship where the inverse slot was identical with the original slot.
+
     A slot can be its own inverse.
 +
    <i>shares_ an_ office_ with </i> 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.
 
     This is a stronger tie than simply having instances in the same class.
 
     </p>
 
     </p>
Line 102: Line 91:
 
<ul class='a'>
 
<ul class='a'>
 
   <li><p>
 
   <li><p>
     What {{#var:PrF}} class(es) do you want for the first set of instances? We will call this first list of classes <b>Class_List_A</b>.
+
     What {{#var:PrF}} class(es) do you want for the first set of instances?
 +
    We will call this first list of classes <b>Class_List_A</b>.
 
     </p>
 
     </p>
  
Line 112: Line 102:
 
     <li><p>
 
     <li><p>
 
       It is most important to choose a class list that is not too small;
 
       It is most important to choose a class list that is not too small;
       that is,
+
       that is, you need to select a list of classes
      you need to select a list of classes such that every possible instance is in one of those classes.
+
      such that every possible instance is in one of those classes.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       At the same time,
+
       At the same time, for simplicity,
      for simplicity,
 
 
       you want the class list to be focused on the instances and not be too broad.
 
       you want the class list to be focused on the instances and not be too broad.
 
       </p>
 
       </p>
Line 124: Line 113:
 
     <li><p>
 
     <li><p>
 
       This list may consist of a single class.
 
       This list may consist of a single class.
       For example,
+
       For example, in the <b>newspaper</b> project, one of the reporters, Larry Tennis-Nut,
      in the <b>newspaper</b> project,
 
      one of the reporters,
 
      Larry Tennis-Nut,
 
 
       is an eager beaver and sometimes edits the Sports section.
 
       is an eager beaver and sometimes edits the Sports section.
 
       It would make sense to expand the list of classes to <b>Editor</b> and <b>Reporter</b>.
 
       It would make sense to expand the list of classes to <b>Editor</b> and <b>Reporter</b>.
       However,
+
       However, no salesmen or columnists are allowed to edit a section.
      no salesmen or columnists are allowed to edit a section.
+
       Therefore, while it would be possible to simply use the class <b>Employee</b>,
       Therefore,
 
      while it would be possible to simply use the class <b>Employee</b>,
 
 
       it is cleaner not to.
 
       it is cleaner not to.
 
       </p>
 
       </p>
Line 157: Line 141:
 
=== Steps Required for Implementing the Relationship ===
 
=== Steps Required for Implementing the Relationship ===
  
In this example,
+
In this example, we will restrict ourselves to instances in the class <b>Section</b>.
we will restrict ourselves to instances in the class <b>Section</b>.
 
  
The following steps are necessary to create an inverse slot relationship in a {{#var:PrF}} project:
+
The following steps are necessary to create an inverse slot relationship
 +
in a {{#var:PrF}} project:
  
 
<ol class='a'>
 
<ol class='a'>
Line 177: Line 161:
  
 
   <li><p>
 
   <li><p>
     [[PrF_UG_slots_attach_slot|Attach]]
+
     [[PrF_UG_slots_attach_slot|Attach]] your {{#var:PrF}} slots
    your {{#var:PrF}} slots to the appropriate classes.  
+
    to the appropriate classes.  
 
     </p>
 
     </p>
  
 
   <ul>
 
   <ul>
 
     <li><p>
 
     <li><p>
       First,
+
       First, add <i>original_slot</i> to every class in <b>Class_List_B</b>.
      add <i>original_slot</i> to every class in <b>Class_List_B</b>.
 
 
       Recall that the target values of <i>original_slot</i> are in <b>Class_List_A</b>.
 
       Recall that the target values of <i>original_slot</i> are in <b>Class_List_A</b>.
       Assigning the slot to <b>Class_List_B</b> is what creates the cross-connection between the classes.
+
       Assigning the slot to <b>Class_List_B</b>
 +
      is what creates the cross-connection between the classes.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       Similarly,
+
       Similarly, assign <i>inverse_slot</i> to every class in <b>Class_List_A</b>.
      assign <i>inverse_slot</i> to every class in <b>Class_List_A</b>.
 
 
       </p>
 
       </p>
 
   </ul>
 
   </ul>
Line 197: Line 180:
 
   <li><p>
 
   <li><p>
 
     [[PrF_UG_slots_make_inverse_slot|Create the inverse relationship]]
 
     [[PrF_UG_slots_make_inverse_slot|Create the inverse relationship]]
     between <i>inverse_slot</i> and <i>original_slot</i>. (You can actually do this as soon as both slots are created.)
+
     between <i>inverse_slot</i> and <i>original_slot</i>.
 +
    (You can actually do this as soon as both slots are created.)
 
     </p>
 
     </p>
 
</ol>
 
</ol>
  
If you already have a slot <i>original_slot</i> of type Instance in your project and it already has the desired allowed classes and domain,
+
If you already have a slot <i>original_slot</i> of type Instance in your project
 +
and it already has the desired allowed classes and domain,
 
you can create a new slot specifically as the inverse of <i>original_slot</i>.
 
you can create a new slot specifically as the inverse of <i>original_slot</i>.
In this case,
+
In this case, the <i>inverse_slot</i> has the following properties;
the <i>inverse_slot</i> has the following properties;
 
 
you can edit them after creation if necessary:
 
you can edit them after creation if necessary:
  
 
<ul class='a'>
 
<ul class='a'>
 
   <li><p>
 
   <li><p>
     <i>inverse_slot</i> is automatically attached to all classes in the list of allowed classes for <i>original_slot</i>.
+
     <i>inverse_slot</i> is automatically attached to all classes
 +
    in the list of allowed classes for <i>original_slot</i>.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     its allowed classes automatically includes the list of all the classes where <i>original_slot</i> is attached.
+
     its allowed classes automatically includes the list
 +
    of all the classes where <i>original_slot</i> is attached.
 
     </p>
 
     </p>
 
</ul>
 
</ul>
  
 
For information on how to use the {{#var:PrF}} interface to make an inverse slot,
 
For information on how to use the {{#var:PrF}} interface to make an inverse slot,
see
+
see [[PrF_UG_slots_make_inverse_slot|Creating an Inverse Slot Relationship]].
[[PrF_UG_slots_make_inverse_slot|Creating an Inverse Slot Relationship]].
+
 
  
</div>
+
<noinclude></div></noinclude>

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

Understanding Inverse Slots


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

This topic gives an overview of how to analyze a project and design inverse slots in Protege-Frames. An inverse slot relationship is a reciprocal relationship between two slots. Whenever 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 topic describes the most common relationship - an inverse slot relationship between two instances, including the following steps: identifying an inverse relationship, analyzing the Protege-Frames components of the relationship, implementing the relationship in Protege-Frames.

You create inverse slots using the Inverse Slot widget in the Slot Editor. For more information on how to use the user interface, see Creating an Inverse Slot Relationship. Note that if you create an inverse slot relationship after one or more instances have been created, existing instances will not display the inverse slot information.

Example

For example, suppose you want to keep track at the section level of which editor(s) edit which section(s). There is already a slot named sections at the class Editor; it takes instances in the class Section as values:

sections slot

You could create an inverse slot named editor at the class Section which takes instances in the class Editor as values:

editor (inverse) slot

Now, when you edit the instance Mr. Science to assign the value Science to the slot sections, the inverse relationship is tracked by Protege-Frames. At the instance Science, Mr. Science automatically appears as a value for the slot editor.

Identifying the Relationship

First, you must determine if an inverse slot will appropriately represent the structure of your knowledge base. An inverse slot represents a reciprocal relationship that always occurs. For example, if Mr. Science edits the Science section, the Science section is edited by Mr. Science. Protege-Frames supports several different types of inverse relationships:

  1. The relationship must be reciprocal.

  2. The relationship can be a one-to-one correspondence, or one or both of the slots can have multiple values. For example, Chief Honcho edits a number of sections.

  3. 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.

  4. 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.

Analyzing the Relationship for Protege-Frames

Once you have identified the relationship in your ontology, you need to analyze it in terms of your Protege-Frames project. For an inverse slot relationship between Instance slots, determine the following:

  • What Protege-Frames class(es) do you want for the first set of instances? We will call this first list of classes Class_List_A.

    • 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.

    • This list may consist of a single class. 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.

  • If the second set of instances is different from the first, perform the same analysis for the second set of instances. Call this second list of classes Class_List_B.

    • As before. this list may be a single class.

    • This list may be identical to Class_List_A.

Steps Required for Implementing the Relationship

In this example, we will restrict ourselves to instances in the class Section.

The following steps are necessary to create an inverse slot relationship in a Protege-Frames project:

  1. Create a slot of type Instance whose allowed classes are Class_List_A. We'll call this the original_slot.

  2. Create another slot of type Instance whose allowed classes are Class_List_B. We'll call this the 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.

  3. Attach your Protege-Frames slots to the appropriate classes.

    • First, add 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.

  4. Create the inverse relationship between inverse_slot and original_slot. (You can actually do this as soon as both slots are created.)

If you already have a slot original_slot of type Instance in your project and it already has the desired allowed classes and domain, you can create a new slot specifically as the inverse of original_slot. In this case, the inverse_slot has the following properties; you can edit them after creation if necessary:

  • inverse_slot is automatically attached to all classes in the list of allowed classes for original_slot.

  • its allowed classes automatically includes the list of all the classes where original_slot is attached.

For information on how to use the Protege-Frames interface to make an inverse slot, see Creating an Inverse Slot Relationship.