Previous Up Next

Chapter 8  The ConceptBase.cc Usage Environment

The ConceptBase.cc User Interface consists of two main applications:

CBIva
is the ConceptBase.cc Interface in Java that supports the editing of Telos frames, displays instances of Telos objects, etc.
CB Graph Editor
(or CBEditor) is a graphical browser for Telos objects. Telos objects can be represented by differented graphical types. Insertion and deletion of Telos objects is also supported.

The interface is based entirely on Java, so it should be usable on all platforms with a compatible Java runtime environment1. The Java interface includes a graphical browser and editor.

Both applications, CBIva and Graph Editor, can be run as a stand-alone Java application or as an applet inside a web browser. The use of CBIva as applet requires a browser with a Java Plugin. If you install a Java Runtime Environment on your machine, the plugin is usually also installed and configured for your browsers. Linux users might have to install the plugin manually into a dedicated directory of their web browser if they want to create web pages with CBIva or the Graph Editor as applets.

8.1  CBIva

CBIva is similar to the old CBworkbench used in earlier releases of ConceptBase. If you have installed a Java virtual machine, you can start the Java user interface by the command

  cbiva

We assume that <CB_HOME> is the installation directory of ConceptBase.cc2 and that it is added to the search path of executable programs. After a few seconds, the CBIva main window should pop up. If an error occurs you may have to edit the script/batch file so that the correct Java Virtual Machine is found. Figure 8.1 shows the main window connected to a server and gives a short description of the buttons in the tool bar. The user interface uses the MDI (multiple document interface) model, i.e. all windows are displayed as subwindows in the main window.


Figure 8.1: Main Window of CBIva

The main window consists of a menu bar, a tool bar with a button panel, the area for subwindows and a status bar. The first sub window, a Telos editor, can not be closed, because it also contains the history window, which records all operations for later reuse. In the following, each component of the user interface is explained.

8.1.1  The menu bar

File:
Connect:
Connect to a ConceptBase.cc server started in another shell/command window (see section 6)
Disconnect:
Disconnect from a ConceptBase.cc server
Load & Save Telos Editor:
Load or Save the contents of the current Telos Editor
Load Model:
Load a source model file (*.sml) into the server. As client and server are not supposed to share the same file system, this method is now implemented as a normal Tell method. The client reads the contents of the file into a string and sends the string to the server.
Start CBserver:
Opens a dialog and asks for the parameters to start a ConceptBase.cc server. If the information has been entered, the server will be started and its output will be captured in a separate window. The workbench will be automatically connected to that server3.
Stop CBserver:
Stops the ConceptBase.cc server, only allowed for the person who started the server
Close:
Close the CBIva Window, a CBEditor window remains open if available
Exit:
Exit CBIva and CBEditor
Edit:
Clear:
Clears the text area of the currently activated Telos editor
Cut,Copy,Paste:
Cut, copy or paste text to/from clipboard
Tell,Untell:
(Un-)Tells the text in the currently activated Telos editor
Retell:
A new window will popup and ask you to enter the frames that should be untold and told. The contents of the current Telos Editor will be inserted as default into the two text areas.
Ask Frame:
Temporarily tells the content of the Telos editor, extracts the query names from the frames, asks them as query calls without parameters, and returns the result in the Telos editor window
Ask Query Call:
The query calls4 (see section 2.3.1) listed in the Telos editor are asked and the result is returned in the Telos editor window
Load Object:
Load the Telos frame of an object into the Telos editor
View Object as Tree:
Opens a new window and shows the object in tree browser
Browse:
New Telos Editor:
Opens a new Telos editor (see section 8.1.4)
Display Instances:
Opens the display instances dialog (see section 8.1.6)
Frame Browser:
Opens the frame browser window (see section 8.1.7)
Display Queries:
Shows all queries stored in the current database and provides a facility to call these queries (see section 8.1.8)
Display Functions:
Shows all functions stored in the current database (see section 8.1.9)
Query Editor:
Opens the query editor (see section 8.1.10)
Graph Editor:
Opens the CB Editor (graphical browser, see section 8.2). If the interface is connected to a server, the graph editor will also establish a connection to this server and ask for the graphical palette, the initial object to be shown, and the module context (see section 5). Otherwise, the graph editor will start with no connection.
Options:
Set Timeout:
Set the number of milliseconds the user interface waits for a response of the server.
Select Module:
Select the current module (see section 5).
Select Version:
Select or create a new version. A version is a special object that represents the state of an object base at a specific time. By default, all queries are evaluated on the current state of the object base (version "Now"). By selecting another version, queries are evaluated wrt. to a previous state of the object base.
Pre-Parse Telos Frames:
If enabled, the user interface parses the contents of a Telos editor before it is send to the server. Thus, syntax errors might be already detected at the client side.
Use Query Result Window:
If enabled, the result of a query is shown in a separate window in a table view.
Look and Feel:
You can switch the look and feel to an other style:
Windows:
Like Microsoft Windows
Motif:
Like Motif
Metal:
Default Look and Feel (Swing)
Help:
ConceptBase.cc Manual:
Opens a window with the online-version of this ConceptBase.cc manual
ConceptBase Tutorial I/II:
Opens a window with the online-version of the respective tutorial
CB-Forum:
Opens a window to the public version of the ConceptBase Forum with lots of examples
About:
Shows a dialog with information about this program
License:
Displays the license of ConceptBase.cc in a new window
History:
Load History:
Load previously saved contents of the history window.
Save History:
Save contents of the history window to a file.
Redo History:
Redos certain operations which are currently in the history. The operations can be selected from a list.
Set History Options:
Select the type of operations that should be displayed in the history window .

8.1.2  The tool bar

The tool bar is the button panel below the menu bar. All buttons have tool tips, i.e. small messages that show the meaning of these buttons. The tool tips appear, if you move your mouse pointer over the button and do not move your mouse for about one second. The buttons are shortcuts for some operations that are frequently used and are also available in the menu. The operations apply to the Telos Editor which has currently the focus.

You can move the tool bar outside the main window or display it in vertical form, if you click inside the tool bar and drag it to another place.

8.1.3  The status bar

The status bar contains some fields that display general information about the status of the application.

8.1.4  Telos editor

The Telos Editor is an editable text area, where you can edit Telos frames. The operations can be executed from the menu bar or the buttons in the tool bar. Furthermore, the text area has a popup menu on the right mouse button with the following items.

Display Instances:
Displays the instances of the currently marked object
Load Object:
Loads the Telos frame of the currently marked object into the Telos editor
View Object as Tree:
Opens the tree browser with the currently marked object as root
Display in Graph Editor:
Shows the object in the current window of the graph editor. The graph editor has to be started before (menu Browse)
Clear,Cut,Copy,Paste:
same as in the menu bar

8.1.5  History window

The history window is part of the main Telos editor. It stores all operations and their results, so that they can later be used again. The buttons scroll the history back or forward, copy the text into the Telos editor or redo the operation in the history window (see figure 8.2). If the current operation is an “ASK”, then a single click on the copy-button will copy the query to the Telos Editor, and a double click will copy the result of the query. The size of the history window can be reduced by using the slider bar between the Telos editor and the history window.


Figure 8.2: Buttons of the History Window

8.1.6  Display instances

This dialog displays the instances of a class. The class is entered in the text field. When you hit return or press the “OK” button, the instances of this class will displayed in the listbox.

If you double click on an item in the listbox, the instances of this item will be displayed. The frame of a selected item can be loaded into the Telos editor by clicking the “Telos Editor” button. A history of already displayed classes is stored in the upper right selection list box. The “Cancel” button closes the dialog.

8.1.7  Frame browser

The Frame Browser (see figure 8.3) shows all information relevant to one object in one window. The window contains several subwindows with list boxes that show super- and subclasses, the classes, the instances, attributes and objects refering this object. In the center of the window, a small window with the object itself is shown. To view the attributes of the object, you must first select the attribute category in the subwindow “Attribute Classes”.


Figure 8.3: Frame Browser

The Frame Browser can be used with and without a connection to a ConceptBase.cc server. If it is not connected, it retrieves the information out of a local cache, which can be loaded from a file by using the “Load” button. The file has to be plain text file with Telos frames. All objects in the cache can be saved into a text file as Telos frames with the “Save” button. The contents of the cache can be viewed with the “Cache” button. The result of a query can be added to the cache by using the “Add query result” button.

The button “Telos Editor” inserts the Telos frame of the current object into the Telos Editor.

8.1.8  Display queries

This dialog displays all visible queries6 stored in the current object base (see figure 8.4). From the list box, you can select a query and “ask” it or load its definition into the Telos editor.


Figure 8.4: Display queries dialog

If you “ask” a generic query class with parameter, another dialog will ask you to specify the parameters. For each parameter, you can specify whether the value entered should be used as “substitute” for the parameter or as a “specialization” of the parameter class (see section 2.3). You can select a value for the parameter from the drop-down list if you have clicked on the “Show Values” button. Note that this list might be very long. Especially for the predefined queries it usually returns all objects in the database as any object can be used as a parameter for these queries.

8.1.9  Display functions

This dialog is similar to the previous dialog but displays instances of Function. Note that functions are formally special queries. Consequently, the dialogs for functions and queries are pretty much the same. The separation into two dialogs serves quicker handling.

8.1.10  Query editor

The Query Editor (see figure 8.5) allows the interactive definition of queries. The name of the query is entered in the upper left text field, the super class in the upper right field. After you have entered this information, the list box “Retrieved Attributes” will be filled with all available attributes.

Now, you can select the attributes you want to have in the result. For selection of more than one attribute, you must press the CTRL key and select the attribute with a mouse click at the same time. All attributes can be deselected by the popup menu.


Figure 8.5: Query Editor

In the right listbox you can add computed attributes. The right mouse button brings up a popup menu, which lets you add or delete an attribute.

In the text area below the two list boxes, you can add a constraint in the usual CBQL syntax. The constraint must be enclosed in $ signs.

The text area below, shows the Telos definition of the query and is updated after every change you have made. If your query is finished, you can press the “Ask query” to test the query, i.e. it is told temporarely and the results are shown in separate window. If you are satisfied with the result you can press the Tell button to store the query in the object base.

8.1.11  Tree browser

The Tree browser (see figure 8.6) displays the super classes, classes and attributes of an object in a tree. To start the tree browser, you must mark an object in the Telos editor and select the item “View Object as Tree” from the popup menu or the Edit menu.


Figure 8.6: Tree Browser

To expand an item, just double click on the icon. If you mark an object name in the tree, you can load into the Telos editor with the “Telos Editor” button or open a new tree browser with the button “View Object as Tree”.

8.2  ConceptBase.cc graph editor

The ConceptBase.cc Graph Editor is an advanced graphical modelling tool that supports the browsing and editing of Telos models. As the graphical browser of the previous releases, it supports different graphical types, i.e. different object types may be represented by different graphical objects. In addition to some predefined graphical types, the user can add his/her own graphical types by modifying and adding certain objects in the knowledge base. Furthermore, the standard components can be replaced by own classes implementing specific application-dependent behaviour.

In the following, we first give an overview of the Graph Editor application and then present the main components and functions of the Graph Editor. Details about the use of graphical types can be found in Appendix C. An example for the definition of graphical types of the Entity-Relationship model is given in Appendix D.2.

8.2.1  Overview

The ConceptBase.cc Graph Editor is entirely written in Java. It can therefore be used on any platform with Java 1.4. The use as applet is also possible wrt. to the usual security restrictions of applets.

The Graph Editor is integrated with CBIva, i.e. Telos frames of objects shown in the Graph Editor can be loaded directly into a Telos editor and vice versa. The Graph Editor implements a Multiple Document Interface (MDI), i.e. inside the main window several internal frames can be opened. Each frame has a separate connection to a ConceptBase.cc server. Thus, within a Graph Editor you can establish multiple connections to the same server or to different servers.

The communication with the ConceptBase.cc server is done using standard ConceptBase.cc queries and a special answer format. For the presentation of objects, the Graph Editor needs to know also the graphical type of an object which is included in the XML document. This document is sent by the server as answer to a query. Together with the caching techniques, the use of XML reduces the communication between client and server.

The new Graph Editor supports also the concept of “graphical types” as the graphical browser in the previous releases of ConceptBase. However, the idea of different graphical types has been extended and makes use of some dynamic features of the Java programming language (e.g., dynamic loading and binding). Figure 8.7 gives an overview of the ConceptBase.cc Graph Editor. Three internal windows have been opened, the two windows on the left have been connected with the same server running on “localhost”, port 4001. The small window in the upper right corner is not connected to a server, but a few objects have been created.


Figure 8.7: ConceptBase.cc Graph Editor

The windows which are connected with the server, show the same model but in different representations. This is caused by the fact, that for the upper window, the default grapical palette has been chosen, and for the lower window, a customized graphical palette specifically designed for the ER model has been selected (see appendix D.2 and C).

Furthermore, you can notice that the object “QueryClass” is represented by two different components. In the upper view, the detailed component view has been activated by a double-click on the object. It shows the Telos frame of the object. By a double-click on the title bar of this component, one can switch back to the default view of this object. Thus, each object can be shown by a small component (the default view) and a large component which gives more detailed information. Components are in this context specific Java objects, namely instances of javax.swing.JComponent. Thus, different components can be provided to represent an object (e.g., tables, buttons, text fields). You can implement your own component and integrate into the Graph Editor by extending a specific Java class. Details about the customization of the Graph Editor using graphical types and other components can be found in appendix C.

Finally, the Graph Editor removes some drawbacks from the previous graph browser. On the one hand, it can be used to edit Telos models (see section 8.2.7). On the other hand, it is able to show also implicit relationships between objects which have been derived by rules or Telos axioms. For each type of relationship (instanstation, specializations, and attributes), one can choose to see only the explicit relationships or to see all relationships.

8.2.2  Starting the graph editor

The Graph Editor is usually invoked by CBIva (the CB workbench) by using the menu item BrowseGraph Editor.

If CBIva is connected with a CBserver, the Graph Editor will be connected to this server and you will be prompted to enter the object name you want to start with and a name of a graphical palette. The graphical palette is a Telos object which represents a set of graphical types which will be used to visualize Telos objects (see Appendix C). On startup, the Graph Editor retrieves all information about the graphical types from the server. Depending on your system, this might take about 10 seconds.

If CBIva has no connection with a server, the Graph Editor will be started without a connection and no internal window will be opened within the Graph Editor.

It is also possible to start the Graph Editor directly from the command line without starting CBIva. The main class of the Graph Editor is i5.cb.graph.cbeditor.CBEditor. This class has to be given as argument on the command line when you invoke the Java Virtual Machine, e.g.

  java -classpath $CB_HOME/lib/classes/cb.jar i5.cb.graph.cbeditor.CBEditor

The connection to a CBserver has to be established via the File / Connect menu. The dialog box has two tabs. The first is for providing the host and prt number number of the CBserver. The second is for providing the start object to be displayed, the graphical palette, and the start module.

8.2.3  Moving objects

All explicit information is a proposition is ConceptBase, including attributes, specializations and instantiatins. You can move objects in the graph editor by pointing the cursor to the object’s label and then dragging it while keeping the left mouse button pressed.

If a graph has many nodes and edges, then it is recommended to first click once on the node or edge to be dragged and then to drag it. This will switch off the anti-aliasing while dragging and thus be faster.

Some edges like instantiation links have no label in the graph editor, depending on the graphical type associated to it (see section C). In such cases, a small square dot is displayed on the edge. Click on this square dot to select the edge and to drag it. If the edge has a background color (see section C) different from the edge color, then the square dot is drawn in the background color.

8.2.4  Menu bar

The menu bar provides access to the most important functions of the Graph Editor.

File menu

Connect to server:
Connect to a new server. You can have multiple connections to one server or different servers at the same time. Each connection will be represented in one internal window with the host name and port number in the title bar of the window.

The connection dialog consists of two tabbed panes. In the first one (Address), you can enter the host address (name or IP number) and the port number. In the second pane (Initial Object), you can specify the initial object to start the browsing process and the graphical palette.

Start Workbench:
Start a CB workbench (aka CBIva). If you started the Graph Editor directly or if you have already closed the workbench window, you can (re-)start the workbench by this menu item.
Save:
Save the current layout of the graph into a file. The current nodes, their location and the links will be saved into a file which can be reloaded later. If the option “include graphical types” for saving layouts is enabled (see Options menu), then the graphical types will also be saved into the file. This option is useful for offline usage of the Graph Editor (i.e., without a server) as all information necessary to visualize the graph will be included in the file. By default, the file will get the extension “gel” (Graph Editor Layout).
Load:
Load a layout that has been saved with the previous menu item. Existing nodes and links in the current window will be erased.
Print:
Print the current graph. If the graph is larger than the page size, it will be automatically reduced to fit into the page. Thus, all printouts will be on one page.
Save image of graph:
Saves an image of the current graph as PNG or JPG file. The PNG file format should be preferred as it delivers better results.
Close:
Closes the Graph Editor. A CBIva window will be still available if it has not been closed before.
Exit:
Exit the Graph Editor and CBIva. This operation will close both windows of the ConceptBase.cc User Interface (CBIva) and exit the program.

Edit menu

The operations in this menu have an effect on the selected objects. You can select an object by clicking on it with the left mouse button. Multiple selection is possible dragging a rectangular area while holding down the left mouse button or by holding the Shift-key and clicking on objects.

Erase Selected:
This option will remove the currently selected nodes and edges from the view. This operation has no effect on the database.
Selection:
With this submenu, you can either select all objects, all nodes or all edges in the current frame. Furthermore, you can clear your current selection.

Options menu

The options will be stored in a configuration file (see section 8.5) when you exit the Graph Editor.

Language:
The text for menu items and buttons is available in two languages (German and English). With this option you can switch between the languages. Because of unknown reasons, this option does not work under Microsoft Windows.
Saving of Layouts:
This option determines whether the definition of the graphical types should be stored also in the layout file, when a layout is saved. This option is useful for offline usage of the Graph Editor (i.e., without a server) as all information necessary to visualize the graph will be included in the file.
Background Color:
Here you can change the background color of the graph to your favorite color.
Component View:
With this option, you can configure the view of an object if the component view is activated by a double click or by the popup menu. By default, a tree-like representation of the object with its classes, instances, super classes, subclasses, outgoing and incoming attributes is used. If you select “Frame”, then the Telos frame of the object will be shown in a text area. (see figure 8.8)
Invalid Telos Objects:
The Graph Editor can validate objects that are currently shown in the graph, i.e. it checks whether the object is still valid in the database or it is has already been removed (see Current Connection menu). If you select “Mark” here, then the objects will be marked with a red cross as invalid. “Remove from display instantly” will remove the objects directly from the view.
Popup Menu:
These options control the behaviour of the Popup Menu (see section 8.2.6). The delay is the time (in milliseconds) an item of the popup menu has to be selected before the submenu is shown. Note that the construction of a submenu might require a query to the ConceptBase.cc server. If the option “Popup Menu blocks while waiting for server” is activated, then the editor will block the UI while it waits for an answer of the ConceptBase.cc server. Otherwise, the query to the server will be executed in a separate thread, and interaction with the UI will be possible. If you have the problem that some submenus are still shown after you have used the popup menu, set the delay to 0 and activate the option “Popup Menu blocks while waiting for server”.

Figure 8.8: Component view of Telos objects: tree and frame

View menu

The graph editor has an experimental layout algorithm that may be useful to reorganize the layout of a complex graph. The heuristic of the layout algorithm is rather simple and does not minimize link crossings.

Enable automatic layout:
Call a layout algorithm everytime the graph is changed, e.g. by expanding the attributes. Disabled by default. Enabling it is not recommended.
Undo last layout operation:
Undo the last change of the graphical layout. This option is only available when automatic layout is enabled.
Layout graph:
Call the layout algorithm.
Zoom:
Set the zoom factor of the graph, e.g. 120 (20 percent enlarged).
200,100,75,50,25:
: Set the zoom factor accordingly.

Current connection menu

These operations have effect on the current connection, i.e. the connection of currently activated frame.

Query to server:
This operation will open a dialog which prompts you to enter the name of a query (see figure 8.9). The query can also be parameterized. If you click on the “Submit Query” button, the query will be sent to the server and the result will be displayed in the listbox. You can select the objects that should be added to the graph. Selection of multiple objects is possible.
Validate and update shown objects:
This operation will check for every object, if it is still valid (i.e. if it still exists in the database), update the graphical type of the object, and the internal cache of the object is deleted (see below, section 8.2.8). Depending on the option “Invalid Telos Objects” (see above), the objects will be either marked or removed from the current view.
Validate and update selected objects:
Similar to the previous option but is only applied to objects in the graphical view that have been selected.
Change graphical palette:
The current graphical palette (=assignment of graphical types to nodes and links) is replaced by another one.

Figure 8.9: Query dialog

8.2.5  Tool bar

The tool bar (see figure 8.10) consists of a set of buttons that are mainly short cuts for some menu items. The right half of the tool bar provides buttons for the creation of Telos objects.


Figure 8.10: Tool Bar of the Graph Editor

Open a new frame (without connection):
Opens a new frame without a connection to a server. Within this frame, you can create new Telos objects, load existing layouts and save new layouts. Information about the graphical types is loaded from an XML file included in the JAR file
($CB_HOME/lib/classes/cb.jar).
Load layout:
see File MenuLoad
Save layout:
see File MenuSave
Hide selected objects:
Hides the selected objects from the current view. This operation has no effect on the current database, i.e. the objects will be not deleted from the database.
Open connection:
Opens a new frame with a new connection to a server. See File menuConnect to server.
Show object:
This operation adds a new object to the graph. You will be prompted to enter the object name of the object you want to add to the graph.
Show links between marked objects:
This operation will search for relationships between the selected objects. Do not select too many objects for this operation, n2 queries have to be evaluated for n objects.
Creation of objects:
The following four buttons open the “Create Object” dialog to create new individual objects, attributes, instantiations, and specializations. See section 8.2.7 for more details.
Show added/removed objects:
Shows the objects that have been added or removed since the last commit (or since the window has been opened). Here, you can also select objects to undo the change, i.e. remove added objects or re-insert removed objects.
Commit:
Sends the changes to the server. The list of objects to be added or removed is transformed into a set of Telos frames and transferred to the server.

8.2.6  Popup menu

The popup menu is activated by a click on the right mouse while the cursor is located over an object.

8.2.7  Editing of Telos objects

The Graph Editor supports also the creation and deletion of Telos objects. A Telos object in the context of the Graph Editor is a proposition as described in chapter 2. As described there, there are four types of Telos objects:


Figure 8.11: Create Object dialogs for Individuals, Attributes, Instantiations, and Specializations

For each object type, we provide a dialog to create this object type as shown in figure 8.11. This dialog is opened by clicking on one of the “Create” buttons in the tool bar, or by selecting an “Add ...” item from the popup menu (e.g, “Add instance” or “Add subclass”). If there are some objects selected in the current frame, then the object names of these objects will be inserted into the text fields of the dialog in the order they have been selected (i.e., the first text field will contain the name of the object which has been selected first). Furthermore, if you move the cursor into a text field in the “Create Object” dialog and select an object in the graph, then the name of this object will be inserted into the text field.

As changes might lead to a temporary inconsistent state of the database, we do not execute the changes directly on the database. They are stored in an internal buffer in the Graph Editor and executed when you hit the “Commit” button in the tool bar.

Creating Individuals:
If you want to create a new individual object, you just have to specify the object name. You have to enter a valid Telos object name, for example it must not contain spaces. In addition, you can select a graphical type for the object. Note that the selection of the graphical type has no effect in the database, e.g. by selecting the graphical type of a class (ClassGT) the object will not declared as an instance of Class. If you have performed the commit operation, the object will get the “correct” graphical type from the server.
Creating Instantiations:
In the dialog for instantiations, you have to enter the name of the instance and the name of the class in the two text fields. If the object entered does not yet exist, it will be created and represented in the default graphical type.
Creating Specializations:
This dialog is similar to the one before except that you specify here the name of the subclass and the name of the superclass. Objects that do not exist yet, will be created and represented in the default graphical type.
Creating Attributes:
This is the most complex dialog as you have to specify the source, the label, the value, and the category of the attribute. The source and the value (or destination) of the attribute are normal object names. The label may be any valid Telos label. The attribute category has to be a select expression specifying an attribute category (e.g., Employee!salary, see chapter 2). The attribute category can be selected from a listbox by clicking on the “Select” button next to the text field of the attribute category. All attribute categories that apply to the current source of the attribute will be shown. Note that the list will be empty if the source object does not yet exist in the database.

If you have specified the attribute category, you can also select the attribute value from a listbox by clicking on the “Select” button next to the text field for the attribute value. The listbox will show all instances of the destination of the attribute category (e.g. all instances of Department for the category Employee!dept).

If you select the radio button “Show Attribute Instantiation” then the Graph Editor will also show the instantiation link for the attribute. For example, if you create a new attribute for John with the label JohnsDept in the attribute category Employee!dept, then the instantiation link between John!JohnsDept and Employee!dept will also be shown. As the graph gets quite confusing with too many links, this radio button is not selected by default.

Deletion of objects is also possible. As this operation should not be mixed up with the removal of an object from the current view, this operation is just available from the popup menu (item “Delete Object from Database”).

As you might make mistakes while editing the model, there is the possibility of undoing changes. The button “Show added/removed objects” list all objects that have been added or removed (since the last succesful commit or since the connection has been established). A screenshot of the dialog is shown in figure 8.12. The left list shows the objects that have been added, the right list shows the objects that have been removed. By clicking on the button “Re-Insert/Delete” object, the selected objects will be re-inserted in or deleted from the graph 7.


Figure 8.12: List of objects which have been added or removed

If you are satisfied with the changes you have done, you can click on the “Commit” button. Then, the Graph Editor will transform the objects to be added or removed into a list of Telos frames and send them to the server using the TELL, UNTELL, or RETELL operation. If the operation was successful, all explicit objects will be checked if they are still valid and if their graphical type has changed (as in the “Validate and update” operation from the “Current Connection” menu). If there is an error, the error messages of the server will be displayed in a message box. The internal buffer with the objects to add or remove will be not changed in this case.

8.2.8  Caching of query results within the graph editor

To improve the performance of the Graph Editor, several caches are used. On the other hand, the use of a cache causes several problems which will be addressed in this section. In particular, the caches of the Graph Editor are not updated automatically if the corresponding data in the server is updated.

Graphical Palette and Graphical Types:
When a connection to a server is established, the Graph Editor loads the graphical palette and all its graphical types including their properties and other information. If an object has to be shown, the server sends only the name of the graphical type, the information about the properties are taken from the cache. Thus, if you change the graphical palette or a graphical type after the Graph Editor has established the connection, this change will not be visible in the Graph Editor. There is currently no method implemented to update the cache manually.
Graphical Types of Objects:
When an object is loaded from the server also the graphical type for this object is retrieved. The graphical type of the object is updated when you invoke the “Validate and Update” operation from the “Current Connection” menu.
Lists of super/sub classes, classes/instances, attributes:
The lists in the popup menu or in the tree-like view of an object are produced by evaluating queries. To reduce the communication between client and server, each query will only be evaluated once (when the corresponding popup menu should be shown or when the part of the tree should be shown). The result will be stored in a cache for each object. This cache is emptied when you invoke the “Validate and Update” operation from the “Current Connection” menu.

8.3  An example session with ConceptBase

In this section we demonstrate the usage of the ConceptBase.cc User Interface, by involving an example model. It consists of a few classes including Employee, Department, Manager. The class Employee has the attributes name, salary, dept, and boss. In order to create an instance of Employee one may specify the attributes salary, name, and dept. The attribute boss will be computed by the system using the bossrule. There is also a constraint which must be satisfied by all instances of the class Employee which specifies that no employee may earn more money than its boss. The Telos notation for this model is given in Appendix D.1.

8.3.1  Starting ConceptBase

To start a ConceptBase session, we use two terminal windows, one for the ConceptBase.cc server and one for the usage environment. We start the ConceptBase.cc server by typing the command

   cbserver -port 4001 -d test  

in a terminal window of, let us say machine alpha8. The parameter -port sets the port number under which the CBserver communicates to clients and the parameter -d specifies the name of the directory into which the CBserver internally stores objects persistently. Then, we start the usage environment with the command cbiva in the other window.

It is also possible to start the ConceptBase.cc server from the user interface. To do so, choose “Start CBserver” from the “File Menu” of CBIva (see section 8.1.1) and specify the parameters in the dialog which will be shown (see figure 8.13). The option Source Mode controls whether the CBserver accessing the database via the -d parameter (database maintained in binary files), or via the -db parameter (database maintained both in binary files and in source files). See section 6 for more details. Once the information has been entered via the OK button, the server process will be started and its output will be captured in a window. This output window provides also a button stop the server. If you started the server this way then you can skip the next section, as the user interface will be connected to the server automatically.


Figure 8.13: Start CBserver dialog and CBserver output window

8.3.2  Connecting CBIva to the CBserver

Next we establish a connection between the ConceptBas.cc server and the user client CBIva. This is done by choosing the option Connect from the File menu of CBIva. An interaction window appears (see Figure 8.14) querying for the host name and the port number of the server (i.e. the number we have specified within the command cbserver -port 4001 -d test).


Figure 8.14: The connect-to-server dialog

8.3.3  Loading objects from external files

The objects manipulated by ConceptBase.cc are persistently stored in a collection of external files, which reside in a directory called application or database9. The actual directory name of the database is supplied as the -d parameter of the command CBserver.

The -u parameter of the CBserver specifies whether updates are made persistent or are just kept in system memory temporarily. Use -u persistent for a update persistence or -u nonpersistent for a non persistent update mode 10.

The database can be modified interactively using the editor commands TELL/UNTELL. Another way of extending ConceptBase.cc databases is to load Telos objects (expressed in frame syntax) stored in plain text files with the extension *.sml. Call the menu item Load Model from the File Menu to add these objects to the database. In our example the database (directory) Employee was built interactively and can be found together with files containing the frames constituting the example in the directory

CB_HOME/examples/QUERIES

where you have to replace CB_HOME with the ConceptBase installation directory. The following files contain the objects of the Employee example expressed in frame syntax: Employee_Classes.sml, Employee_Instances.sml, Employee_Queries.sml. An alternative to interactively building a database is to start the server with an empty database (-d newfile⟩ ) and then add the objects in these files by using Load Model. Note, that the *.sml extension may be omitted. During the load operation of external models, ConceptBase checks for syntactical and semantical correctness and reports all errors to the history window as it is done when updating the object base interactively using the editor. This protocol field collects all operations and errors reported since the beginning of the session.

8.3.4  Displaying objects

To display all instances of an object, e.g. the class Employee, we invoke the Display Instance facility by selecting the item Display Instances from the menu bar. In the interaction window we specify Employee as object name. The instances of the class Employee are then displayed (see Figure 8.15).


Figure 8.15: Display of Employee instances

After selecting a displayed instance we can load the frame representation of an instance to the Telos Editor or display further instances.

8.3.5  Browsing objects

The Graph Editor is the preferred tool for browsing the objects managed by a ConceptBase.cc server. The Graph Editor is started by using the menu item “Graph Editor” from the “Browse” menu of CBIva. Select Employee as the initial object to be shown in the Graph Editor. After starting the Graph Editor, it will open an internal frame, connect it with the current server, and load the Employee object.

The ConceptBase.cc Graph Editor (described in detail in section 8.2) allows you to display arbitrary objects from the current onceptBase server. Then, we select the Employee object and choose the Sub classes option from the context menu available via the right mouse-button. We choose to only display explicit subclasses from the submenu and select the Manager object. The displayed graph is now expanded (figure 8.16).


Figure 8.16: The resulting graph after expanding the node Employee with subclasses

Now we expand the node Manager, a subclass of Employee, by choosing the menu item Instances from the popup menu for Manager. We select the menu item “Show all” to display all instances of Manager. The resulting graph is shown in figure 8.17.


Figure 8.17: The resulting graph after expanding with the instances of Manager

Note that different object types are represented by different graphical objects. The instances of Manager are shown only as grey rectangles, because they are normal individual objects. The nodes Manager, Salesman, Employee etc. are shown as ovals, since these nodes are instances of the system class SimpleClass (see for a full description of graphical object semantics: Appendix C).

One can move nodes and links by selecting a node or a link and then holding down the left mouse button while moving the cursor to a different position. When the button is released the selected object will be located at the current position and the related links are redisplayed. Selection and movement of multiple nodes and links is also possible.

We can further experiment with the graph editor by showing the classes and attributes of Employee. The classes of Employee are shown by selecting “Instance of” from the popup menu. Attributes of an object can be shown by selecting “Outgoing attributes” from the menu. The next submenu will show all attribute classes that apply for the current object. In our example, Employee is an instance of Class. Therefore, it has the attribute classes constraint, rule, and mrule (see figure 8.18). The attribute class Attribute applies to all objects as in Telos any kind of object can have an attribute. Furthermore, all attributes of an object are member of the attribute class Attribute. As we want to see all attributes, we select this attribute class and select “Show all” from the next submenu. All attributes and their values will be shown in the Graph Editor.


Figure 8.18: The graph after expanding it with the classes and the attributes of the class Employee

The Graph Editor can also show implicit relationships between objects, e.g. relationships deduced by rules or the Telos axioms. For example, if we select the object John and select “Instance of” from the popup menu, we can display the implicit classes of John by selecting “All” from the next submenu. As John is an instance of Manager and Manager is a subclass of Employee, John is also an instance of Employee. As there is no explicit object John->Employee, the instantiation link between John and Employee will be represented as an implicit link, i.e. a dashed line (see figure 8.19).

The same applies also to attribute links. For example, the employee Herbert has an implicit boss-attribute to Phil. This can be shown by selecting “Outgoing attributes” → “boss” → “All” → “Phil” from the popup menu. Note, that the submenu “All” for the attribute class Attribute will be always empty as only explicit attributes can be displayed in this category.


Figure 8.19: The graph showing implicit instantiation and attribute links

8.3.6  Editing Telos objects

Editing Telos objects with the Telos editor

Before we are able to edit a Telos object, we have to load its frame representation in to the Telos Editor field first. For loading a Telos object to the Editor field, we choose the Telos Editor Button from either the Display Queries oder Display Instances Browsing facilities or the Load Frame button from the ConceptBaseWorkbench window (see Figure 8.20).


Figure 8.20: The TelosEditor Field with the object Employee

Now we add an additional attribute, e.g. education, to the class Employee (for the description of the Telos syntax see Appendix A). We have added the line education : String as shown in figure 8.21. To demonstrate error reports from the ConceptBase.cc user interface and how to correct them, we have made mistakes in the syntax notation of the added attribute.


Figure 8.21: Trying to add an attribute to the class Employee with the resulting error report

By clicking the left mouse button on the Tell icon, the content of the editor is told to the ConceptBase server. Syntactical and semantical correctness is checked and the detected errors are reported to the Protocol field. The report resulting from our mistakes by specifying the new attribute is also shown in figure 8.21. Note, that this syntax error would have been already detected at the client side without interaction with the server if we would have enabled the option “Pre-parse Telos Frames” in the options menu.

We correct the error by adding a semicolon to the previous line and choose the Tell symbol again. This time, since there are no further mistakes, the additional attribute is added to the class Employee.

Now we can choose again the item Outgoing Attributes from the popup of the Graph Editor window for the node Employee. If we select “Show all” attributes of the attribute class “Attribute” the new attribute will NOT be shown. The Graph Editor uses an internal cache which will only be updated on request. Therefore, we select the object Employee and select “Validate and update selected objects” from the menu “Current connection”. The cache for the object Employee will be emptied. Now, showing all attributes should add the new attribute education to the graph.

Editing Telos objects using the graph editor

Telos objects can also be edited graphically in the Graph Editor. In our example, we want to add another attribute named address to the class Employee. The attribute destination of this attribute should be a new class called Address.

First, we select the object Employee and click on the “Create Attribute” button in the tool bar or select “Add Attribute” operation from the tool bar. As we have selected the Employee object, it should be already inserted as source of the attribute. We have to type the label (address) and the destination of the attribute in the text fields (see figure 8.22). As this attribute does not belong to a specific attribute category (it is just an attribute), we do not have to specify an attribute class.

By clicking on the Ok button, the Graph Editor will create a new object for Address represented by the default graphical type (a gray box). Then, it will create the attribute link from Employee to Address with the label address. The result is shown in figure 8.23.

Now, we want to declare Address as an instance of Class. Therefore, we select Address, hold down the Shift-key and select Class. Both objects should be selected now. We click on the “Create Instantiation” button and a dialog as shown in figure 8.23 should appear.


Figure 8.22: Adding an attribute to Employee


Figure 8.23: Adding an instantiation link between Address and Class

As we have selected the objects in the correct way, the dialog already specifies the object we want to create (Address in Class) and we can click directly on Ok. The new instantiation link will be added to the graph.


Figure 8.24: The resulting graph after commit

Now, we are satisfied with our changes and want to commit them in the server. So far, the changes have been stored in an internal buffer of the Graph Editor and have not been sent to the server. We click on the “Commit” button in the upper right corner. The Graph Editor generates now Telos frames for the added objects and sends them to the server. If we did not make an error, all changes should be consistent and accepted by the server. This is shown by the appearing message box “Changes committed”. If an error occurs, an error message will displayed instead. The graphical editing is an alternative to the textual editing via the Telos Editor. It is appropriate for incremental changes to a model. Larger changes should better be made via the Telos Editor or even to an external text file that is loaded via the File / Load Model facility of CBIva. If the changes were successfully told to the ConceptBase.cc server, the Graph Editor reloads the information of every visible object. In particular, the graphical types of the objects will be updated. As the object Address is declared as instance of Class, it will get the graphical type of a class, i.e. a turquoise box. The result is shown in figure 8.24. The object Employee is shown in the detailed component view, in this case the frame representation of the object is shown. As you can see, the attribute address is now also visible in the frame representation.

8.3.7  Using the query facility

Lets assume that we need to ask the server for all Employees working for Angus. We open a new Telos Editor (see menu item Browse). Then, we define a new query class (AngusEmployees) as follows:

AngusEmployees in QueryClass isA Employee with
constraint
    c: $ (this boss Angus) $
end

We can tell this query, so that it is stored in ConceptBase.cc and we can reuse it later, or we can just ask the query, i.e. the query will told temporarily and evaluated. If we ask the query, the answer is displayed in the Telos Editor field as well as in the history window. Figure 8.25 shows the ConceptBaseWorkbench containing the query class and the answer.


Figure 8.25: Query class and its answer

We can also execute this query from the Graph Editor. From the menu “Current connection” we select “Query to server”. A dialog we ask for the name of query class. If we have told the example query, we can type AngusEmployees in the text field and hit on the “Submit Query”. The query will be evaluated and the objects in the result will be shown in the list box. We can select the objects which should be added to the graph (multiple selection with the Shift-key is possible) and click on the “Show objects” button. The selected objects will be added to the graph, however with no connection to existing objects.

8.4  Usage as applet

Both applications, CBIva and CB Graph Editor, can be used as an applet within a web browser with a plugin for JDK 1.4. To start the applications as applet, you have to specify inside the applet class of the program. For CBIva, the applet class is

   i5.cb.workbench.CBIvaApplet.class

and for the CB Graph Editor, the main applet class is

   i5.cb.graph.cbeditor.CBEditorApplet.class

For example, to include the CB Graph Editor as applet inside your web page, use the following applet tag:

<applet archive="cb.jar,jgl3.1.0.jar"
   code="i5.cb.graph.cbeditor.CBEditorApplet.class"
   width=10 height=10>
</applet>

The archive parameter specifies the names of the archives to be loaded, the code parameter is the name of the applet class to be startet. As we have not specified a codebase parameter, the JAR files have to be located in the same directory as the HTML file. See link for more information on the applet tag.

8.5  Configuration file

The configuration options are stored in a file “.CBjavaInterface” in the home directory of the user ( ~/ on UNIX or “Documents and Settings” on Windows). The settings are stored automatically on exit. You can edit the file manually with a normal text editor. It contains name-value pairs in the format name=value. All options can also be modified by the user interface, so it is not necessary to edit this file.


1
CBIva is compatible to Java 1.4 and Java 5. It is also compatible with Java 6 Update 11 or earlier. It is not fully compatible with Java 6 Update 12 and later, because the graph editor would not work correctly. The Windows variant of ConceptBase.cc includes a compatible Java runtime environment, so that you do not need to bother about the incompatibility. Linux/Unix users should consult the installation guide included in the installation file of ConceptBase.
2
Note, that you might have to edit these files, so that the correct Java Virtual Machine is used and the environment variable CB_HOME is set correctly. See Installation Guide for details.
3
This is not the standard way to start the ConceptBase.cc server. Normally, the ConceptBase.cc server is started in a separate shell/command window as explained in section 6. The standard way offers more options and control over the ConceptBase.cc server. See also the installation guide for a discussion on the various ways to start ConceptBase.
4
Usually, one only asks a single query call like Q[v1/p1]. However, ConceptBase.cc also supports comma-separated lists of query calls like Q1[v1/p1],Q2[c1:p2]. Such lists of query calls are evaluated one after the other. The results is merged into a single answer. For technical reasons, calls to builtin query classes like get_object[Class/objname] may only occur as a singleton.
5
The query can either be a query call referring to an existing query or a frame representing a new or existing query definition.
6
Visible queries are those queries that are not instantiated to the class HiddenObject. Functions and certain system queries are excluded from the display.
7
You can unselect an object by holding down the Control key and clicking on the object.
8
A full list of all parameters is described in section 6. Note that the script CBserver must be in the search path. It is available in the subdirectory bin of your ConceptBase.cc installation directory.
9
Historically, we used the terms ’application’ or ’object base’ instead ’database’. We now believe that ’database’ is a much better term.
10
In nonpersistent update mode, the database is actually copied to a temporary directory. This copy will be removed when you shutdown the server.

Previous Up Next