Difference between revisions of "PrF UG classes all"

From Protege Wiki
Jump to: navigation, search
Line 1: Line 1:
{{TOClimit|limit=1}}
+
{{TOClimit|limit=0}}
 
__TOC__
 
__TOC__
 
{{PrF_UG}}
 
{{PrF_UG}}

Revision as of 13:37, November 14, 2008

Template:TOClimit

Contents

Classes

This section of the User's Guide covers the concepts of understanding, creating, and using Protege-Frames classes.

Note: Before you create and use classes, you should be confident with the basic Protege-Frames interface. You should also be comfortable with Protege-Frames projects, project types, and windows.

To return to the main table of contents, click the Protege-Frames User's Guide link (located at the top of the table of contents on the right-hand side of this page).


The Classes Tab

The Classes tab provides a single window in which you may view, create, and edit classes, which model concepts in your domain - usually objects, such as article or author.

The tab consists of two panes:

  1. The Class Browser at the left shows the classes in your project and allows you to make edits that modify the class hierarchy. For example, you might create, delete, or move a class or work with superclasses and metaclasses.

  2. When a single class is selected, the Class Editor on the right shows the properties of the selected class and allows you to edit class-specific attributes, such as class sticky notes, class name, role, any constraints, and template slots. The Class Editor can also be displayed as a separate window by clicking the View Class (classes_class.view) icon in the Class Browser.

Click on an area in the picture to view more information:

The Class BrowserThe Class buttonsThe Class EditorThe Class Constraints paneThe Class Documentation paneNote iconsNote iconsThe Class Role menuThe Template Slots paneThe Class Hierarchy windowFinding a ClassThe Superclasses paneViewing Class Relations
Classes tab, "Editor" and "Author" selected

For information about the Classes user interface and about accomplishing specific tasks, see the Classes Table of Contents.



The Class Browser

The Class Browser, at the left of the Classes tab, displays the classes in the knowledge base as a tree. The Class Browser includes the following:

  1. The Class buttons allow you to create (classes_class.create), view/edit (classes_class.view), view references to (classes_class.view_references), and delete (classes_class.delete) classes in your knowledge base.

  2. The Relations menu (classes_class.relationship.menu) allows you to view relations between classes: you can display the entire hierarchy (default) or restrict the display only to those classes that are related to a selected class.

  3. The Class Hierarchy window displays your class hierarchy. Icons give additional information about your classes. In this window, you can:

    • rearrange the class hierarchy using "drag-and-drop"; see Moving a Class for more information.

    • select a class to see its information displayed in the Class Editor to the right.

    • right-click a class to use the cascading Class menu, which allows you to create, delete, and hide classes, as well as work with metaclasses.

  4. The Class lookup bar allows you to find a class in the Class Relationship window by typing all or part of the class name and clicking the Search for Class (classes_class.search) button.

  5. The Superclasses pane allows you to add and remove superclasses for a class, as well as jump to a different superclass in the hierarchy view.

Click on a region or name in the illustration to jump to a description:

The Class BrowserThe Class buttonsThe Class buttonsThe Class Hierarchy windowThe Class Hierarchy windowFinding a ClassThe Superclasses paneThe Superclasses paneViewing Class Relations
Class Browser, "Editor" and "Author" selected



The Class Buttons

The class buttons (classes_class.view, classes_class.view_references, classes_class.create, classes_class.delete), located at the top right of the Class Browser, allow you to view and edit, view references to, create, or delete a class.

Creating a New ClassDeleting a ClassDisplaying the Class EditorViewing References
top of Class Browser

The buttons have the following actions:

  • The View Class button (classes_class.view) opens the Class Editor for the highlighted class. This allows you to view or edit the class.

  • The View References to Class button (classes_class.view_references) opens the References window, which shows all the frames that reference the highlighted class. See Viewing References.

  • The Create Class button (classes_class.create) creates a new class as a subclass of the highlighted class.

  • The Delete Class button (classes_class.delete) deletes the highlighted class and all of its subclasses.

If the Create Class or Delete Class button is grayed out, this indicates that the current class cannot be edited or deleted. A non-editable class always has a pale class icon to its left. A class cannot be edited if it is a system class or if it is included from another project.

Additional Buttons

The buttons above have the same operation wherever they appear. Additional buttons in the Protege-Frames interface allow you to add and remove the classes specified in a slot, field, or other relationship.

  • The Add Class button (classes_class.add) displays a dialog box that allows you to select one or more existing classes.

  • The Remove Class button (classes_class.remove) removes the class from the current relationship without deleting it from the knowledge base.



The Class Hierarchy Window

The Class Hierarchy window in the Class Browser displays the classes for the project and allows you to rearrange your hierarchy using "drag-and-drop". By default, the Class window displays the class structure of your knowledge base, with all classes shown as descending, directly or indirectly, from the system class :THING.

Class Hierarchy window

Description

This window shows the following:

  • Subclasses appear below their superclasses and are indented to the right.

  • Hierarchy icons indicate how much or how little of the hierarchy is displayed:

    • An "expanded" icon (all_hierarchy.expanded) means that all direct subclasses of the class are displayed.

    • A "collapsed" icon (all_hierarchy.collapsed) means that the class has direct subclasses which are not currently displayed. You can click on this icon to toggle it.

    • If no icon is displayed, the class has no direct subclasses.

    Tip: You can also display all classes below a class by right-clicking the class and selecting Expand from the cascading Class Menu.

  • The currently selected class is shown with a highlight.

  • Classes with more than one superclass appear more than once in the tree.

  • Class icons show information about your class (e.g., the class role).

Note: You can also change the view from the default to view the class relations for a selected class. Most of the time, however, you will work with the default hierarchy view.

Tasks

The Class Hierarchy window allows you to perform the following tasks:

  • You can select a class by clicking on it.

  • You can edit the attributes of a class in the Class Editor. When a class is selected, the Class Editor appears to the right. You can also open the Class Editor for one or more selected classes by clicking the View Class (classes_class.view) button.

  • You can create a new class by clicking the Create Class (classes_class.create) button and creating and editing its attributes in the Class Editor.

  • You can delete a class by clicking the Delete Class (classes_class.delete) button.

  • You can search for a class by typing all or part of the class name in the Class lookup bar and then clicking the Find Class (classes_class.search) button.

  • You can work with metaclasses and hidden classes, using the right mouse button. See the Class menu for more information.

You can also rearrange the superclass/subclass relationships:

For additional superclass tasks that you can perform, see the Superclasses pane.



The Class Icons

The icons in the Class window provide information about the structure of your knowledge base and the nature of your classes.

Class Icons

Classes are indicated by round golden icons. Additional properties of the icons give information about the type of class:

A solid icon indicates a concrete class; that is, a class that may have direct instances:

classes_class

A concrete class

classes_class.metaclass

A concrete metaclass

A hollow icon (with a hole) indicates an abstract class; that is, a class that cannot have direct instances. Abstract classes can have subclasses:

classes_class.abstract

An abstract class

classes_class.metaclass.abstract

An abstract metaclass

A pale icon indicates a system class or a class that has been included from another project. These classes cannot be edited. See Including a Project for more information:

classes_class.pale

A system concrete class or an included concrete class

classes_class.abstract.pale

A system abstract class or an included abstract class

classes_class.metaclass.abstract.pale

A system abstract metaclass or an included abstract metaclass

A gray icon indicates a hidden class. You can use hidden classes to restrict a user's view of your knowledge base while retaining the structure of the larger project. You choose whether or not to display the hidden classes in a project using the Configure dialog box.

classes_class.gray

A hidden concrete class

classes_class.abstract.gray

A hidden abstract class

classes_class.metaclass.gray

A hidden metaclass

Hierarchy Icons

The following icons give information about the display of the class hierarchy:

all_hierarchy.expanded

All direct subclasses of the class are displayed. You can click on this icon to hide the subclasses.

all_hierarchy.collapsed

The class has direct subclasses which are not currently displayed. You can click on this icon to display the subclasses.

No icon

The absence of a all_hierarchy.expanded or a all_hierarchy.collapsed indicates that the class has no subclasses. In the newspaper example, Library has no subclasses.

Note: To display all subclasses below a class, right-click the class and select Expand from the cascading Class menu.



The Class Menu

Whenever you have a class selected, you can access the cascading class menu by clicking the right mouse button. This menu allows you to perform a number of class-related tasks.

To access the class menu:

  1. Select a class in the Class Browser.

  2. Click the right mouse button. The cascading class menu is displayed.

    cascading class menu, "Create Class" selected
  3. Make your selection and click the left mouse button.

The class menu allows you to perform the following tasks. Not all tasks are available at all times; tasks that cannot be performed are grayed out.

  • Create Class: Creates a class that is subordinate to the highlighted class. This operation is identical to clicking the Create Class (classes_class.create) button.

  • classes_advanced.small   Create Subclass using Metaclass...: If you have added metaclasses to your project, this allows you to create a new class, subordinate to the highlighted class, using a metaclass as a template. See Creating a Class Using a Metaclass for more information.

  • Delete Class: Deletes the highlighted class and all of its subclasses, removing it from the current project. This operation is identical to the Delete Class (classes_class.delete) button.

  • classes_advanced.small   Change metaclass: Changes the metaclass of the highlighted class. See Changing the Metaclass of a Class for more information.

  • classes_advanced.small   Change metaclass of subclasses: Changes the metaclass of all subordinate classes to the metaclass of the highlighted class.

  • Hide class: Makes the highlighted class hidden. If the class is already hidden, the selection is Make class visible.

  • classes_advanced.small   Set as Default Metaclass: Makes the selected metaclass the default; that is, new classes will automatically be created using this as a template.

  • classes_advanced.small   Set as Default Slot Metaclass: Makes the selected metaclass the default slot metaclass; that is, new slots will be created using this as a template.

  • Expand: Shows all classes that are subordinate to the highlighted class. This is a multi-level display operation that is more extensive than clicking the all_hierarchy.collapsed icon, which only shows the next level of direct subclasses.

  • Collapse: Hides all classes that are subordinate to the highlighted class.

classes_advanced.small   Metaclasses are an advanced feature; you should have a good understanding of Protege-Frames before you use metaclasses.



The Class Search Bar

The Class Search Bar in the Class Browser allows you to type the name of a class and locate it in the Class window by clicking the Search for Class (classes_class.search) button.

Class Search Bar


The Superclasses Pane

The Superclasses pane, at the bottom of the Class Browser, displays all superclasses of the currently selected class.

Superclasses pane, in Class Browser

Note: If you cannot see the Superclasses pane, your window may be too small. You can see the pane by enlarging your window or by dragging the slider bar at the bottom of the Class Browser. See Working With a Small Window for more information.

Viewing the List of Superclasses

To see a list of all superclasses of a given class, highlight any occurrence of the class in the Class Browser. The Superclasses pane automatically displays a list of all of the superclasses of the selected class.

Adding a Superclass

To add a superclass to the selected class, click the Add Superclass (classes_class.add) button, highlight the class you want as an additional superclass in the Select Class window, then click OK. See Adding a Superclass for more information.

Removing a Superclass

To remove a superclass from the list of superclasses for the selected class, highlight the superclass you want to remove and click the Remove Superclass (classes_class.remove) button. The superclass/subclass relationship is broken, but the superclass is not deleted from the knowledge base. See Removing a Superclass for more information.

Locating Another Superclass

To jump to a different superclass in the Class Browser, click on any superclass in the Superclasses pane. The highlight in the Class Browser automatically moves to the occurrence of the class which is directly under the chosen superclass. If the occurrence is not currently visible in the Class Browser, Protege-Frames automatically scrolls to the correct location and expands the hierarchy to make the class visible. See Jumping to Another Superclass for more information.



The Class Editor

The Class Editor can be used to define and edit the attributes of a class. Click on a link or an area of the picture to jump to a summary. See also Creating a Class, Displaying the Class Editor, Editing a Class, and Editing Template Slots.

The Class Constraints paneThe Class Documentation paneThe Class Name fieldNote iconsThe Class Role menuThe Class Documentation paneThe Template Slots pane
Class Editor

Note Icons

The note icons (windows_class_note.hide, windows_class_note.create, windows_class_note.delete) at the upper right of the Editor allow you to work with class sticky notes. These notes, which are not part of your ontology, can be used for todos or communication while you are developing your knowledge base. They can be hidden using the Hide Class Notes (windows_class_note.hide) button. For information on how to add notes to any frame (class, instance, or slot), see Working with Notes.

Notes are not available when working with the Editor as a free-standing window.

The Class Name Field

The Name field allows you to name your class. When a class is created, it is given a default name, such as newspaper_Class_1. You can change the name of a new or existing class by highlighting the name and overwriting it. The following rules apply to class names:

  • The name must be a unique class name in the knowledge base.

  • Class names are case sensitive.

A recommended convention is to make the first character of each word in a class name uppercase and the rest lowercase, and to separate words with underscores.

The Class Role Menu

The Role menu allows you to choose the role of your class: concrete or abstract.

  • Concrete classes may have direct instances.

  • Abstract classes cannot have direct instances.

Protege-Frames sets the role to Concrete, by default. Protege-Frames does not impose any restrictions on the role of your classes. One common modeling convention is to make all leaf (bottom-level) classes concrete, and all interior (higher-level, non-leaf) classes abstract.

The Class Constraints Pane

Class constraints are defined programmatically. See Constraints for more information.

The Class Documentation Pane

The Class Documentation pane allows you to enter a text description of the class and other relevant information. These notes are part of your ontology. Filling in this field is optional, but is recommended to aid in the maintenance of the knowledge base.

The Template Slots Pane

The Template Slots pane displays the direct and inherited slots for the selected class. Slots, which represent properties of your class, are a crucial part of your knowledge base. In the example, Editor has several slots which appear in the Template Slots pane. For a full description, see the separate Template Slots pane topic.



Constraints

Protege-Frames builds relationships (e.g., between classes and instances, slots and slot facets). However, these relationships may be insufficient to capture all the constraints that hold among the frames of the knowledge base. Typically, Protege-Frames does not offer a way of relating the values of different slots attached to a given class, nor does it help in relating the slot values of different instances of a class.

For example, in the newspaper project, one might want to state that editors should have a higher salary than the employees for whom they are responsible (i.e., a constraint that involves the Editor and Employee classes and the salary and responsible_for slots).

The Protege Axiom Language (PAL) extends the Protege-Frames knowledge modeling environment with support for writing and storing logical constraints and queries about frames in a knowledge base. PAL is a plugin toolset that comprises engines for checking constraints and running queries on knowledge bases, as well as a set of useful user interface components. PAL's primary purpose is to support the definition of arbitrary logical constraints on the frames of a knowledge base.

Information about constraints can be found in the PAL section of the Plugins Library, including a quick reference guide and comprehensive documentation.



The Template Slots Pane

The Template Slots pane, at the bottom of the Class Editor, displays the direct and inherited slots for the selected class. Slots, which represent properties of your class, are a crucial part of your knowledge base. In the example, Article has a number of slots which appear in the Template Slots pane.

Template Slots pane

The Template Slot Buttons

The buttons at the upper right of the Template Slots pane allow you to edit, override, add, and remove slots. See the separate Template Slot buttons topic for more information.

You can also view, create, and delete slots directly from the Slots tab. See the Slot buttons for more information.

The Template Slot Menu

Right-clicking anywhere in the Template Slots pane brings up the Template Slot menu, which allows you to edit, override, add, and remove slots. These are the same actions provided by the Template Slot buttons.

Template Slot menu

The Slot Icons

The icons at the left of the column give information about the slot.

slots_slot

A blue icon means that the slot is direct; that is, it was created directly on the selected class. responsible_for is a direct slot.

slots_slot.inherited

A bracketed icon means that the slot is inherited from one of the selected class's ancestors. Inherited slots can be edited, but not deleted; there are also some restrictions on the edits that are allowed. In the example above, containing_section is an inherited slot.

slots_slot.inherited.overridden

A bracketed icon containing "0" means the slot has overrides; that is, the slot is inherited and it has been modified at the class.

Slot Summary Columns

The columns in the Slot Templates pane summarize the slot properties; these can be viewed and edited in the Slot Editor or Slots tab.

Name

Displays the name of the slot. Hovering over the name of an inherited slot will show the names of the class(es) that the slot is inherited from.

Cardinality

Indicates whether a slot value can consist of Multiple items or must be a Single item.

Type

Indicates the kind of values that the slot may hold. Available types are: Any, Boolean, Class, Float, Instance, Integer, String, and Symbol. For slots of type Class or Integer, also displays the allowed classes. See The Value Type menu for more information.

Other Facets

Displays any other facets defined in the Slot Editor or Slots tab, such as any required values, defaults, or minimum or maximum values. Also lists the allowed values for a slot of type Symbol.



The Template Slot Buttons

The Template Slot buttons, located at the top right of the Template Slots pane, allow you to view/edit, override, create, remove overrides, add, or remove a slot for the current class. You can also access these commands by right-clicking on the slot and selecting an action from the Template Slot menu.

Template Slots menu, "View Top-Level Slot" selected

Note: You can also view and create slots directly from the Slots tab, as well as deleting a slot from the project. See the Slot buttons for more information.

The buttons have the following actions:

slots_slot.view_top_level

View Top-Level Slot: Opens the top-level Slot Editor for the highlighted slot. If you make any changes to the slot at the top level, they affect the slot everywhere it appears, including the Slots tab and all classes where the slot is attached. See Viewing a Slot.

slots_slot.view_overrides

View Slot Overrides: Opens the class-level Slot Editor for the highlighted slot. Overrides to the slot at the class level have the following properties:

  • Overrides only affect the properties of the slot for the selected class and its subclasses.

  • The slot remains unchanged at the Slots tab, as well as any other classes where appears. A slot that has been overridden has an override icon (slots_slot.overridden) in the left column. There are limits on the overrides that you can make to an inherited slot. See Viewing a Slot for more information.

slots_slot.create

Create Slot: Creates a new slot for the current class.

Note: If the Create Slot (slots_slot.create) button is disabled, the selected class cannot be edited; this is the case if it is a system class or is included from another project.

slots_slot.remove_overrides

Remove Slot Overrides: Removes any slot overrides.

slots_slot.add

Add Slot: Adds a pre-existing slot to the current class.

slots_slot.remove

Remove Slot: Removes the highlighted slot from the current class. The slot remains in the project and can be viewed in the Slot Browser. To delete a slot completely from the project, use the Delete Slot (slots_slot.delete) button at the Slots tab.

Note: If the Remove Slot (slots_slot.remove) button is disabled, the selected slot cannot be removed from this class. For example, slots that are inherited from a superclass class cannot be removed.



The References Window

In a complex project, it is possible to have many different relationships between classes, instances, and slots. A reference for a frame is any other frame that has a direct relationship to it. The References window can be viewed by selecting an item and clicking on the References (classes_class.view_references or instances_instance.view_references) button. See Viewing References for more information.

References to Advertisement dialog, "name" selected

It is also possible to view those classes that are related through a particular slot, using the Relations Menu.

Examples

For example, references for a class include:

  • any superclasses of the class

  • any direct subclasses of the class

  • any instances of the class

  • any direct slots (inherited slots are not considered to be references)

  • any notes at the class

  • the metaclass of the class

For a slot, references include:

  • any superslots or subslots

  • :STANDARD-SLOT or other slot metaclass

  • any classes that have the slot attached as a direct slot

The References window allows you to view a list of all the references of a selected frame.

The View Buttons

all_object.view

View Reference: Opens the editor for the highlighted frame and allows you to view the frame's properties. Depending on the frame, this could be the Class Editor, the Slot Editor, or the Instance Editor.

all_object.view_references

View References to Value: Shows the references for the highlighted frame.

The Frame Column

This column shows the name of each frame that references the highlighted item. The type of frame is indicated by a class icon, slot icon, or instance icon (instances_instance).

The Slot Column

This column specifies the slot that actually references the selected item. Note that Protege-Frames provides standard slots which indicate the relationship between the selected item and the referencing frame. For example:

DIRECT-INSTANCES The selected item is a direct instance of the frame.

DIRECT-SUPERCLASSES

The selected item is a direct superclass of the frame.

DIRECT-SUBCLASSES

The selected item is a direct subclass of the frame.

SLOT-VALUE-TYPE

The frame is a slot and the selected item appears as one of its values. If the selected item is an instance, it may be a value. If the selected item is a class, it may be an Allowed Superclass (for a slot of type Class) or an Allowed Class (for a slot of type Instance).

The name of any other slot in the project may also appear in this column.

The Facet Column

This column gives information about the facet value for certain types of references and gives information about the slot relationships between classes. For example, an item may appear as a value for a slot which is called by that frame.

In the illustration above, the class Author appears as an Allowed Class for the slot author, as shown in the second row. In addition, the slot author appears as a slot for the class Article. Therefore, Article references Author. This reference appears in the fifth row in the example.

For an embedded reference of this type, the facet value column specifies whether the selected item appears as an Allowed Class or an Allowed Superclass.



Creating a New Class

To create a new class:

  1. In the Class Browser, highlight the class that you want to be the superclass of the new class.

    Class Browser, "Author" class highlighted
  2. Click the Create Class (classes_class.create) button in the class buttons area at the right of the Class Browser. Alternatively, you can click the right mouse button and select Create Class from the class menu.

    Class menu, "Create Class" selected
  3. The new class will be added under the highlighted class. It will have a default name, such as newspaper_Class_1.

    addition of newspaper_Class_1 class
  4. Use the Class Editor to name the class, choose its role, create constraints, and create and edit slots. See Editing a Class for more information.

The Class Constraints paneThe Class Documentation paneThe Class Name fieldNote iconsThe Class Role menuThe Template Slots pane
Class Editor



Creating Multiple Subclasses

Protege-Frames supplies a wizard that lets you quickly create multiple subclasses of a selected class.

  1. At the Classes tab, select the class you want as a superclass for the classes you create.

  2. Select Tools | Wizards, then select Create multiple subclasses from the submenu.

  3. Set your options:

    • To have all classes you create begin the same way, enter an optional prefix.

      Create multiple subclasses dialog, entering a prefix
    • To have all classes you create end the same way, enter an optional suffix.

    • If you select Tab indent to create hierarchy, you can use tab indents, as described in Step 5.

  4. Enter your class names:

    • Type the name of a class, then press Enter to begin entering a second class.

    • You can edit or delete the name of any class you have already entered by moving the cursor to that name. You can also cut and paste text within and between class names.

    • If you enter an invalid character (e.g., /) in a class name, the name will be highlighted in red. You can edit the class name from the keyboard, or you can click Tidy to have Protege automatically substitute an underscore (_) for each invalid character.

  5. To create subclasses of a class, make sure that Tab indent to create hierarchy is selected. Then, use the tab key to create a hierarchy:

    • No tabs means the class will be a direct subclass of the selected superclass.

    • A single tab means the class will be a subclass of the nearest untabbed class above it in the list.

    • N tabs means the class will be a subclass of the nearest class with N-1 tabs above it in the list. For example, suppose you are creating subclasses of Superclass and you enter the following:

    1. Subclass direct subclass of Superclass

    2. Subclass_II direct subclass of Superclass

    3. SubSubclass subclass of Subclass_II

    4. SubSubSubclass subclass of SubSubclass

    5. SubSubclass_III direct subclass of Superclass

      Note: Extra Tab characters will be ignored. For example, if you insert a Tab before the first class name in the list, it will still be created as a direct subclass of the selected superclass.

  6. Click Finish or type Ctrl-Enter (Cmd-Enter). The wizard will display a list of classes that have been added. This is informational only - you cannot cancel at this point.

    Create multiple subclasses dialog, result display
  7. Click Finish to exit the wizard.

    wizard exited; result appears

The new classes will inherit all the properties of their superclass. If you wish to make any additional edits to your classes (e.g., attach an additional slot or override an inherited slot), use the Class Editor.



Deleting a Class

Deleting a class deletes the class and all of its subclasses. Once a class has been deleted, it cannot be recovered. You may wish to archive your project before deleting.

Deleting a Single Class

To delete a class from the knowledge base:

  1. Highlight the class you want to delete in the Class Browser.

  2. Click the Delete Class (classes_class.delete) button or click the right mouse button and choose Delete selected class from the Class menu.

  3. You will be prompted for confirmation. Click OK. The selected class and any subclasses will be deleted.

Deleting Multiple Classes

To delete multiple classes:

  1. Highlight one or more classes in the Class Browser. To highlight multiple classes, hold down the Ctrl (Cmd) key while clicking each class. To highlight a range of classes, click the first class, then hold down the Shift key and click the last class in the range.

  2. Click the Delete Class (classes_class.delete) button. You cannot use the Class menu to delete multiple classes.

  3. You will be prompted for confirmation. Click OK.

Undeletable Classes

The following types of classes cannot be deleted:

  • system classes

  • classes included from another project



Displaying the Class Editor

You can view or edit an existing class using the Class Editor.

Note: If the class is a system class or has been included from another project, it cannot be edited. Included classes are shown with a pale class icon to the left.

Whenever you enter changes into the Class Editor, they are immediately visible everywhere in the project. To write the changes to disk, select File | Save Project.

Using the Classes Tab

To view or edit a class from the Classes tab:

  1. Select the class you want to edit in the Class Browser in the Classes tab.

  2. Enter the updated information directly in the Class Editor to the right.

Displaying the Class Editor as a Free-standing Window

You can open the Class Editor to view or edit a class anywhere the View Class (classes_class.view) button appears, including the following locations:

To view or edit a class using the Class Editor:

  1. Select the class you want to edit.

  2. Click the View Class (classes_class.view) icon at the upper right of the pane to open the Class Editor as a free-standing window.

To view or edit the information for several classes at once, open a separate Class Editor for each class. Opening a new Class Editor does not close the previous editor. This allows you to compare the attributes for two or more classes. Edits can be made directly in any open Class Editor.

Managing Multiple Editors

If you have multiple editor windows open, you can manage them as follows:

  • Cascade multiple windows by selecting Windows | windows_cascade_windows Cascade Windows.

  • Close all open editor windows by selecting Windows | windows_close_all_windows Close All Windows.



Editing a Class

Using the Class Editor, you can view or edit a class's constraints, documentation, name, notes, or template slot fields.

Changing ConstraintsChanging Class DocumentationChanging the Name of a ClassWorking with Class NotesChanging the Role of a ClassWorking with Template Slots
Class Editor

Any changes you enter into the Class Editor take effect immediately. To make the changes permanent, save the knowledge base by selecting Save from the Project menu. To revert to the last saved version, close Protege-Frames without saving changes. If you have made extensive changes to your knowledge base during the current session, you may wish to save or archive the project before editing classes.

Working with Class Notes

The note icons (windows_class_note.hide, windows_class_note.create, windows_class_note.delete) at the upper right of the Editor allow you work with class sticky notes. These notes, which are not part of your ontology, can be used for todos or communication while you are developing your knowledge base.

  • To hide or show all class notes, click the Hide Class Notes (windows_class_note.hide) button.

  • To create a note for the current class, click the Create Class Note (windows_class_note.create) button.

  • To delete a note from the current class, click the Delete Class Note (windows_class_note.delete) button and then select the note from the list.

For more information, see Working with Notes.

Notes are not available when working with the Editor as a free-standing window.

Changing the Name of a Class

To change the name of a class, edit the name in the Name field. The following rules apply to class names:

  • The name must be a unique frame name in the knowledge base.

  • Class names are case sensitive.

Note: A recommended convention is to make the first character of each word in a class name uppercase and the rest lowercase, and to separate words by underscores.

Changing the Role of a Class

Select the new role from the Role menu. Concrete classes may have direct instances, but do not have to; abstract classes cannot have direct instances. Protege-Frames does not impose any restrictions on the role of your classes.

Changing Constraints

Class constraints are defined programmatically. See Constraints for more information.

Changing Class Documentation

To change the notes for a class, change the text directly in the Class Documentation pane.

Working with Template Slots

The Template Slot buttons at the Template Slots pane allow you to:

For more information about working with slots, see the Slots Table of Contents.

Other Class Editing Operations

Viewing Multiple Classes

To view or edit the information for several classes at once, select the classes one by one and click the View Class (classes_class.view) button to open the Class Editor for every selected class. Opening a new Class Editor does not close the previous editor. This allows you to compare the attributes for two or more classes. Edits can be made directly in any open Class Editor.

Changing Superclasses

To change the superclasses of a class, see: Adding a Superclass, Replacing a Superclass, and Removing a Superclass.



Editing Template Slots

The Template Slots pane in the Class Editor allows you to add, clear, create, edit, override, and remove slots.

Editing a Top-level Slot

To edit a slot at the top level:

  1. Highlight the slot name in the Template Slots pane.

  2. Click the View Top-level Slot (slots_slot.view_top_level) button at the top right of the pane. The Slot Editor will be displayed.

  3. Use the Slot Editor to edit slot properties such as Name, Type, and Cardinality, and to add notes. See Viewing a Slot for more information on how to edit a slot.

Overriding a Slot at a Class

To override a slot at the class:

  1. Highlight the slot name in the Template Slots pane.

  2. Click the View Slot Overrides (slots_slot.view_overrides) button at the top right of the pane. The Slot Editor will be displayed.

  3. Use the Slot Editor to edit slot properties such as Name, Type, and Cardinality, and to add notes. See Viewing a Slot and Overriding Slot Properties at a Class for more information.

Your class can have slots that were inherited (slots_slot.inherited) from a superclass. If the slot is inherited, there are limitations on the edits that can be performed. Direct slots, which were created or added at the level of the slot, have no editing restrictions.

If you edit a slot at the class level, the slot is displayed with an override (slots_slot.overridden) icon.

Creating a New Slot

You can define a new slot for your class.

  1. Make sure the correct class is highlighted in the Class Browser.

  2. Click the Create Slot (slots_slot.create) button at the top right of the pane. The Slot Editor will be displayed.

  3. Use the Slot Editor to edit slot properties such as Name, Type, and Cardinality, and to add notes. See Creating a Slot for more information on how to create a slot.

A direct slot is displayed with a blue (slots_slot) icon.

Clearing Slot Overrides

If you have overridden a slot at the class, you can remove your overrides and use the top-level definition of the slot:

  1. Highlight the slot name in the Template Slots pane.

  2. Click the Remove Slot Overrides (slots_slot.remove_overrides) button at the top right of the pane. Any changes you made at the class level are removed and the top-level definition of the slot is used. See Removing Overrides From a Slot for more information.

Adding an Existing Slot to a Class

Once slots have been created, you can add them to more than one class. For example, the Prototype_Newspaper class has a Weekday slot, which can be used to choose among the days of the week. If you were creating a new type of employee who wrote a weekly feature, you might want to reuse this slot.

To choose a pre-existing slot to add to your class:

  1. Make sure the correct class is highlighted in the Class Browser.

  2. Click the Add Slot (slots_slot.add) button at the top right of the pane. The Select Slots dialog box displays all the slots that you can add to the class.

  3. Highlight the slot that you wish to add to your class.

  4. Click OK.

The new slot is added to the Template Slots pane. It is a directly-attached slot and is displayed with a blue (slots_slot) icon. You do not need to name the slot; however, you may need to override its facets. If you wish to override the facets on the slot, you may click the View Top-level Slot (slots_slot.view_top_level) or View Slot Overrides (slots_slot.view_overrides) button to display the Slot Editor. See Viewing a Slot for more information.

Removing a Slot

You can remove any direct slot that appears in the Template Slots pane. To remove a slot:

  1. Highlight the slot

  2. Click the Remove Slot (slots_slot.remove) button. The slot will be removed from the class.

Note that the slot has not been deleted from the knowledge base. It will still appear in the Select Slots dialog box (see

      Adding an Existing Slot to a Class, above)

and the Slots tab. See Deleting a Slot for more information.



Finding a Class

To find a class in the Class Browser:

  1. Type all or part of the name of the class in the Class lookup bar. Matches will be found for classes whose names begin with the entered text. Matching is case-insensitive.

    Class lookup bar
  2. Press Enter/Return or click the Search for Class (classes_class.search) button. If there is one match, the class will be highlighted. Otherwise, you will get a dialog box of all the matches, and you will be able to select one.

    search results dialog box

If a matching class is not currently visible in the Class Browser, Protege-Frames automatically scrolls to the correct location and expands the hierarchy to make the class visible.

Note: If you are unable to find the class you are looking for, the class may be hidden. To verify that hidden classes are displayed, choose Project | Configure, go to the Options tab, and make sure the Display Hidden Classes option is checked. Hidden classes are shown with a gray icon (e.g., classes_class.gray).



Hiding a Class

You can hide a class, using the Class menu. Hidden classes are still part of your project, but are not visible. You can use this, for example, if you want to restrict the user's view to a part of your knowledge base, but want to retain the structure of the larger project. All subclasses of a hidden class are also hidden.

You can choose whether or not hidden classes are displayed in the Class Browser by choosing Project | Configure, going to the Options tab, and toggling the Display Hidden Classes option. See Configuring a Project for more information.

Hiding a Class

To hide a class:

  1. Select the class in the Class Browser.

  2. Click the right mouse button to display the Class menu.

  3. Select Hide Class and click the left mouse button.

    Class menu, "Hide Class" selected
  4. If hidden classes are visible in your project, you will see a gray icon (e.g., classes_hide_c1), indicating that the class is hidden. If hidden classes are not visible in your project, you will no longer see the class or any of its subclasses.

Making a Hidden Class Visible

To make a hidden class visible:

  1. If you cannot see your class because hidden classes are not currently displayed, make hidden classes visible. To do this, choose Project | Configure, select Options, and make sure that Display Hidden Classes is selected.

  2. Select the class you wish to make visible.

  3. Click the right mouse button to display the Class menu.

  4. Select Make Hidden Class Visible and click the left mouse button.

    Class menu, "Make Hidden Class Visible" selected

    Note: If your class has a superclass which is hidden, it will still not display.

  5. The gray icon will be removed from your class.



Replacing a Superclass

You can move a class to a different superclass, using drag-and-drop in the Class Browser. This will remove the class from one superclass and make it a subclass of another superclass. Note that when you replace the superclass of a class, the class will often lose and gain inherited slots.

Moving a Class

To move a class:

  1. Select the class you want to move. If the class has more than one superclass, select the view of the class that appears under the superclass you want to replace.

  2. Hold down the mouse button and drag the class on top of the new superclass.

  3. Release the mouse. The subclass will no longer be under the original superclass, but will now be located under the new superclass. Note that the slots of the moved class will automatically change to reflect the inheritance from its new superclass.

You can also add a superclass by holding down the Ctrl (Cmd) key while you drag.

Example

The following example shows how to make Columnist inherit from Employee, rather than the class Person.

  1. Highlight Columnist in the Class Browser. Because Columnist has more than one superclass, you must make sure to select the copy of Columnist that is under Employee. (When a class has more than one superclass, you can use the Superclasses pane to select the copy that you want. See Jumping to a Different Superclass for more information.) Note that the Template Slots pane for Columnist includes slots it inherits from Employee.

    Class Browser, "Columnist" selected
  2. Hold down the mouse button and drag Columnist on top of the new superclass Person.

  3. Release the mouse button to drop the class. Person is outlined and the Class Browser redisplays to show the new hierarchy. The dragged class and all of its subclasses, if any, will be moved from the original superclass to the new superclass.

    Class Browser, "Person" outlined, "Columnist" selected

If you highlight Columnist after it has been repositioned, you will see that some of the slots it had before are now missing. These were the slots it inherited from Employee.

Class Browser, "Columnist" selected, some slots missing



Adding a Superclass

Classes in Protege can have more than one superclass. Classes inherit the properties of every one of their superclasses, so by adding a superclass to a class, you are adding all of its slots as well.

Note: If you cannot see the Superclasses pane, your window may be too small. You can see the pane by enlarging your window or by dragging the slider bar at the bottom of the Class Browser. See Working With a Small Window for more information.

Adding a Superclass in the Superclasses Pane

To add a superclass using the Superclasses pane:

  1. Select the subclass in the Class Browser.

  2. Click the Add Superclass (classes_class.add) button in the Superclasses pane (located at the bottom left of the Classes tab, below the Class Browser). A Select Classes window will appear.

    Superclasses pane, "Employee" selected
  3. Choose the additional superclass(es) you want from the Select Classes window. To highlight multiple classes, hold down the Ctrl (Cmd) key while clicking each class. To highlight a range of classes, click the first class, then hold down the Shift key and click the last class in the range.

    Select Classes window, ":THING" selected

Note: If nothing happens when the class is dropped over a new superclass, the target class is not allowed to be a superclass of the dragged class. For example, descendants of the dragged class are excluded.

Adding a Superclass Using Drag-and-Drop

To add a superclass, using drag-and-drop in the Class Browser:

  1. Select the subclass in the Class Browser.

  2. Hold down the mouse button and drag the subclass over the additional superclass.

  3. Hold down the Ctrl (Cmd) key and release the mouse button to drop the subclass. The system will add the new superclass to the subclass.

Note: If you do not hold down the Ctrl (Cmd) key when releasing the mouse, the operation is interpreted as Moving a Class.

Multiple Superclasses and Inheritance

Adding a superclass results in more than one superclass for a class, which then inherits the slots and facets of all of its superclasses. For example, the Columnist class in the Newspaper example has two occurrences in the Class Browser: one with the superclass Author, and one with the superclass Person; it inherits slots from both superclasses.



Jumping to a Superclass

If a class has more than one superclass, you can use the Superclasses pane to jump from one superclass to another in the Class Browser.

Note: If you cannot see the Superclasses pane, your window may be too small. You can see the pane by enlarging your window or by dragging the slider bar at the bottom of the Class Browser. See Working With a Small Window for more information.

To jump to another superclass:

  1. Highlight any occurrence of the class in the Class Browser. The superclasses of the class are displayed in the Superclasses pane, located at the lower left of the Classes tab, below the Class Browser.

  2. Click on any superclass in the Superclasses pane. The highlight in the Class Browser automatically moves to the occurrence of the class which is directly under the chosen superclass. If the copy is not currently visible in the Class Browser, Protege-Frames automatically scrolls to the correct location and expands the hierarchy to make the class visible.

In the illustration below, if you clicked on Employee in the Superclasses pane, the highlight in the Class Browser would jump to the copy of Columnist under Employee. If the Employee hierarchy was not currently expanded, it would expand to display the Columnist class.

Class Browser, "Editor" and "Author" selected



Removing a Superclass

If a class has more than one superclass, you can remove one or more of its superclasses. You must leave at least one superclass. The subclass still appears in the knowledge base as a subclass of its other superclass(es).

Note: If the class has only one superclass, the Remove Superclass (classes_class.remove) button is disabled.

Removing a Superclass

To remove a superclass from a class:

  1. Highlight the class that you want to work with in the Class Browser. The superclasses of the selected class will be shown in the Superclasses pane immediately below the Class Browser.

  2. Highlight the superclass you want to remove in the Superclasses pane.

  3. Click the Remove Superclass (classes_class.remove) button at the top right of the Superclasses pane. The superclass will remain in the knowledge base, but the superclass/subclass link will be broken.

Example

For example, to remove Employee as a superclass of Columnist in the newspaper project:

  1. Highlight Columnist in the Class Browser.

    Class Browser, "Columnist" highlighted
  2. Highlight Employee in the Superclasses pane.

    Superclasses pane, "Employee" highlighted
  3. Click the Remove Superclass (classes_class.remove) button at the top right of the Superclasses pane.

Columnist remains a subclass of Author.

To delete a class from the knowledge base, highlight the class and click the Delete Class (classes_class.delete) class button. See Deleting a Class.



Viewing Class Relations

If Class_A has a direct slot of type Class or an Instance that includes Class_B in the allowed class(es) of the slot, we say that Class_B is related to Class_A. The Relations menu, available by clicking on the arrow to the right of the class buttons, allows you to choose which relation between classes to show in the Class Browser. This help topic describes the choices on the Relations menu.

Class Relations icon

Example

For example, the responsible_for slot at the Editor class is a class of type Instance that has Employee as an allowed class; this means that Employee is related to Editor.

Relations Menu for Editor

The picture below shows the Class Relationship menu for the class Editor in the Newspaper example. Editor has two Instance slots, responsible_for and sections.

Class Relationship menu, "Show Relation responsible_for" selected

Note: If the highlighted class does not have any related classes, the menu only displays Show Class Hierarchy and Show all Relations.

Selecting Show Relations responsible_for changes the Class Hierarchy window to display only the classes that are related to Editor through the responsible_for slot.

Class Browser, "Editor" selected

The Relations Menu

Show Class Hierarchy

The default Show Class Hierarchy displays the subclass-superclass hierarchy of your knowledge base. All the classes in the knowledge base appear in the displayed tree. (Some classes may be hidden. You can choose whether or not hidden classes are displayed in the Class Browser by choosing Configure from the Project menu, going to the Display tab, and toggling the Display Hidden Classes option.)

Show All Relations

Show All Relations displays a hierarchy of classes that are related to the selected class via its slots, as follows:

  • The root is the class (Class_A) that was highlighted when Show All Relations was selected.

  • The next level (direct children) consists of any classes (Class_B1, Class_B2, etc.) that are related to Class_A through one or more of its slots.

  • The next level consists of any classes (Class_C1, Class_C2, etc.) that are related to one of the classes on the previous level (Class_B1, Class_B2, etc.), through one of the slots of Class_A. Note the following:

    • A class Class_C1 is shown as a child of the class it is related to.

    • If a class is related to more than one class on the previous level, it is shown everywhere it occurs (multiple superclasses).

    • Only classes related through the slots of Class_A are shown; if Class_X is related to Class_B through a slot that is not attached to Class_A, it will not appear.

  • Subsequent levels continue the tree of classes that are related to the higher classes via the slots of Class_A.

It is possible (and sometimes useful) to have a recursive relation: Class_A appears somewhere subordinate to Class_A on the tree. This can happen, for example, if Class_B is related to Class_A, which in turn is related to Class_B through a different slot. In this case, all the levels are shown from Class_A to Class_A and the second instance is labeled (recursive).

Show Relation slot

Selecting a slot from the menu will show the hierarchy of classes, starting at the selected class, that are related to each other only through the slot selected on the menu. The slot-specific view can be read as "parent-relation-child", where "relation" is the slot selected on the Relations menu. For example, in the responsible_for view, Editor - is responsible for - Employee.

This view is not necessarily a subset of the Show All Relations view. If Show All Relations has recursion, the view restricted to a single slot can be quite different and possibly more extensive. Consider the following situation:

  • Class_A and Class_B both have slot_a and slot_b.

  • Class_B is related to Class_A through slot_a.

  • Class_A is related to Class_B through slot_b.

  • There are a number of additional classes that are related to Class_B through slot_a.

In this case:

  • Show All Relations will display Class_A and Class_B in a two-level recursion; the class relations from slot_a at Class_B are not shown.

  • Show Relation slot_a will show the classes that are related to Class_B through slot_a and any children of those classes.

It is also possible to view a list of all the frames that reference a highlighted class, using the References Class (classes_class.view_references) button. See Viewing References for more information.



The Classes & Instances Tab

The Classes & Instances tab is an optional tab that combines the functionality of the Classes tab and the Instances tab in a single window. In this window, you may view, create, and edit classes and instances.

To display the Classes & Instances tab, use the Configure Project dialog box.

Classes & Instances tab, "Editor" and "Author" selected

The Classes & Instances tab includes the following components:

  • A Class Browser at the left shows and allows you to work with the class hierarchy (e.g., creating and deleting classes).

  • An Instance Browser allows you to create and delete instances.

  • An Editor window on the right displays the information for the current selection. When a single class is selected, the Editor window contains the Class Editor for the selected class. When a single instance is selected, the Form pane contains the Instance Editor for the selected instance.

For information about the Classes tab user interface and accomplishing class-related tasks, see the Classes Table of Contents. For information about the Instances tab user interface and accomplishing instances-related tasks, see the Instances Table of Contents.



Viewing References

In a complex project, it is possible to have many different relationships between classes, instances, and slots. The References window allows you to view a list of all the frames that reference a value.

Note: For classes, it is also possible to view those classes that are related through one or more slots. See Viewing Class Relations for more information.

"References to ..." dialog, "name" selected

Viewing the References Window

To open the References window:

  1. Highlight the item for which you wish to see a list of references. Make sure to go to the correct location:

    • For a class:

      1. Go to the Classes tab.

      2. Highlight the item in the Class Browser.

      3. Click the View References to Class (classes_class.view_references) button.

    • For an instance:

      1. Go to the Instances tab.

      2. Highlight the class where the instance appears in the Class Browser.

      3. Highlight the instance in the Instance Browser

      4. Click the View References to Instance (instances_instance.view_references) button.

Viewing the Editor for a Reference

To open the Editor for any of the frames shown in the References window:

  1. Click on the frame to highlight it.

  2. Click the View Reference (all_object.view) button.

Viewing References to a Value

To view the references for any of the frames shown in the References window:

  1. Click on the frame to highlight it.

  2. Click the View References to Value (all_object.view_references) button.

For example, clicking on Content in the above window and then clicking View References to Value (all_object.view_references) would show the references for Content. This allows you to view references to a slot.