add this bookmarking tool

Xaira: the reference manual

9. The Query menu

The Query menu allows you to manipulate the solutions to a query in various ways. You can edit a query using the Edit command; sort the solutions in various ways using the Sort command; thin the solutions using the Thin command; set various options about the appearance of the solutions using the Concordance, Query Text or Annotation commands; save the solutions to a file in XML format using the Listing command; or display bibliographic information about a particular solution using the Source command. You can also calculate collocational information for the solutions to a query using the Collocation option.

9.1. Editing a query

Selecting the Edit command from the Query menu will redisplay whichever dialogue box it was that launched the query whose solutions are currently displayed. The command is grayed out and unavailable if no solutions are being displayed.

The query dialogue box will be displayed as it was when the query was sent to the server by pressing the OK button. You can change any part of the dialogue box, and resubmit it by pressing the OK button again, or press Cancel to close the dialogue box and start again.

9.2. Sorting solutions

By default, the solutions to a query are displayed in their order of appearance within the corpus, alphabetically ordered by its three character filenames. This is rarely of any particular significance, except to group solutions from the same text, and so it is generally desirable to reorder a line mode (concordance) display. This is done by selecting the Sort command from the Query menu, which displays the Sort dialogue box.

You can use the radio buttons in this dialogue box to specify either one or two keys for the sort, and a single collating sequence, applicable to both keys. The keys determine which part of each hit is to be used to sort the solutions; the collating sequence determines how these keys are to be compared when deciding on their relative order.

The Primary keys for all the context lines are compared first, according to the collating sequence indicated. If any duplicates are found, the Secondary keys are used to order them. Note that the same collating method must be used for both keys.

The Span box indicates how many words make up the key in each case. The Left, Centre or Right radio buttons indicate the position of the key relative to the query focus (i.e. the hit word, phrase, or XML element in the context). If the Left radio button is selected, and the Span is 1, the key will be the word to the left of each query focus. If the Centre radio button is selected, and the Span is 1, the key will be the first word of the query focus itself. If the Right radio button is selected and the Span is 1, the key will be the first word following the query focus.

The Ascending and Descending radio buttons indicate whether the keys are to be sorted into ascending or descending alphabetical order.

The collating method used for both keys is indicated by radio buttons to the right of the dialogue box.

9.3. Thinning solutions

Selecting the Thin command from the Query menu opens up a sub-menu from which four selections are available, each of which allows you to reduce the number of solutions for the current query. The commands available are:
Selection
discards from the solutions all those which have not previously been selected (i.e. all those solutions which do not appear on the screen in reverse video are discarded);
Reverse selection
discards from the solutions all those which have previously been selected (i.e. all those solutions which appear on the screen in reverse video are discarded);
Random
solutions are discarded at random until the number of solutions matches the number you specify in a subwindow;
One per text
discards all but the first solution from any one text.

The current item in a displayed list can be selected either by double clicking on it, or by pressing the space bar.

Each time you request a random selection from a given set of solutions, you will get a different random sequence. The only way to get the same random selection more than once is to save the query after thinning it. When a thinned query is saved, any thinning is saved at the same time.

9.4. Options for displaying solutions

The solutions to a query can be displayed in one of two modes and in one of four different formats. You can also vary the amount of context or scope displayed for each solution. Which options are in effect for a particular query will depend on the initial settings specified by the User Preferences dialogue box (see 12.4. User preferences).

9.4.1. Display mode

In line mode, each occurrence of the item searched for is displayed as a single line on the screen; in page mode, each occurrence is displayed in full on the screen, taking as many lines as necessary.

The Concordance button is used to switch between one mode and the other. The initial mode is set by the Concordance checkbox in the User Preferences dialogue box (see 12.4. User preferences): if this is checked, line mode is used; otherwise page mode is used. Clicking on the Concordance button or selecting the Concordance command from the Query menu enables you to switch modes for a particular set of solutions.

The usual Windows controls are available to enable you to display different parts of a large set of solutions. In line mode, you can use the vertical scroll bar to the right of the window to scroll up and down the solutions; in either mode, you can use cursor keys, PgUp and PgDn, Home and End, to move through the solution set in the usual way.

9.4.2. Display format

The appearance of solutions being displayed is determined by the stylesheet in use. Two default stylesheets are provided: ‘plain’, which displays just the words and punctuation of a hit, with the query focus in a diggerent colour; and ‘XML’, which displays the full XML tagging of the hit. Your corpus may have been pre-configured to use its own stylesheet which will display results in a different way, or you can use the stylesheet editor (9.4.4. Stylesheets) to create or modify one.

A list of the available stylesheets is displayed in a drop down box on the tool menu: to change the appearance of solutions simply choose the stylesheet you wish from the list.

9.4.3. Display scope

The query focus is that part of a downloaded hit which is normally highlighted within the display. In a simple word, patterm, or phrase query, it is the whole of the word or phrase found which matched the query. In an XML query, it is the XML start- or end-tag which matched the query. In a Query Builder query, it is either the part of the text which was matched by the last content node, i.e. that nearest the bottom of the screen, or the part matched by a group of content nodes joined by Next links.

Whichever stylesheet is in force, you can change the amount of data displayed to the left and right of the query focus by right clicking on it with the mouse. This will enlarge the scope by one XML element to the left and the right each time you click. Alternatively, you can use the scrollable numbers on the toolbar to expand or contract left or right contexts independently.

9.4.4. Stylesheets

A Xaira stylesheet offers a subset of the formatting capabilities of the W3C cascading stylesheet language. You can set properties such as font, colour, weight or size independently for different elements, absolutely or depending on their context, or on attribute values. You can also specify text to be displayed before or after each element occurrence, including values taken from specified attributes.

Stylesheets files can (currently) only be edited by the Xaira program. They are held in the user directory along with query results etc.

The following commands are available to manipulate stylesheets:

9.4.5. Additional components of the Query window

In addition to the display of solutions, the query window can contain two other components, each in a separate pane.
Query Text
The Query Text command from the Query menu opens or closes a pane in which the CQL text of the current query appears. This cannot be changed, but is useful for documentary purposes. For the syntax of CQL, see section 3.9. Defining a CQL Query. Any thinning options applied to the query are also displayed.
Annotation
The Annotation command from the Query menu opens or closes a pane in which you can write any comment or annotation you wish. Such documentation may be useful for future reference when re-running a query.

Both query text and annotation are saved together with the query, along with any valid bookmarks you defined for it.

9.4.6. Exporting results from Xaira

Selecting the Listing command from the Query menu opens a standard file dialogue box in which you can specify a name for the file in which the current solutions are to be saved. The solutions are saved in XML format in a file with the same name as the query itself and with the suffix .xml.

The Save button on the Word Query dialogue() may be used to save a copy of the currently-displayed list of word forms and frequencies. Pressing this button opens the Save Frequency Table dialog:

Up: Contents Previous: 8. The Texts menu Next: 10. Displaying source information and browsing