PrF UG slots override slot

From Protege Wiki

Jump to: navigation, search

Overriding Slot Properties at a Class


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

You can override slot properties by editing the slot at the class level. This allows you to be more restrictive about the slot facets relative to that class. A slot with overrides is shown with an override (slots_slot.overridden) icon in the Template Slots pane.

You can also edit the properties of a slot directly, instead of just overriding them at a class. See Editing a Top-level Slot for more information.

Overriding a Slot

To edit the slot properties for a specific class:

  1. Select a class in the Classes tab of the Class Browser.

  2. Select the slot you wish to edit in the Template Slots pane.

  3. Open the Slot Editor in one of the following ways:

    • Click the View Slot Overrides (slots_slot.view_overrides) Slot button at the upper right of the Template Slots pane.

    • Double-click the slot and select View slot at class in the Select Slot View dialog box, then click OK.

      Select Slot View dialog
  4. Change the desired properties in the Slot Editor. See Editing Slot Properties for more information.

After you have edited a slot at the class level, the slot will be displayed with an override (slots_slot.overridden) icon.

Scope

Overrides appear:

  • at the selected class

  • at all of its subclasses

Overrides do not appear:

  • at the Slots tab

  • at any superclasses

  • at any unrelated classes

Examples

  1. The slot employee_list is a slot of type Instance that takes the value Employee at the top level. By default, whenever you attach this slot to a class, it will range over the instances of Employee. Suppose, however, that for this class, you want to restrict the possible employees to salespeople. By overriding the slot, you can restrict the value range to the Salesperson subclass of Employee for the current class and its subclasses, without affecting the slot value range for any other class.

  2. Suppose you had a class of articles which appeared only on work days, not Saturday or Sunday. You could override the slot weekday at that class to remove Saturday and Sunday from the Symbol list for that class only, restricting the possibilities to working days. Once again, the top-level slot and its range at other classes will remain unchanged.

Restrictions

When you override a slot at a class, you can edit slot facets in the same way as you can at the top level. The override will not remove any existing restrictions, however, and may in fact tighten one or more of them:

  • The Name of an inherited slot cannot be changed.

  • For Cardinality, the slot may be changed from Multiple to Single, but not vice versa. The at least value may be increased; the at most value may be decreased.

  • For certain value types, some restrictions apply:

    • For a slot of type Any, the slot may be restricted to one of the other types (Boolean, Class, Float, Instance, Integer, String, or Symbol). You cannot change the type of slots other than type Any.

    • For a slot of type Class, the allowed superclasses can only be changed to subclasses of the allowed superclasses in the superclass.

    • For a slot of type Instance, the allowed classes can only be changed to subclasses of the allowed classes in the superclass.

  • A Minimum value (on types Integer or Float) may be created or increased.

  • A Maximum value (on types Integer or Float) may be created or decreased.

  • Default values cannot be removed.

Note: Currently, when you override a slot, Protege-Frames does not enforce the restrictive property. That is, you could theoretically expand or change the facets of a slot, rather than restricting them. However, it is not recommended that you do this, both because it is not good practice and because Protege-Frames may enforce restriction in the future.


Personal tools