The Class Hierarchy Viewer

The class hierarchy viewer is the viewer that you will be in by
default when you first start up the GKB-Editor. It allows you to
incrementally browse the class-instance taxonomy. The class hierarchy
is drawn as a tree-structured graph in which each frame is a node in
the graph, and directed edges are drawn from classes to subclasses and
instances. If a frame has multiple superclasses, an edge is drawn
from each superclass to the frame. Classes are distinguished visually
from instances. By default, browsing starts at the root of the class
hierarchy. This can be changed, however. A sample hierarchy browse
is shown in the figure below. Classes are drawn
in red, and instances are drawn in blue. Notice that some class
labels are drawn in bold type, and there are some additional nodes in
black labelled N more. These are described below in
the section on incremental browsing.

From the class hierarchy viewer, you can create, delete,
and rename classes and instances, as well as change the position of
any frame within the class-instance hierarchy. You can also perform
operations on the KB, change various preferences, and start up one of
the other two viewers.

A connection specifies the location of an OKBC-compliant
knowledge base server. For example, for a KB residing on a remote
server, a connection may enocde the host name and port number. Before
a KB can be accessed, a connection must be established to a knowledge
base server.

At present, three types of connection are supported: local,
simple network and KSL Network. The local
connection is used to access a KB that resides on the same
machine as the one on which the GKB-Editor is running. There is only
one local connection, and it is always open. A simple
network connection encodes only a host name and port number. It
can be used to connect to an OKBC server that does not require user
name and passowrd. A KSL network connection is used for
connecting to the Ontolingua server.

If you select the KSL Network Connection, you will be
prompted for a host, a port, a user name and a password. The user name
and password can be obtained from the Ontolingua server. After
authentication for the user name and password is successful, you will
be prompted for the session information. You can choose between an
existing session and a new one. If you choose to connect to a new
session, you have to choose the group of the session, its description
and a duration in hours. Once done the GKB-Editor displays a message
aknowledging the connection.

The Connection menu can be used to open or close a
connection. When a user performs a KB operation, she is asked to
select a connection. The user may select one of the avilable
connections or establish a new one. If a user saves
preferences associated with a KB, the connection information
associated with that KB is recorded with the preferences. If the user
attempts to open the same KB using the Select
KB command, GKB-Editor will try to open the KB by reusing the
connection information as recorded in the preferences.

Initially, when you start up the GKB-Editor, usually no KB will be
open yet (even if you have loaded a KB by other means before starting
the GKB-Editor, the KB will usually not be visible to the GKB-Editor
unless you officially open it using the GKB-Editor or with OKBC
commands). If no KB is open, most of the menu commands will be
disabled, and the status line will contain the message Create or
Open a KB. To create or open a KB, select New
or Open from the Knowledge Base
menu. If creating a new KB, you will be prompted for a name, package
and filename for the new KB. If opening an existing KB for the first
time, you will be prompted for a filename. After checking that the
file exists, and trying to determine the KB name and package from the
file contents, the GKB-Editor will ask you to verify the KB name and
package before opening the KB.

The GKB-Editor stores a record of KBs that you have opened in the
past, so in subsequent sessions when you invoke the
Open command, as a shortcut, you will be offered a
menu of KBs that you have previously worked with (if they still
exist). The menu also has an option (Other...) to select
a KB not on the list, in which case, you must go through the set of
dialogs described above.

If your FRS permits you to have multiple KBs open at once, the
Select command enables you to switch between open
KBs. Other operations that are accessible from the Knowledge
Base menu enable you to save, revert, close, or destroy a KB.
There are also limited KB analysis tools available. These commands
are described in more detail below.

New (Meta-o)
Create, open, and select a new KB. The user is
prompted in a dialog for a name, package, and file in which to save
the new KB. If multiple supported FRSs are present in memory, the
user must also select which FRS to use. The new KB will have no frames in it. Consequently,
the only frame operation permitted at this point is class frame
creation.

Open (Ctrl-o)
Open and select a preexisting KB. A menu of known KBs is popped
up. The user may choose one of these KBs, or is prompted for a
filename, etc. for the KB to open. The KB is then loaded into memory. It is an error for the KB not to exist in the specified
file.

Select (Ctrl-O)
A menu of currently open KBs is popped up. The selected KB
will become the current KB to browse and edit.

Save (Ctrl-s)
Save the current KB to the file specified when the KB was created,
opened, or last saved.

Save As (Ctrl-S)
Save the current KB to a new file. The user will be prompted for
a filename to save to.

Revert to SavedReload the KB from secondary storage. Any changes made since the last save
will be lost.

CloseClose the current KB and flush it from memory. If the KB has been
modified, you will be prompted whether or not to save it first.

DestroyClose the current KB and delete the associated file on secondary storage.

Analyze
This command collects statistics on the current KB and
displays them in a popup window. The types of
statistics that are generated include number of classes and
instances, depth of the class hierarchy, percentage of primitive
classes, average number of slots per frame, average number of
values per slot, etc.

Analyze Subtree
This command collects statistics on a subtree of the KB class
hierarchy and displays them in a popup window. If you have
selected a class frame, it will be the root of the analyzed
subtree. If no frame has been selected, you will be prompted for
the root.

To begin browsing initially, select the Browse
Class Hierarchy command from the View menu. You may also
begin browsing by selecting the Browse from New Root(s)
command: this command requires that you enter the name of a frame to
serve as the root. Subsequent browses invoked using the
Browse Class Hierarchy command will then use this
same root. The GKB-Editor has a sophisticated incremental browse
facility that allows you to reduce screen clutter and screen redisplay
time by drawing only the parts of the KB that you wish to see. Thus,
initially, you will see only the top few levels of the class
hierarchy, and classes with many children will show only a truncated
list of children. The degree to which the graph is initially expanded
is determined by a depth limit and a breadth limit, which you can
change using the Incremental Expansion
dialog (you can also change the way the root nodes are chosen
with this command). If a node has children that are not displayed
because of the depth limit, that node, called a depth cutoff
node, will be displayed in boldface. If a node has more children
than the breadth limit, then only the number of children up to the
breadth limit will be displayed. An additional node, a breadth
cutoff node, will be drawn with the boldface label N more,
where N is the number of remaining children. A number of depth and
breadth cutoff nodes are shown in the figure above.

It is possible to also specify whether the depth limit is a hard
depth limit or not. If a hard limit is used, then expanding one
branch of the tree will cause expanded branches in other sections of
the graph to be compacted. This allows you to focus in on only the
current region of interest.

To expand a depth or breadth cutoff node, middle click on the node,
Expanding a depth cutoff node causes its children to be drawn.
Expanding a breadth cutoff node, or a node that has a breadth
cutoff node for a child, causes the breadth limit for that node to
double, and the additional children are drawn up to the new breadth
limit. Attempting to expand a node that is neither a depth nor
breadth cutoff has no effect. Middle clicking on a node while holding
the Shift key down compacts the node, erasing all its children and
turning that node into a depth cutoff node. Right clicking on a node
brings up a menu of operations. The possible operations (not
all operations may be applicable to every node) include:

Select children to expand

Expand all children

Expand all descendants

Expand parents

Erase node and its descendants

Change browsing parameters

There are times when you may wish to expand the browse all the way to
some frame, without knowing exactly which sequence of classes need to
be expanded in order to find the frame. To do this, invoke the
Find command from the Frame menu.
You will be prompted (with completion) for the name of a frame to
find. If the frame is present in the KB, the current browse will be
expanded to make it visible, and the frame is highlighted. Sometimes,
no ancestor of the specified frame is currently visible in the
display, in which case the found frame is shown as a root frame with
no parent classes. In this situation, you must use the Expand
parents option in the right-click menu in order to determine the
frame's place in the class hierarchy.

You may also save a browse to a file, so that in subsequent sessions
you can begin browsing exactly where you left off. The Save
Browse and Load Browse commands are further
described below.

Browse Class Hierarchy (Ctrl-b)
Begin a new browse of the class-instance hierarchy. Any previous
expansions will be lost. Changes to browse parameters (i.e. through
the preference menus) that do not
take effect immediately will take effect after this command.

Browse from New Root(s) (Meta-b)
Begin a new browse of the class-instance hierarchy. You will be
prompted for one or more frames to serve as roots of the new
hierarchy. This command also changes your preferences such that
subsequent browses invoked using the Browse Class
Hierarchy command begin with the selected nodes.

Save Browse
You will be prompted for a filename. The current browse state
(i.e. which nodes are visible) will be saved to the designated
file.

Load Browse
You will be prompted for a filename containing a previously saved
browse. The browse will be reloaded and displayed. If the state
of the KB has changed since the browse was originally saved, the
loaded browse may have changed in appearance accordingly.

The Class Hierarchy Viewer enables you to create new frames and to
rename, delete, and change class-subclass and class-instance links for
existing frames. If an editing operation
acts on a particular frame, you will be required to select the frame
either before or after selecting the command. See the section on
selecting frames for more details. All of the editing commands can
be found under the Frame menu. These are described
below. To perform additional editing operations on an individual
frame, such as altering its slot values, you must invoke the Frame
Editing Viewer, which can also be done from this menu.

The following commands all operate on one or more frames. The first
few commands are not actually editing operations, but they may
facilitate selecting frames on which to perform editing operations.

Select AllMake all currently displayed frames part of the current selection.

Select DescendantsAdd all currently displayed descendants of currently selected
nodes to the current selection.

Select AncestorsAdd all currently displayed ancestors of currently selected
nodes to the current selection. This operation can also be useful for
highlighting the path of a particular frame back to the root.

Find (Ctrl-f)
You will be asked to type in a frame name. If the frame is already
visible in the graph, it will be highlighted. If the frame is
not yet visible, then the browse will be expanded until the
designated frame becomes visible.

List Frame Contents (Ctrl-l)
A list of direct superclasses, subclasses, and instances, and all
slot values is printed in a new window. Click on Dismiss to close the
window. This may be faster or a more compact display than
invoking the Frame-Editing Viewer in cases in which you only wish
to examine rather than modify the contents of a frame.

Edit instance of class (Ctrl-E)
For situations in which you are displaying classes only, or don't
wish to expand a class node, this command presents a menu of instances
of the currently selected class frame. The chosen instance may be
edited using the Frame-Editing Viewer.

Edit Loom DefinitionThis command is provided for users of Loom because the OKBC does
not provide support for all the possible types of constraints and
restrictions available in Loom. A text editing window is popped up
containing the Loom definition of the selected frame. It can be
edited using basic Emacs commands. Middle clicking in the editing
window closes the window, and causes the selected frame to be
redefined with the new definition. In general, changes made in this
fashion will not immediately update the graphical display.

Create Class (Ctrl-n)
Create a new class frame. The selected class frame(s) will be
used as the superclass(es) of the new class. You will be
prompted for a name for the new frame in a
small pop-up window.

Create Instance (Ctrl-N)
Create a new instance frame. The parent(s) of the new instance will be
the selected class frame(s). You will be prompted for a new name in a
small pop-up window.

Create Duplicate (Ctrl-d)
Create a new frame as a copy of the selected frame. If the
selected frame is a class, the new frame will be a class; if the
selected frame is an instance, the new frame will be an instance. The
new frame will have the same parents and slot values as the original
frame. You will be prompted for a name for the new frame in a
small pop-up window.

Rename (Ctrl-m)
Rename the selected frame. You will be prompted for a new name in
a small pop-up window.

Destroy (Ctrl-k)
Destroy the selected frame(s). If a class frame is destroyed, any
subclasses or instances of that class will become children of the
original frame's parent(s).

Destroy Subtree (Ctrl-K)
Destroy the selected frame(s). If a class frame is destroyed, any
subclasses or instances of that class are also destroyed. When this
occurs, the user is first prompted to make sure that is what was
intended.

Add Parent LinkThe user is asked to select a new class frame to serve as a parent
of the selected frame, and the new link is added.

Change Parent LinkThe user is asked to select a link to change by first selecting the child
frame and then the old parent (if necessary), and then to select a
class frame to serve as the new parent. The old link is deleted, and a new
link is created from the new parent to the old child.

Delete LinkThe user is asked to select a link to delete by first selecting
the child frame, and then the parent (if necessary). In the hierarchy
viewer, the parent child link is deleted. If the old child frame has
no remaining parents, it becomes a root.

The GKB-Editor is highly customizable, allowing users to specify via a
set of preference menus what should be displayed in the various viewers and
how various objects should be drawn.

In the hierarchy and relationships viewers, the user has a great deal
of control over how individual nodes are displayed. We provide a
style menu that allows the user to specify icon and label colors, icon
shape, and label font, face, and size. The user can define a style
for all frames satisfying some predicate. Any number of these styles
and predicates can be defined, and frames that satisfy more than one
such predicate will show characteristics of each corresponding style
(except where such characteristics conflict with each other).
Currently, only a small number of predefined predicates are available,
such as for identifying classes, instances, primitive classes, for
testing frames for a particular user-specified slot value, or
identifying all children of a particular class. Future versions of
the GKB-Editor may support a greater variety of predefined predicates,
or may permit arbitrary, user-defined predicates. Only two styles are
defined when the GKB-Editor is first installed, for class and
instance frames, respectively.

Preferences are made persistent by saving them in a profile.
A user's profile is saved in the file .gkb-prefs in the user's
home directory. There are two types of profiles: the User
Profile, which contains preferences that should be used for all
KBs opened by the user, and the KB Profile, which contains
preferences that apply only to a particular KB opened by the user.
One can also imagine a Global KB Profile that applies to a
particular KB for all users, but this has not been implemented. A
user may have only one User Profile, but many KB Profiles, one for
each KB. Preferences specified in the KB Profile override those in
the User Profile when that KB is open.

When saving preferences, in general you will be given a choice
whether a particular changed preference should be a part of the User
Profile, the KB Profile, both, or neither. However, some preferences,
such as those that refer to a particular frame in a KB, can only be
saved as part of a KB Profile. Upon invoking the Save Preferences command, you will be presented
with a dialog that lists the various options.

Incremental Expansion
Presents a dialog through which the user can alter browsing parameters (see the section on Incremental Browsing). You can designate new depth and breadth limits,
and whether or not a hard depth limit should be used. When the hard depth
limit is enforced and exceeded along a given branch of the class hierarchy,
all other branches of the hierarchy are collasped so the particular brach can
be browsed more intensely.
The user can choose whether the browsing root on a new
browse should be computed automatically, should be set to some default, or
should be taken from user input. If you wish to set a default, then upon
exiting the dialog, you will be asked to input a frame or series of frames to
serve as the default root(s). You can also decide whether the browse should
show class frames only, or both classes and instances. Some of these changes
will not take effect until a new browse is initiated.

Select Node Label Slots
For easier viewing, you may wish to include certain slot values as part of the
node labels. This command presents a menu of all slots in the KB and allows
you to choose which slots should be included in the node labels.

Redefining a Node Style
The list of currently defined node styles is presented to the user. The user can change the style definition for a particular style by clicking on
the "Redefine Style" command button after selecting a style from the provided
list. Then a dialog appears with the current definition, subject to change by the
user. The
style dialog lists various options for icon shape and color, and label size,
color, and font. If a particular option is left unspecified, or Default, then the
default value for that node will be used. This allows nodes to be displayed
using multiple shapes. For example, if grouping A specifies only the icon
shape, and grouping B specifies only the label color, then a node that is a
member of both groupings will be drawn with icon shape A and label color B.
However, if grouping B instead specified the icon shape, the node could be
drawn only as belonging to either grouping A or B, and not both. For this
reason, we encourage users to specify different options when defining styles for orthogonal
groupings, and to use the Default value for all other options. An
"Apply Style" button allows users to try out different style
combinations before exiting the dialog.

Removing a Node Style
Style information and grouping definition for the selected style can be
removed by using the "Delete Style" command button. The "Delete Style"
command button is enabled when a selected item can be deleted from the list
of existing styles. Upon deletion of the style, its definition name is
removed from the list and may be added to the list of possible styles to be
created by the user in the future.

Defining a New Node Style
The list of possible but yet undefined node styles is presented to the user. The user may
assign a node style to a new grouping of frames by applying the "Define Style"
command button to a selected item on this list. When the "Define Style"
button is pressed, the user will be offered a dialogue of options
(described above) with which
to define the new style. The user may define styles (if not already
defined) for class and
instance frames, primitive and non-primitive class frames, all children of a
particular class, and frames with a particular value for a particular
slot. If defining a style for all children of a particular
class, the user will be asked to type in the name of the class.
If defining a style for frames with a particular slot value, the
user will be asked to type in first the slot name, and then the
desired slot value.

Miscellaneous
The miscellaneous dialog askes the user whether the frame names should be case
sensitive or not. Additional options may be added to this dialog in a
later release of the GKB-Editor.

Save Preferences
You will be presented with a dialog that allows you to save any
changed preferences to either your User or KB Profile.
The next time you use the GKB-Editor
to access the same KB, these preferences will automatically take
effect. If you change your
preferences and forget to save them, you will be asked before you
exit the session whether or not they should be saved.

Revert to Saved
Revert to the preferences as of the last time they were saved.
Any preference changes made since then will be undone.

Revert to Default
Revert to the GKB-Editor default preferences. Any saved
preferences will be undone in the current session, but, unless you
save preferences again, will be available for subsequent sessions.

There are some additional miscellaneous commands that can be found in
the Application menu. These relate either to the
application as a whole (i.e. quit, print or help), or to invoking the
other types of viewers. Keep in mind that when opening additional
viewer windows, only the most recently created window will be active
and accepting commands. For example, if you open a relationships
viewer in the middle of browsing the class hierarchy, you must close
the relationships viewer before you can continue browsing the class
hierarchy. This is a limitation which we hope to overcome in a future
release.

Invoke Frame Relationships Viewer (Ctrl-r)
Open up a relationships viewer window and begin a new relationships browse. The
selected frame(s) will be the root of the relationship tree. If you have not previously selected
which slots to expand, all slots will be expanded.

Resume Frame Relationships Browse (Ctrl-R)
Open up a relationships viewer window, and continue the
relationships browse where it left off the last time a
relationships viewer window was open. This command enables the user
to switch back to a browse of frame relationships after browsing
the class hierarchy. If no current relationships browse exists, this command
will have no effect.

Invoke Frame Editor (Ctrl-e)
Invoke a Frame-Editing Viewer to edit the selected frame. This
command is identical to the Edit command in the
Frame menu, but is included here as well for
completeness.

Print Report
The Print Report command is only available in the taxonomy viewer. The
command provides the user with a textual reference of parts or all of any
knowledge base available to the user. When this command is invoked, the user
is presented with a dialog, allowing the user to specify the name of the file
the report should be written to(the default is "kbName.txt"). The user can
then choose from a list how much of the knowledge base should be printed to
the file. The user may choose to have to have a textual reference of the
entire KB or just selected frames. Other options are presented in the list.
The user can also specify which order the information should be written in,
either alphabetical order, depth-first order, or breadth-first order. This
order may or may not apply to all the options given in the list of parts of
the KB to print. For example, if the user chooses to have only the instances
printed, it doesn't make sense for them to come in depth-first order. They
are automatically printed in alphabetical order. The user is also asked which
slots and facets to include in the frames being printed to the file.