The Query Builder:

The Query Builder utility greatly simplifies query formulation, especially for users unfamiliar with the organization of the database. With this utility, search commands can be chosen from menus rather than typed in. The following example demonstrates how to build a query to retrieve all the papers in the database published after 1985 with at least one author with a surname starting with `bre'.

* Click on the Clear button in the Query Commands window to clear the previous queries.

Note: this does not change the active keyset.

* Click on the Builder button to open the Query Builder window.

* If necessary, move the new window so both it and the Query Commands window are visible.

* Click with the left mouse button on the small triangle on the right of the Find and select box (currently containing the words ANY CLASS).

A new scrolling window appears. This window lists all the available search classes.

* Scroll down the list and have a look at the available search classes.

* When done, double-click on the class name Paper with the left mouse button.

The Selector: CLASSES window disappears and the word Paper appears in the entry box in the Query Builder window. The words Find Paper appear in the entry box in the Query Commands window.

Note: clicking on an entry box with the right mouse button opens a menu listing all the possible entries for this box, as an alternative to clicking on the small triangle to bring up a selector window. This alternative method is faster and more convenient for users with large monitors, but may be cumbersome for other users due to the size of the menu.

The second line of entry boxes is used to formulate the search expression. This expression is made up of an attribute of the object to be retrieved (e.g., its name, or the value of one of its tags), and of a condition which this attribute must satisfy in order for the object to be retrieved (e.g., a tag of the type `sequence' must exist in the object, or the object name must start with `a').

The first entry box on the second line (labelled where) is used to select the object attribute to be subject to the condition.

* Click on the small triangle in the where entry box.

The attributes available for objects in the class `Paper' are listed in a new Selector window. They include all the tags which can be found in objects of the class `Paper', as well as the name of the object itself (ITEM NAME).

Note: the USE TREE TAG CHOOSER option provides an alternative method of choosing an attribute by double clicking on a tag in a `blank' text window of the appropriate class.

* Double click on Author.

Author now appears in the entry box in the Query Builder window, and also in the Query Commands window.

* Click on the triangle in the next entry box, on the right of the one now containing the word Author.

The new selector window offers a choice of `conditions' which are used to formulate the search expression.

In this case, we want the author name to start with `Bre'.

* Have a look at the conditions available then double click on begins with.

The selector window disappears and `begins with' appears in the entry box.

* Click on the entry box to the right of the one containing the words `begins with' and type in bre <return>.

The query so far is formulated in `plain English' in the Query Builder window (it should be: `Find and select Paper items where Author begins with bre END'). It also appears in query syntax in the entry box of the Query Commands window (Find Paper Author = bre*).

* Click with the right mouse button on the next entry box in the Query Builder window (currently containing the word END).

This opens a small menu listing a few Boolean operators:

* Select and in the menu.

A new set of entry boxes appears to enter further conditions.

* Click on the small triangle in the first new entry box (labelled `where') and select Year from the list.

* Open the selector window for the next entry box (the `condition' box) and select is greater than.

* Click on the next entry box and type 1985 <return>.

The Query Builder window now contains the complete query.

The complete query should also appear in the Query Commands window as Find Paper Author = bre* & Year > 1985.

* Bring the Query Commands window to the foreground, click on the query entry box and press <return>.

After some delay, the objects satisfying the query are listed in a keyset window.

* Bring the Query Builder window to the foreground and click on the Quit button.

return to Table of Contents
next section: Query by example