PrF UG slots slot editor

From Protege Wiki
Jump to: navigation, search

The Slot Editor


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 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 (slots_slot.view_top_level) button.

  • When you create a new slot for a highlighted class by clicking the Create Slot (slots_slot.create) 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 (slots_slot.view_top_level) or the View Slot Overrides (slots_slot.view_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.

urgent dialog

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:

The Slot Editor displays the following information for a slot:

  1. Note icons, which allow you to add notes.

  2. Name of the slot.

  3. Value Type of the slot.

  4. Cardinality of the slot.

  5. (optional) Minimum and Maximum values for the slot (slots of type Integer or Float only).

  6. (optional) Any Documentation that has been entered for the slot.

  7. (optional) An Inverse Slot for the slot (slots of type Class or Instance).

  8. (optional) Any Template Values that have been defined for the slot.

  9. (optional) Any Defaults that have been defined for the slot.

  10. Domain of the slot.

For certain value types, an additional pane appears below the Value Type pane:

  1. For type Class, the Allowed Superclasses pane appears.

  2. For type Instance, the Allowed Classes pane appears.

  3. For type Symbol, the Allowed Symbols pane appears.

Note Icons

The note icons (windows_slot_note.hide, windows_slot_note.create, windows_slot_note.delete), 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.

Value Type menu

The following table summarizes the value types. For a full description, click on the type name:

Type Description Examples

Any

any of the types below (logical Union)

Boolean

a logical, Boolean value; i.e., a value that is either true or false

true, false

Class

the slot takes one or more classes as values Editor

Float

a floating-point number (number with a decimal point) 1.0, 3.4e10, -0.3e-3

Instance

the slot takes one or more instances as values Head Honcho

Integer

an integer (a whole number) 1, 2, -4, 0

String

String of alphanumeric (ASCII) characters, possibly including spaces "Mars Mission"

Symbol

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.

Allowed Superclasses pane

Cardinality

The Cardinality field allows you to specify the number of values allowed or required for the slot. This supplies the following options:

Cardinality field 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:

Domain field for "urgent"
Domain field for "name"

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 (slots_slot.view_top_level) 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 (slots_slot.view_top_level) or View Slot Overrides (slots_slot.view_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 (windows_cascade_windows.gray) button below the main menu bar, or by selecting Cascade Windows from the Windows menu.

  • Close all open forms by clicking the CloseAllWindows (windows_close_all_windows) button below the main menu bar, or by selecting Close All Windows from the Windows menu.