Query

The Query function enables you to search the dataset for specific words, concepts, and phrases.  You can use several powerful query techniques, including Word Query, Query by Example (QBE), and Query in Notes.  

 

Using the Query Window and Selecting a Query Type

To open the Query window, perform the following procedure.

 

  1. Click the Show Query button queries button on the IN-SPIRE main window toolbar, or from the Tools menu on the IN-SPIRE main window, select Query.

    The Query window will display with the Word Query tab visible.  The main query types display in tabs across the top of the Query window.  

  2. Click on a tab to display the related query tool.

All query text is interpreted in a case-insensitive manner, which means capitalization is ignored.  This applies to all types of queries, including inside phrases.

Constructing a Word Query

A Word Query enables you to search for words in a document.  To create a Word Query, perform the following procedure.

 

  1.  If necessary, click on the Word Query tab.  The Word Query tool will display.

  2. Type a word or words in the Query Text box.

  3. Select the Fields you want to search.  You can either search All Fields (the default) or select one or more fields to search by clicking on the items in the Fields list using Ctrl-click.  The terms are combined with the AND operator and all selected fields are searched.  The Query button will be enabled.

  4. Select whether you want to Query all documents or Query only selected documents by clicking on the option under the Query Text box.

  5. Click Query.  The query will run, with the results being highlighted in the Galaxy.

  6. In addition to steps 1-4, you can use any of the following refining techniques to perform a Word query.

  1. Click Group Results to create a group  in the Groups tool composed of the documents in your query results.

Word Queries and Fields

If you pick more than one field, it is important to note that the entire query is run against each of the specified fields separately.  Such a query returns documents for which one or more of the selected fields satisfies the query.  The query is not applied across the specified fields.  For example, suppose you selected the TITLE and AUTHOR fields, and then entered the following query:

 

            Abbott and Costello

 

This would return documents with both words, Abbot and Costello, in the title, or both words in the author field, or both words in both fields.  Note that this query would not return a document with the following field content:

 

            TITLE:  The Life and Times of Bud Abbott

 

            AUTHOR:  I. B. Costello

 

This is because neither field, taken by itself, satisfies the query.  One effect of this rule is that selecting all of the individual fields in the Fields list is not equivalent to selecting All Fields.

Understanding Relevance in Word Queries

Word Query can quantify and provide relevance feedback from Boolean queries, analogous to and consistent with the "closeness” quantity computed for Query by Example (QBE) results.  Relevance is made up of the following components:

 

Customizing Punctuation Rules

Punctuation rules apply not only to the query expression, but to the content of any document to be searched.

Phrase queries take full advantage of the power and flexibility of the punctuation rules, without sacrificing accuracy.

For example, suppose you want to “de-hyphenate” all hyphenated words, such that “hold-up” maps to “holdup.”  You can customize the “middle” rule for the hyphen such that it is null rather than a space.  Now, a document that contains both "holdup” and “hold-up” would respond exactly the same to a query for the word holdup, the word hold-up, the phrase "holdup” “hold-up.”

Constructing a Query by Example

Query by Example enables you to find documents similar to or "close to" a document you have by searching the dataset for documents containing words or phrases similar to an example you supply.  To create a Query By Example, perform the following procedure.

 

  1. Click the By Example tab.  The Query by Example panel will display.  Text highlighted in blue indicates major terms.


  2. In the Galaxy, select the document or documents you want to use as an example.

  3. Open the Document Viewer.

  4. In the Document Viewer text area, find a phrase you think significant.  Highlight the phrase you want to use as your query, and right-click.  A drop-down menu will display.

  5. Select Query by Example from the drop-down menu.

  6. The Query will run and the results will display in the Query by Example tab in the Query window.

    The initial results will pinpoint the one document in the dataset that supplied the phrase on which you based the query.  

  7. To see documents that contain words and phrases similar to the ones you selected as the query, move the Query Results slider to the right.  The number of documents containing similar words will go up as you move the slider and the tally is displayed under the Quantity axes of the Query Results histogram.

    The documents will highlight in the Galaxy as you move the slider.  Note that as the Quantity of documents goes up, the Quality of results will go down.  

  8. Click the Group Results button to form a group in the Groups tool of the documents you found with the Query by Example.

  9. View the documents in the new group with the Document Viewer.

Querying Within Document Notes

Query in Notes enables you to find words and phrases in notes attached to documents.  These are notes you or colleagues may have created.  If a dataset has not been annotated, a query on the notes will yield no results.  To create a Query in Notes, perform the following procedure.

 

  1. Click the Notes tab.  The Notes panel will display.

  2. Enter the word or phrase you want to search for in the appended document notes.  

  3. Select whether you want to Query all documents or Query only selected documents by clicking on the option under the Query Text box.

  4. Click Query.  The query will run, with the results being highlighted in the Galaxy.

  5. Click Group Results to create a group  in the Groups tool composed of the documents in your query results.

Performing Typical Query Activities

The Query tool offers a number of tools that enable you to refine your document searches.

 

Grouping Query Results

To create a group with the results of a query, click the Group Results button. The new group will display as a locked group in the Groups window under the Selection History folder.  The new group will have the same name as the query.

Queries are automatically saved in the Query History list as you create them.  

Using an Asterisk in a Query

You can use an asterisk in a phrase query as a wild card placeholder as a substitute for either characters or words. Use an asterisk 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

Since IN-SPIRE removes punctuation, contractions such as "don't" are seen as 2 words, "don" and "t".  Use wildcards such as *2 as described in the above table to find possible contractions.

Working with the Query History Window

The Query History panel of the Queries window keeps a list of all the queries you run on the dataset.  The Query History will display the type of query and the number of document 'hits' the query yielded.  

You can rerun a query at any time by selecting it from the list and clicking the Query button.

You can select a Word query and run it as a Query in Notes or as a Query by Example to yield different views into the dataset.

Deleting a Query from the Query History

  1. In the Query History list of queries you have run, click on the query you want to delete.

  2. Click Remove  The query will be removed from the Query History list.

Translating Queries

If you have a translation engine installed on your system or server, you can use the integrated translation capabilities of IN-SPIRE to formulate bilingual queries.  Once you have the translation turned on, perform the following procedure.

 

  1. Load a foreign language dataset.  

  2. Once translation is turned on and you have selected the language you want to translate, click the Query button.

  3. The Translate button in the Query window becomes active.

  4. Enter a Query in the Query Text box.  For this example, we will perform a Word Query on a Spanish language dataset.  To query the dataset for the word 'horse', we typed the term in the Query Text field.

  5. Click the Translate button.  The query terms will be translated and will display in both languages.

  6. Click the Query button.  The translated query will be run on the document dataset and the results will display in the Query History.  

  7. Click Group Results to group the documents found by the bilingual query.  You can view these documents in both languages in the Document Viewer.

 

 

 

4/24/06