Testing an English Query Model

English Query

English Query

Testing an English Query Model

Test the English Query model before compiling it into an application to make sure that the questions users are likely to ask are supported by the model and then modify it accordingly. After you are satisfied with the performance of the model, build it into a compiled English Query application (*.eqd file).

The Suggestion Wizard is available within the Model Test window and is useful during the testing phase. You can start by asking a question that users are likely to ask. Suggestion Wizard presents suggested entities and relationships needed to answer the question.

Model Test Window

The Model Test window in English Query enables you to test the English-to-SQL translation of your model and the execution of the resulting database query before compiling the application.

Note  For the data values to appear in the Entity list box in Question Builder, you must select Sample Data on the Data Connections tab before compiling the application.

In the Model Test window (available from the Start command on the Debug menu), you can use the Analysis feature to review the entities for functioning and for questions that return incorrect answers.

When testing a model, questions can be saved to a regression file with the Save Query command. A regression file is automatically created with each project. There can be multiple regression files, but questions are saved in the first regression file under the project in the Project Explorer window.

An output file can be added and then compared with the original file if the files have names that differ from one another. You can also promote an output file to the new regression file. Regression output is displayed in Extensible Markup Language (XML)-tagged format, which differentiates the questions, restatements, answers, and SQL statements for easier editing.

Suggestion Wizard

The Suggestion Wizard, which is also available from the Model Test window toolbar, suggests entities and relationships for answering ambiguous questions.

The Suggestion Wizard analyzes the question and looks for unknown or ambiguous entities. For each of these entities, it displays a sentence in the form "<word> refers to an <entity list>." You may select an existing entity from the entity list, or create a new one by using the new entity button.

For pronouns or ambiguous entity names, simply associating the word with an entity is enough. For undefined entities, the Suggestion Wizard asks you to clarify the definition in one of several ways:

  • As a synonym for the entity

    This is appropriate if, for the purposes of the database, the word means exactly the same as some other word. For example, "films" might be a synonym for "movies."

  • As an instance of the entity

    For example, "Clark Gable" might refer to an instance of entity "actor."

  • As a subset of the entity type

    For example "documentaries" refers to "documentary," a subset of the entity movies.

After the entities have been added or clarified, you may have to define relationships among them. This is done by validating the correctness of the declarative sentences that the wizard generates from the question.

For relationships that are described as adjectives, the wizard displays a more complex set of sentences. If the sentence does make sense, you can define the meaning of the adjective relative to the base entity in one of the following ways:

  • As an ignorable adjective, for cases in which the adjective isn't important from the standpoint of the database. For example, all customers are "valued" customers.

  • As an adjective based on the value of another entity. There are two sub-cases of this:
    • The other entity can either be a measurement of the base entity (for example, old movies are movies whose age entity is greater than 40).

    • The other entity stores adjectives (or codes mapping to adjectives) describing the base entity (for example, "Disaster" movies are movies that have "Disaster" in their genre).
  • As an adjective based on a SQL condition.

    This option is not available for OLAP-only projects.

When you complete the Suggestion Wizard, it updates your model with new entities and relationships based on your answers.

To save a regression file