4. Graphical query editor

4.1 Introduction

The graphical query editor

The graphical query editor can be used to create queries without knowledge of the TIGERSearch query language. For example, you can create nodes with a few mouse clicks, and change values by selecting an item from the list of a pull down menu. You can also create edges between nodes, which represent dominance and precedence relations.

The graphical query editor is the result of Holger Voormann's diploma thesis ([Voormann2002]; in German).

An alternative to the textual mode

The graphical editor has been designed for beginners as well as for casual users. Power users will likely create queries faster textually than graphically. It is also possible to start constructing a query graphically, automatically generate the textual equivalent, and make some further textual edits.

Graphical vs. textual queries

Because the graphical mode has also been designed for people who want to learn the TIGERSearch query language (cf. chapter III), the graphical construction of a query follows the concept of the textual query language. For example, nodes are specified with an arbitrary number of feature-value pairs.

The graphical query editor as a preprocessor

To process a graphical query, it is necessary to convert it to a textual representation. You can see the textual mode as a plugin, which is converting your graphical query to the TIGERSearch query language (see figure below).

Figure: Before query processing, the graphical construction is converted to a textual query.

Limitations

Because of the architecture (see paragraph above), the graphical mode may, in principle, have the power of the TIGERSearch query language. However, in the current version there are some limitations:

The graphical editor supports disjunctions between feature-value pairs and feature values, but not between graph relations or any grouped parts of a query (cf. section 7, chapter III).

It is not possible to create an unspecified node (cf. subsection 4.3).

Variables, used for equality of node specifications, are not yet supported (cf. subsection 7.2, chapter III).

Templates are not yet supported (cf. section 9, chapter III).

4.2 Starting

Switch to Graphical Mode

To start creating a new graphical query you first have to select the Graphical mode tab instead of the Textual mode at the top of the query input area (see screenshot):

Please click to enlarge!

Figure: Switch to the Graphical Mode by clicking on the tab.

Before a graphical query can be created, a corpus must be loaded (cf. section 2).

Please note: If the corpus is closed or reloaded or another corpus is opened, the current graphical query will be lost.

Creating a graphical query

To create a graphical query, you first have to create nodes (cf. subsection 4.3). In the second step you might specify these created nodes (cf. subsection 4.4) or create edges between existing nodes (cf. subsection 4.5).

4.3 Nodes

Input field

After switching to the Graphical mode you can see the horizontally divided input field. Be sure that either the Move/Create tool or the Create tool is activated (cf. subsection 4.6). By clicking into the upper part, phrase nodes (so-called inner nodes or nonterminal nodes) will be created. A left button mouse click into the bottom area creates a token (so-called leaf nodes or terminal node).

Please note: Because of the divided input field either phrase nodes or token nodes can be created. An unspecified node cannot be created.

The different parts of a node

The different parts of a node are separated by small lines. You can disable these lines (so-called plug borders) via the context menu (cf. subsection 4.7).

Figure: A phrase node with its four plugs, the node menu, and the feature constraints area.

The four (token nodes: three) plugs are used to create edges (cf. subsection 4.5). The darker inner area contains the node specification (cf. subsection 4.4).

Node menu

Every node has a pull down menu in its upper left corner. Use this menu to delete the node and to enable or disable graph predicates (cf. subsection 7.3, chapter III).

Figure: The menu of a phrase node (left) and of a token node (right).

The (token)arity and (dis)continuous predicates are only useful for phrase nodes.

Delete Node
Deletes the node, including its feature constraints and all edges starting or ending at this node.

Root
Enables/disables the root predicate. Only one node might use the root predicate. If you specify this predicate on one node, the root predicate will be disabled on all other nodes. The root predicate is visualized by disabling the dominance top plug (all edges ending at this node will be deleted) and displaying a red triangle instead.

Arity is ...
Shows/hides an input field for the arity value below the inner node specification area.

Arity range from ... to ...
Shows/hides two input fields for the start and end arity values below the inner node specification area.

Tokenarity is ...
Shows/hides an input field for the tokenarity value below the inner node specification area.

Tokenarity range from ... to ...
Shows/hides two input fields for the start and end tokenarity values below the inner node specification area.

Continuous
Enables/disables the node predicate continuous. By enabling this predicate the predicate discontinuous will be disabled, because both predicates cannot be enabled at the same time.

Discontinuous
Enables/disables the node predicate discontinuous. By enabling this predicate the predicate continuous will be disabled, because both predicates cannot be enabled at the same time.

Arity and tokenarity

After enabling an arity or tokenarity predicate via the node menu, input fields are shown below the inner node specification area at the bottom of the node. One input field for entering the exact (token)arity value is shown if the predicate (token)arity is ... is selected. If (token)arity range from ... to ... is selected, two input fields are shown: the left for the start value and the right for the end value of the range.

Figure: The arity and tokenarity input fields are only shown if the predicate is enabled.

The values can be changed by either typing in a new value or by pressing the increase or decrease button, which are shown at the right of the input field when the mouse cursor is over the input field or the input field is activated (see screenshot above).

Continuous and discontinuous

Only one of the continuous or the discontinuous node predicates can be set. These predicates are visualized by the non-crossing edges and the crossing edges symbol at the bottom of the node.

Figure: The (dis)continuous predicate visualized by the (non-)crossing edges symbol.

4.4 Feature Constraints

Creating a feature-value pair

A node can be specified by an arbitrary number of feature-value pairs (cf. section 3, chapter III). To create a feature-value pair click into the inner node specification area. A box comprising three menus appears (see image below). If the current corpus supports more than one phrase or token feature, the upper menu (the feature selection menu) opens automatically.

Figure: Creating feature-value pairs and toggling between conjunction and disjunction.

To create another feature-value pair you have to click into the inner node specification area, left or right of the existing feature-value pair. By default, these feature-value pairs are connected by conjunction. To toggle between conjunction and disjunction, click on the corresponding symbol.

1. Feature selection menu

The feature selection menu is primarily used to choose the feature, but can also be used to delete or negate the feature-value pair (visualized by a red line from lower left to upper right).

Figure: Feature selection menu (left) and negated feature-value pair (right).

2. Operator selection menu

Figure: The operator selection menu.

The is operator is selected by default. The following operators are available:

is
The feature must agree with the specified value.

isn't
The feature must not agree with the specified value.

contains
The feature value must contain the given string.

doesn't contain
The feature value must not contain the given string.

begins with
The feature value must begin with the given string.

ends with
The feature value must end with the given string.

is regular expression
The given pattern must match the feature value.

isn't regular expression
The given pattern must not match the feature value.

is equal to
The feature value is equal to the feature value of another node (cf. paragraph below).

The operators contains, doesn't contain, begins with, and ends with do not have a textual equivalent. They are converted to regular expressions (cf. subsection 3.5, chapter III). For example begins with 'abc' will be converted to /abc.*/.

3. Value specification

By selecting the operator is or isn't, the feature value can be specified by one or more values or types. In this case the third item of the feature-value pair is a field, such as the inner node specification area. By clicking at the left or right of the existing primary value/type, further values/types can be created. You can switch between disjunction and conjunction by a mouse click on the connector.

Figure: One or more values/types can be used to specify a feature value.

The first item of a value/type menu is used for deleting.

Please note: If there is only one value/type, the delete function does not work.

The second menu item is for negation, also visualized by a red line from lower left to upper right.
Types are marked by the symbol and (by convention) type names are written in small letters. All possible feature values are listed, marked by the symbol . If there is no feature value list available e.g. for the word feature), there is an input field you can type in a value (see figure below).

Figure: Input field (left) and menu for selecting a value or type (right).

Equality

To specify a feature value to be equal to a feature value of another node, variables are used (cf. subsection 7.2, chapter III). To create such a variable you have to select the operator is equal to. The mouse cursor will change into an arrow . Now click either into a free space of an inner node specification area of another node or on the same feature-value pair of another node (see figure below).

Figure: A click into an inner node specification area will create a new feature-value pair.

Figure: A click on an existing feature-value pair will set its value equal to the source feature value.

If you want to delete a feature-value pair which is used as a reference for an is equal to feature value, the following dialog will appear:

Figure: Deleting a variable specification, which is referenced by another feature-value pair, is not allowed.

4.5 Edges

Creating

Edges represent graph relations: dominance and precedence (cf. section 6, chapter III). An edge can be created between two existing nodes. To create a dominance edge you have to select a lower dominance plug of a node (cf. subsection 4.3) and a second partner node. It is also possible to do this in inverse order by first selecting an upper dominance plug and a second node as the start node of the relation.

Figure: Dominance edges are created by clicking on dominance plugs.

To create a precedence edge you have to first select a right precedence plug or, to do it in inverse order, a left precedence plug and afterwards another node.

Figure: Precedence edges are created by clicking on the precedence plugs.

The type of the created edge (i.e. direct or non-direct, negated or not negated) depends on the preselection, which can be set in the toolbar (cf. subsection 4.6). After creating an edge, the type can be changed in the edge menu.

Multiple selection and creation

Two or more nodes or plugs can be selected by holding down the SHIFT or CTRL key while clicking. This can be used to create more than one edge simultaneously (see figure below).

Figure: By pressing the SHIFT or CTRL key two or more nodes or plugs can be selected.

Dominance

Figure: The menu of a dominance (left) and direct dominance (right) edge.

The first item of the edge menu is for deleting. The following three menu items provide functions to change the type of an edge after creating it.
If it is a non-direct dominance edge, the distance can be specified, either by the exact value or by a range. If the Distance is ... or Distance range from ... to ... item is enabled in the edge menu, one resp. two input fields are shown left of the edge menu. These values can be changed by either typing in a new value or by pressing the increase or decrease button, which are shown at the right of the input field when the mouse cursor is over the input field or the input field is activated. If the edge type is direct dominance, an optional edge label can be chosen from a list.

Figure: Distance specification (left) and edge label (right).

Left/right corner

If the end node of the (direct) dominance relation is a token, three additional edge menu items are available for the optional corner specification (cf. subsection 6.2, chapter III). Left or right corners are visualized with black filled triangles (see figure below).

Figure: The menu items for corner specification.

Horizontal edges

Beside the dominance relation there are two more relations. With the precedence relation you can specify the horizontal order and distance between nodes. Secondary edges are often used as a kind of additional dominance relation. Secondary edges are not supported by all corpora.

Figure: The menu of a precedence, direct precedence, and secondary edge.

The first menu item can be used to delete the edge. Below there are four (three if the current corpus does not support secondary edges) items to choose the type of the edge and to negate it (see figure above). If the edge type is precedence, input fields for either the exact distance value or a distance range can be enabled by choosing either the Distance is ... or Distance range from ... to ... menu item. The values can be changed by either typing in a new value or by pressing the increase or decrease buttons, which are shown at the right of the input field when the mouse cursor is over the input field or the input field is activated.

Please note: Not every corpus supports secondary edges and secondary edge labels.

4.6 Toolbar

The buttons of the toolbar are divided into four parts: tool selection, dominance edge type preselection, horizontal edge type preselection, and switch to textual mode.

Figure: The toolbar.

Tool selection: Moving/Creating, Creating, Moving

With the leftmost three buttons you can specify how to create objects and how to move nodes:

Move/Create
Objects like nodes, feature-value pairs, and feature values will only be created by a mouse click if the selection is empty. If the selection is not empty, a mouse click in a free area deselects every object.

Create
Regardless whether the selection is empty or not, nodes, feature-value pairs, and feature values can be created by a mouse click at the appropriate location. For deselection click on a selected object or use the context menu (cf. subsection 4.7).

Move
Nodes, feature-value pairs, feature values, and edges cannot be created if this tool is activated. In this mode you can only move nodes.

Dominance edge type preselection

Before creating a dominance edge the type of the new edge can be preselected (cf. also subsection 4.5). Of course the type of an edge can be changed after creating, but preselection is very useful for creating two or more edges simultaneously. There are four different dominance edge types:

Dominance

Negated Dominance

Direct Dominance

Negated Direct Dominance

Horizontal edge type preselection

The type of a new horizontal edge can also be preselected. (cf. subsection 4.5).

Precedence

Negated Precedence

Direct Precedence

Negated Direct Precedence

Secondary Edge

Negated Secondary Edge

Please note: Secondary edge and negated secondary edge are only shown if the current corpus supports secondary edges.

Switch to Textual Mode

By clicking the rightmost button marked by the symbol the textual representation of the current graphical query will be copied into the text query editor of TIGERSearch (cf. section 3). The query text can now be edited and submitted.

Please note: In the current version of TIGERSearch a textual query cannot be converted to a graphical query (cf. subsection 4.1).

4.7 Context Menu

Popping up the context menu depends on the platform. Either the second or third mouse button has to be pressed or released. The context menu and its submenus are shown below:

Figure: The context menu and its submenus.

Delete

Deletes all selected objects. Edges cannot be selected but will be deleted if the start or end node is deleted. Nodes are also deleted if only a node plug is selected.

Select All

If the context menu is called from the inner node specification area, all feature constraints of the current node are selected.

Deselect

Removes the current selection.

View - Stepped Lines

The dominance relation can be visualized either by stepped lines (cf. TIGERGraphViewer) or by a straight line edge:

Figure: Stepped lines (left), straight lines (right).

View - Node Plug Borders

To point out the different areas of a node (cf. subsection 4.3) small lines show the borderlines. These lines can be disabled.

Figure: Nodes with (left) or without (right) node plug borders.

Bookmarks

The textual representation of the graphical query can be saved for later use as a bookmark (cf. subsection 3.4). Selecting Add Bookmark To Main Group adds the textual representation of the current graphical query into the main group of the bookmark folder, Add Bookmark To Current Group will add a bookmark into the currently selected bookmark folder.

Please note: In the current version, the graphical query representation cannot be saved for later usage.

Export - As Image

The current graphical query can be exported as an image. There are five export formats available:

SVG (Scalable Vector Graphic)
An XML-based vector graphics format. This means that images can be scaled without loss of quality.

TIF (Tag Image File Format)

PNG (Portable Network Graphics)

JPG (JPEG File Interchange Format)

PDF (Portable Document Format)

Please click to enlarge!

Figure: Export As Image dialog.

Export - Textual Query to Clipboard

The textual representation of the current graphical query is copied to the clipboard to be used in other applications.

Switch to Textual Mode

The textual representation of the current graphical query will be copied to the text query editor of TIGERSearch (cf. section 3). The query text can now be modified and submitted.

Please note: In the current version of TIGERSearch a textual query cannot be converted to a graphical query (cf. subsection 4.1).