Difference between revisions of "PrF UG slots slot editor"
(→Value Type Menu) |
|||
Line 187: | Line 187: | ||
For a full description, click on the type name: | For a full description, click on the type name: | ||
+ | <div class='b'> | ||
{| summary="value types" | {| summary="value types" | ||
! width="75" | Type | ! width="75" | Type | ||
Line 236: | Line 237: | ||
| {red, blue, green} | | {red, blue, green} | ||
|} | |} | ||
+ | </div> | ||
When a value type of <b>Class</b>, <b>Instance</b>, or <b>Symbol</b> is selected, | When a value type of <b>Class</b>, <b>Instance</b>, or <b>Symbol</b> is selected, |
Revision as of 16:14, October 29, 2008
The Slot Editor
The Slot Editor can be used to define and edit the attributes, or facets, of a slot. The Slot Editor for the selected slot is displayed at the right of the Slots tab. The Slot Editor can also be displayed as a free-standing window, as follows:
When you highlight a slot in the Slots tab and then click the View Slot () button.
When you create a new slot for a highlighted class by clicking the Create Slot () button in the Template Slots pane of the Classes tab.
When you highlight a slot in the Template Slots pane and then click the View Top-level Slot () or the View Slot Overrides () button.
In the example below, the slot urgent for the class Article was double-clicked in the Template Slots pane. The Slot Editor displays a Boolean Type, with Single Cardinality, and a text documentation pane of the urgent slot.
A slot can be attached to more than one class. Each slot has a top-level (system) description; the system description can be specialized, or overridden, for a specific class. The scope of your edits depends on how you access the Slot Editor:
Editing a Top-Level Slot: When you access the Slot Editor via the Slots tab or via the View Top-level Slot () button in the Template Slots pane of the Classes tab, you can view and edit the top-level description; these modifications affect the slot for any class where it occurs.
Overriding Slot Properties at a Class: When you access the Slot Editor via the View Slot Overrides () button in the Template Slots pane of the Classes tab, you can view and edit the slot properties for the currently highlighted class. Class-level modifications, called overrides, only affect the slot at the current class and its subclasses.
The Slot Editor displays the following information for a slot:
Note icons, which allow you to add notes.
Name of the slot.
Value Type of the slot.
Cardinality of the slot.
(optional) Minimum and Maximum values for the slot (slots of type Integer or Float only).
(optional) Any Documentation that has been entered for the slot.
(optional) An Inverse Slot for the slot (slots of type Class or Instance).
(optional) Any Template Values that have been defined for the slot.
(optional) Any Defaults that have been defined for the slot.
Domain of the slot.
For certain value types, an additional pane appears below the Value Type pane:
For type Class, the Allowed Superclasses pane appears.
For type Instance, the Allowed Classes pane appears.
For type Symbol, the Allowed Symbols pane appears.
Note Icons
The note icons (, , ), at the upper right of the Editor, allow you to add and remove yellow sticky notes to your slot. These notes, which are not part of your ontology, are displayed when the slot is selected at the Slots tab. For information on how to add notes to any frame (class, instance, or slot), see Working with Notes.
Slot Name
You can edit the slot name directly in the Name field. Slot names are case-sensitive. A recommended convention is to make slot names lowercase, separating adjacent words with an underscore (_).
Value Type Menu
The Value Type menu allows you to select the slot value type, which determines the kind of values that the slot may hold. When you are creating instances for a slot, the slot type also determines how the slot is displayed in the Instance Editor. See the Standard Widgets for more information about instances and type.
The following table summarizes the value types. For a full description, click on the type name:
Type | Description | Examples |
---|---|---|
any of the types below (logical Union) |
||
a logical, Boolean value; i.e., a value that is either true or false |
true, false | |
the slot takes one or more classes as values | Editor | |
a floating-point number (number with a decimal point) | 1.0, 3.4e10, -0.3e-3 | |
the slot takes one or more instances as values | Head Honcho | |
an integer (a whole number) | 1, 2, -4, 0 | |
String of alphanumeric (ASCII) characters, possibly including spaces | "Mars Mission" | |
the slot takes values from a list of strings you define | {red, blue, green} |
When a value type of Class, Instance, or Symbol is selected, an additional pane appears below the Value Type menu. This pane allows you to select or create the values for the slot.
Cardinality
The Cardinality field allows you to specify the number of values allowed or required for the slot. This supplies the following options:
The default configuration allows the slot to have at most one value; that is, it can have one value or no value. You can change the default by entering a positive whole number in the at least and/or at most options, or by selecting the multiple option:
required/at least: Sets the minimum number of values for the slot. To use, enter a positive whole number in the at least entry bar:
If you enter a value for at least, required is automatically selected.
Setting at least equal to one (1) means a value is required for the slot.
Setting at least greater than one automatically selects multiple as well.
Setting at least equal to 1 and at most equal to 1 specifies that the slot must have exactly one value.
at most: Sets the maximum number of values for the slot. To use, enter a positive whole number in the at most entry bar:
Setting at most equal to one (1) means that the slot can have at most one value; this is called a single slot.
Setting at most greater than one automatically selects multiple. The slot can contain multiple values, but there is a limit to the number of values.
multiple: Allows the slot to have more than one value; multiple values are stored and displayed as a list:
As above, to set a minimum number of values, set the at least value.
As above, to set a maximum number of values, set the at most value.
The lack of an at most value indicates that there is no limit to the number of items the slot may contain.
Duplicate values are allowed, although their use is uncommon
Minimum (optional)
This field is applicable only to slots of type Integer or Float.
Minimum allows you to specify a minimum value for your slot. When present, the Minimum value is displayed in the Other Facets column of the Template Slots pane.
When an instance is created for a class with this slot, the value of the slot must be greater than or equal to the minimum. For example, a minimum of zero means instances cannot have negative values.
Together, Minimum and Maximum can be used to define an allowable range.
Maximum (optional)
This field is applicable only to slots of type Integer or Float.
Maximum allows you to specify a maximum value for your slot. When present, the Maximum value is displayed in the Other Facets column of the Template Slots pane.
When an instance is created for a class with this slot, the value of the slot must be less than or equal to the maximum. Together, Minimum and Maximum can be used to define an allowable range.
Documentation (optional)
The Documentation field allows you to enter a text description of the slot. Filling in this field is optional, but is recommended to make maintaining the knowledge base easier. This documentation is part of your knowledge base.
Inverse Slot (optional)
Only available for slots of type Class or Instance.
Allows you to create a reciprocal relationship between two slots. If this relationship is set up correctly, assigning a value (i.e., a specific class or instance) to the slot for one instance automatically assigns the instance as a value to the appropriate inverse slot. For example, the "direct superclass/direct subclass" relationship is actually an inverse slot relationship. See Understanding Inverse Slots and Creating an Inverse Slot Relationship for more information.
If a slot has an inverse slot, the name of the inverse slot is shown after the slot name at the Slots tab.
Template Values (optional)
Allows you to specify the value(s) for a slot at the class level:
The template value is a required, uneditable value that is filled in for all classes and instances that use or inherit the slot.
The template value can not be changed or overridden at the instance level.
The number of Template Values should not exceed the at most value for the Cardinality of the slot.
For a value that can be overridden, use Defaults instead.
When present, any Template Values are displayed in the Other Facets column of the Template Slots pane in the Classes tab.
Defaults (optional)
Allows you to specify default value(s) for a slot:
When an instance is created for a class that has this slot, the default is automatically entered as the value of the slot.
The default value can be changed or overwritten.
The number of defaults should not exceed the at most value for the Cardinality of the slot.
When present, any Defaults are displayed in the Other Facets column of the Template Slots pane in the Classes tab.
Domain
The set of classes where the slot is attached is called the domain of the slot. For example, the slot urgent is attached to a single class, Content, while the slot name is attached to a number of classes:
See Adding a Slot to a Class for more information about editing the domain of a slot.
Viewing Several Slots
To view the information for several slots at once, select the slots at the Slots tab and click the View () slot button to open the Slot Editor for each slot. To highlight multiple slots, hold down the Ctrl (Cmd) key while clicking each slot. To highlight a range of slots, click the first slot, then hold down the Shift key and click the last slot in the range.
You can also view multiple slots using the View Top-level Slot () or View Slot Overrides () template slots buttons in the Template Slots pane.
Opening a new Slot Editor does not close the previous Editor. This allows you to compare the attributes for two or more slots. Edits can be made directly in any open Editor.
If you have multiple forms open, you can manage them as follows:
Cascade multiple forms by clicking the Cascade () button below the main menu bar, or by selecting Cascade Windows from the Windows menu.
Close all open forms by clicking the CloseAllWindows () button below the main menu bar, or by selecting Close All Windows from the Windows menu.