Entity Defaults

English Query

English Query

Entity Defaults

Whenever an entity is used in a query, all appropriate defaults are attached to it. For example, if the entity customer has a default indicating that the customer must be a current customer, then the question, "Show the customers" is interpreted as "Show the current customers."

An entity default consists of a relationship in which the entity participates and, optionally, one or more conditions on the other entities in the relationship. For example, a relationship customers have statuses with a condition that the status must equal "current" is a default entity.

Note  The default conditions are English conditions, not SQL conditions. For example, for the relationship customers have statuses, the condition is "current," not "c" (the code in the database that corresponds to "current").

To override the defaults:

  • Users can specify "all" of an entity in their questions. For example, "Show all the customers," is interpreted by English Query as "Show the customers," without the default.

  • Users ask questions that explicitly contradict a condition in the default. For example, "Show the inactive customers" contradicts the default status of "current."

  • Specify a relationship that implicitly contradicts a default condition (for example, to specify the condition "stores that have gone out of business" contradicts the default status of "current"). When a user asks "Which stores have gone out of business," the default is not added.

You can also create entity defaults that are negated relationships. For example, an entity might have a negated relationship as a default so that a question such as "Show the customers" is interpreted as "Show the inactive customers." To create a negated relationship, customers are not inactive, chose customers are inactive and select Invert in the Add/Edit Entity Default dialog box. The default is the inverse of the relationship.

Note  These are English conditions and not SQL conditions.

See Also

Associating Entities

Creating an English Query Model

Defining Entities in an English Query Model

Entity Name Synonyms

Entities as Roles

Expanding an English Query Model

Testing an English Query Model