PIQ Documentation

Starting the Parka Interface

There are two ways to open the interface, in either applet or standalone application mode. In either case, a window labeled PIQ v. 1.0 should appear.

Applet:
In order to use the interface from a Web page you simply have to press the appropriate button.
Standalone application:
After executing the program, a small window with two buttons in it appears. One button says "New Window", and operates just as above. The other says "Quit", and should be pressed when you are done with the application. This is called the "Application window". For information on how to execute the program see the section on Running as a Standalone Application.

Query Window

This window provides the query interface to the parka database server. At the top is the menu bar. Under that are four little icons-- an arrow, a rounded box with an x in it, the word Rel over a box and a diagonal line. These control the creation of a query graph in the white canvas below it. Beside it is a text area for messages from the system. Below the area for the graphical query is the space for query output. On the left side is a bar which slides up and down to control the sizes of the two halves of the window -- the query graph and the query results. This will operate after query results first exist.

Menus

File menu
Close
Destroy this query window.
New Object
Creates a new node in the query graph area in a default location.
Clear Graph
Erases all the objects in the query graph.
Clear Query Results
Erases all the results in the responses section of the window.
Application Window
Brings the application window to the top of the window stack. This is the window with the two buttons in it. Not an allowed menu choice if run from an applet (since it won't exist).
Parka menu
The Parka menu controls the operations with the parka server. If the application is being run from a web page, most likely the server connection will have already been established and a knowledge base will have been opened for you.

Connect to Parka
Initiate a connection to the parka server.
Open Database
Open a Knowledge Base.
Submit Query
Request the answers for the query represented by the current query graph.
Disconnect from Parka
Disconnect from the parka server. Closes any currently open KBs, if there are any.
Close Database
Close the current KB.
Object menu
This can be used when one of the nodes in the query graph is active. The active node is filled with yellow. This is the node to which the menu operations chosen will apply. The operations possible are:

Rename Object
Change the name of the variable or constant that is currently active. Before choosing this option, type the desired new name for the currently active node into the text area. Then choosing this menu item will change the name.
Delete Object
Delete the node that is currently active.
Variable
This is a toggle. When the associated small icon to the left of the word "Variable" is indented, and the node is represented by a rectangle with rounded corners, then the node represents a variable. Clicking on this choice changes the node to represent a constant, and it will change to rectangle with square corners. The small icon on the left in the menu will also become raised to show that the choice "Variable" has been set to false. Notice that at the far right of the window, under the menu bar is a button labeled "Variable". This is activated when the Object menu is activated, and has the same function as this menu choice.
Link menu
This can be used when one of the links in the query graph is active. The active link has the background behind its text colored yellow.

Rename Link
Pops up the menu of predicate names for choosing another one.
Delete Link
Removes link from the query graph.
Font menu
This menu allows immediate change of font size and font family. It affects the query graph only, not the query responses, which have a fixed size and font.

Query Graph

The query graph has nodes which represent either the query variables or constants from the currently open KB. These are represented by rectangles. If the rectangle has square corners the node is a constant; otherwise it is a variable and has rounded corners.

Relations are indicated by a partitioned rectangle. Each box in the rectangle represents an argument of the relation. Lines connect an argument with a variable or a constant node.

Once a query is formed, with the help of the icons in the upper left corner, the query can be submitted to the KB that is currently open.

Icons

The four icons that appear just below the menubar on the left side are used to control drawing the query. Click with any mouse button on the one you want to have active. The active icon and mouse button that is clicked determine the effect you will get when creating a query. By default, the buttons will revert to the arrow after one use of the tool. To lock a button in place, double-click on it. A locked button will have a white background in addition to being indented.
When this one is chosen, nodes can be clicked on to activate and move them to a different location. Any mouse button works for this. It is also the position where you can prevent yourself from accidently doing anything else that can happen in the drawing area (e.g., accidently creating nodes you don't want).
This icon is chosen when you want to do operations with nodes. When this is chosen, mouse buttons have the effects that follow:
  • 1st : create a new node in the position clicked on.
  • 1st plus control key, or 1st plus shift key: rename the node that already exists which you just clicked on. Type the new name (it will go into the text area), then type 'return' when done. NOTE: Some window managers may use one of these key sequences and not let the application running in the window get it. In that case, use the other one, or the menu choice in the 'Object' menu.
  • 2nd: deletes the node clicked on with the 2nd mouse button.
  • 3rd: no effect.
This icon is chosen when you want to do operations with relations. When this is chosen, mouse buttons have the effects that follow:
  • 1st: When the mouse button is clicked, a menu of predicates to choose from will pop up. Definitions of the standard predicates are given in the section on Standard Predicates. Choose from the list, and press "OK". A relation box will be drawn at the selected location and labeled with the name of the selected relation. This will now become the active graph object.
  • 1st plus control key, or 1st plus shift key: rename the link that already exists which you just clicked on. Again, the predicate list will pop up; choose the new name you desire. (The NOTE under "Hand Icon" applies here too).
  • 2nd: delete the link clicked on with the 2nd mouse button.
  • 3rd: no effect
Once you have created a relation, you need to specify values for its arguments. Select this icon and then use the first mouse button to click on the portion of the relation box that corresponds to the number of the argument you wish to specify. Arguments are ordered from left to right, with the leftmost one being the first argument. While holding the mouse button, drag the cursor to the node that represents the variable or constant you wish to specify for the argument. Release the mouse button when the cursor is positioned over this node. If you release the button when the cursor is not over a node, a new node will be create for you at that location.

Standard Predicates

Every Parka KB has a set of standard relations. These are:
isa
The first argument is a subcategory of the second argument.
instanceOf
The first argument is explicitly declared as a member of the category in the second argument.
subCat
The second argument is a subcategory of the first argument.
instance
The second argument is is explicitly declared as a member of the category in the first argument.
everyInstanceOf
The first argument is a member of the category in the second argument, either directly or by the transitivity of category membership.
everyInstance
The second argument is a member of the category in the first argument, either directly or by the transitivity of category membership.
stringMatch
True when the second argument matches the first argument. The percent sign ('%') can be used as a wild card in the second argument.
gt
The first argument is a number greater than the second argument.
lt
The first argument is a number less than the second argument.
eq
The first argument is a number equal to the second argument.
inRangeOf
look this up

Query Results

After the first query is submitted, the bottom half of the window is created. This will consist of a multiple column list of answers to the query (if there are any), and a section above that provides information about the answers. The label "First Item" indicates which record is the first one appearing in the list. This is required, because if there are a great many answers, they are not all brought over from the server at once. Initially, only the first batch is brought over. The label "Last Item" shows the number of the last record appearing in the list. At the top of the window, in the text area above the graphical query, the total number of answers to the query is shown, so the user can immediately see how many answers compared to the total that they have. If the total number of answers could be brought over from the server to the client in one batch, then the labeled buttons below "First Item" and "Last Item" will both be inactivated. However, if more answers exist in the server that the user may get, then "Get Next Group" will be activated. Click on this to get the next set of answers. Now "Get Last Group" will be activated, and "Get Next Group" will still be activated unless we have gotten now to the end of the answer set. Thus the user may go backwards and forwards as much as he/she wishes.

The user may also click on a row in the list. This will cause the variable values from that row to show up in the query graph, associated with the appropriate variables. Clicking on a different row changes the values to those of the new row. To go back to no values being displayed in the query graph, double click on some row.

If the user is using the Parka Interface from a Web browser an additional feature is available. Double-clicking on a value which is a valid URL will cause that web page to be opened in another window.

While the user has a particular KB open, the last query given remains in the list in the bottom part of the window, until a new query is submitted. When a KB is closed, the answers are erased, and so is the query graph.

Running the Java client as a stand-alone application

The Java client can be run within Netscape, or some other Web browser, or it can be run as a standalone program. In Netscape, the file parka.html is opened in order to run it. To execute the client in standalone mode, first verify that the software is configured properly. This involves checking the contents of the IconDirLoc file and verifying your CLASSPATH (see below). If these are correct, then you can change to the directory where your IconDirLoc file is, and issue the command:

java  parka.ParkaApp &

The file IconDirLoc provides a URL where the PIQ icons can be found. These icons should be in a subdirectory of the distribution called gifs. Change the URL in this file to be the full path to that directory based upon where you installed the distribution.

As with all Java programs, the CLASSPATH environment variable must be set correctly to allow the code to be executed. The CLASSPATH allows the Java interpreter to find the .class files; for example, in UNIX, CLASSPATH can be set as follows:

setenv CLASSPATH directory-path-of-source-code/Parka:.
This sets two places for the interpreter to look. The first is directory-path-of-source-code/Parka, which is the directory where the package directory will be found, when following these directions, and . ,which is the current directory. (Any standard Java book should explain CLASSPATH and how to set it in other operating systems).

Web Accessibility