## Query_By_Example

Query By Example is the simplest query interface available in ACEDB. See help for the Query Builder, the Query Commands window, and the TableMaker to learn more about other search tools. Help is also available for the query language itself but you can use Query By Example without understanding it.

Based upon a fill-in-the-blank and toggle-button style of entry, Query By Example allows the user to fill in values in a class model-display. These values are then used in a conjunctive query command to retrieve data objects from the database.

This window can be used in conjunction with or independently of the Query Commands window. Query results appear in a KeySet window.

to execute a query formed in this window, use the Search Locally button.

### Buttons (above horizontal line)

- Quit: Exits the window.
- Help: Invokes this section of the help file.
- Clear: Clears the entry boxes and redraws the window from scratch.
- New KeySet: Calls up a new, blank keyset window.
- Command Edit: Call up the Query Commands window.
- Search Locally: Execute the current query and put the found and selected objects in the Key Set.
- Undo: Cancels the last command and redisplays the previous Keyset (selection list).

### Boxes and Controls (above horizontal line)

- "From" Selector: Actually a menu (activate by right mouse button), this allows the user to use the current keyset as the base for a query or to use the current class shown. Simple clicking of the left mouse button will "step" through the menu selections.
- "Class" Selector: Actually a menu (activate by right mouse button), this allows the class being currently shown to be changed to any class in the database. Simple clicking of the left mouse button will "step" through the menu selections. As your do so the items below the horizontal line will change, reflecting the structure of each class you visit.
- ITEM NAME: This is a text entru box which can be filled in to query for particular names of items within the current class.

### Menu items:

In addition the the above functions, the Menu has the following options:

- Print: prepares a Post Script file in ./PS which you can then print on your local laser printer (specified by ACEDB_LPR).
- Refresh: Redraws the window.
- Query Builder: Same as the Builder Button. Call up the Query Builder window.
- Query Command Edit: Same as Command Edit Button. Call up the Query Commands window.
- AND, OR : The various tags and fields are connected via the conjunctions AND (&) and OR (|) as selected on the menu. Use the Query Builder window to view the composed query command.
- Show Full Description: Calls up the metadata associated with the last picked (left mouse button) label or entry-box on the display.
- Show Long Description: Calls up the ?LongText metadata associated with the last picked (left mouse button) label or entry-box on the display.
- Search Locally: Same as Search Locally Button. Execute the current query and put the found and selected objects in the Keyset (selection list).
- Undo Search: Same as Undo Button: Cancels the last command and redisplays the previous Keyset (selection list).

### Below the Horizontal Line

What you see below the horizontal line depends on which class you are querying. All the tags and fields in a class will be represented.

Fields are represented by the green text entry boxes. Activate an entry box by picking it (click with the left mouse button). It turns yellow (dark grey on monochrome) and all keyboard-input will then enter into that box. Simply pick and edit a box for it to be folded into the current query command. Sub-conditions, such as "< 100.1", "> fred", and "!= gene21" are allowed in these lines. For the numeric entries, the user will receive a warning that the syntax is not numeric, which can be ignored at the user's choice.

When you press carriage-return (CR), the entry is processed for correctness and, if the Query Commands window is up, you will see a formed query on the current query command line.

Click the Search Locally button to search. Each time you click here you will execute whatever query you have built.

Tags are the labels adjacent to the fields. You can search for the presence of a tag (rather than the contents of its field) in a boolean exists/does_not_exist fashion. Clicking once on the tag specifies it must be present. It will be highlighted. Clicking again deselects the tag.

### Other Information

Scope: The query commands will modify the active Keyset (selection list). To select another key set, pick it once or use the New KeySet command.

Query Commands Display: If the Query Commands window is open, the syntax formed by the Query-By-Example window will be shown on a command edit line there.

Note to curators: If you Read Models and update the models, you may have to restart the ACEDB program for the correct QBE display to appear.

to Table of Contents

last edited: July 1994