Welcome

Data Sets
Overview
Creating New
--ASCII Text
--XML
--Google Harvest
--Web Harvest
Settings
--Fields
--Stopwords
--Stopmajors
--Punctuation Rules
Editing
Merging
Exporting
Importing
Subsetting

Visualizations
Galaxy
--Basics
--Outliers
ThemeView
Settings

Tools
Document Viewer
Gist
Groups
--Basics
--Evidence Panel
Major Terms
Queries
Print
Probe
Time Slicer

About version 2.2
Overview
Known issues

Queries

queries window

Accessing the Queries window

queries button Click the Queries button on the toolbar, or
  From the Windows menu, choose Queries

Types of queries

You can use the Query Type dropdown list to choose either Words in Document or Query By Example.

  • Words in Document looks for documents that contain combinations of Query Text words. Queries can be constructed using the Boolean operators AND,OR,NOT. If no operator is specified, query words are joined with the Boolean AND, resulting in each document in the result set containing all the query words.
  • Query By Example allows you to find documents having related content rather than exact word matches. To do this, it creates a "mathematical signature" of the Query terms and then looks for documents having a similar signature. The slider controls the number of hits, i.e., how similar the result set documents are.

To construct a query

For a Words in Document query, choose Words in Document from the Query Type dropdown list, and then do one of the following:

  • Type a word or words in the Query Text box, and select one or more fields to search. The terms are AND'ed together and all fields are searched.
  • Copy words from Gist’s word list (see Gist) and paste them into the Query Text box.
  • Copy words from the Major Terms window and paste them into the Query Text box.
  • Type a phrase in quotes, for example, "islamic jihad", in the Query Text box, and select one or more fields to search. Within the phrase you may use an asterisk (*) as a wildcard. See Using an asterisk in a query (below).
  • Connect words in the Query Text box with AND, OR, or AND NOT, to construct a Boolean query (parentheses are ignored, as are !, XOR, and |).
  • Reuse one of the queries in the Query History list. Click on the query you want to use; it appears in the Query Text box.
  • Reuse a saved Query Set.

Using an asterisk in a query
You can use an asterisk in a "phrase" query as a "wildcard" placeholder, in place of either character(s) or word(s). Use an asterisk:

  • At the end of a word for word stemming. For example, "defen*" will return documents containing any words beginning with "defen", including "defense", "defend", "defensive", etc.
  • Between words and followed by a number, to take the place of a number of (unspecified) words. For example:
    Query Example Results

    word1 *4 word2 will return documents containing from 0 to 4 unspecified words between word1 and word2.
    For example,

    New York *4 team

    the New York team is...

    New York Rangers team members

    New York Yankees baseball team

    New York Mets famous baseball team

    New York State civil service employees' team

For a Query By Example type of query
1. Choose Query By Example from the Query Type dropdown list.

2. Select the document(s) you want to use as an example
3. Open the Document viewer.
4. Copy the text you want to use as the example.You can use one complete document as your example, or you can use parts of several documents.
5. Paste it into the Query Text window.
6. Click Query All or Query Within Selection to run the query.

To query all of the documents in the data set
Click Query All.

To query with the selected documents only
Click Query Within Selection.

To select the results of a query
Construct a query by one of the methods listed above in Constructing a Query, and click the Query button. Documents satisfying the query, the result set, will be selected.

To create a group with the results of a query
Click the Group Results button. The new group will appear in the Groups window.

To save the queries in the Query History list for use later with this data set
Queries are automatically saved when you close the data set or exit IN-SPIRE. Choosing File > Save Session also saves queries.

To save any of the queries in the Query History list for use with another data set
See To create a new query set (below).

To Use a saved Query Set in the data set that is open
On the main Queries window, click Save/Load. The Save/Load Queries window opens to display a list of all the Query Sets that have been saved.

You can:

  • Browse the queries in a Query Set and select one to run
  • Create a new Query Set
  • Delete a Query Set or any of the queries in it
  • Edit an existing Query Set, adding queries or groups created from queries to it.

To browse the queries in a query set
Click on the small "switch" to the left of the Query Set name. The Query Set folder opens to reveal its members.

To create a new query set
1. On the Queries window click Save/Load... The Save/Load Queries window opens.
2. On the Save/Load Queries window, click New... The Saved Query Set Properties panel.

3 . Name the Query Set (the Folder Name).
4 . Choose queries to add to it from the Candidate Members panel. You can select multiple items. See Selecting several items from a list.
5. Click Save. The Saved Query Set Properties closes and the queries you have added appear in the panel to the left.

To delete a query from an existing query set
1. In the list of query set members, click on the query you want to delete.
2. Click Delete.

To add queries from the present Query History to an existing query set
1. Click on the name of the query set you want to modify.
2. Click Edit... The window opens out to the right to show the Saved Query Set Properties.
3. Choose queries to add to it from the Candidate Members panel. You can select multiple items. See Selecting several items from a list.
4. Click Save. The Saved Query Set Properties closes and the queries you have added appear in the panel to the left.

Using Run Queries
The Create Groups button on the Save/Load Queries window will load queries into the Query History list if they are not already there, run the queries in the selected queries or query set, and create a group for each of them.

On the Save/Load Queries window, click on the set or select the queries within a set that you want to run, then click Create Groups. Each query is run in turn, and a group is created for each result. Open the Group tool if it is not already open, and notice that the query set is a folder, and each member query is listed below it. If any of the queries are Queries By Example, look in the Query History list, select that QBE query, and manipulate the slider on the Query window to identify documents similar to the example text. You can group the selected documents to capture results from QBE queries.

To see helpful information about a part of the Query window
Hover the cursor over it. Information will appear in the Help panel at the bottom of the window.