This extension enables the system to capture the semantic constraints and its user-guiding actions in a domain-independent grammar. To implement the intraquery guidance, we extend context-free grammar by associating context variables with each grammar symbol and attaching several types of procedural decorations to grammar rules. For example, the system prunes the field rank (as well as the field dept) in the conjunctive extension of Q2, because the derived condition restricts the value of this field to a constant.Īs shown in examples, we apply Kaleidoscope's approach to two linear-syntax languages in different levels of abstraction SQL and a query language whose syntax and semantics cover a subset of wh-queries. Because this derived predicate is not subsumed by Q2's query condition, the system suspects that the user may not know of it and presents it to the user.ĭerived predicates, together with user-selected ones, constrain the user's further conjunctive extension of the partial query condition. With the replacement of rule variable p in IC by Q2's range variable p#1, IC's leading two predicates subsume Q2's query condition, producing p#1 rank = 'Assistant'. This rules states that a CS professor whose salary is less than 45000 is an assistant professor. Suppose that the system has an integrity constraint FROM professor p IF p dept = 'CS' AND p salary < 45000 THEN p rank = 'Assistant' To illustrate this, consider a partially constructed SQL query SELECT * FROM professor p#1 WHERE p#1 dept = 'CS' AND p#1 salary < 40000 It informs the user of any derived predicates on the completion of a user-selected predicate.
The system provides additional guidance for users to avoid creating semantically inconsistent queries. With Kaleidoscope's process of choice generation tightly controlled by the system's knowledge of query language and underlying data, users need not remember the query language and the underlying database structure but merely recognize or identify the constituents coming one after another that match their intended query. To guide the user's entry of values, the system provides a pop-up menu for each value domain. If a choice is unique as in (3+), it is taken automatically. For instance, it takes four steps to create the following query Who/ 1 authored/ 2 'Al'/ 3 journal papers/ (3+) in 'Postquery COOP'/ 4Īt each of such steps, as the user selects one of menu choices, the system updates its partial query status window. The system generates valid query constituents as menu choices step-by-step by interpreting a language grammar, and the user creates a query following this menu guidance. To enable this early, active engagement in the user's process of query creation, Kaleidoscope reduces the granularity of user-system interaction via a context-sensitive menu. We call this type of cooperative behavior intraquery guidance. Kaleidoscope is a cooperative query interface whose knowledge guides users to avoid most failure during query creation. These may include spelling mistakes, the violation of the syntax and semantics of a query language, and the misconception of the entities and relationships in a database. However, because the knowledge in human long-term memory is imprecise, incomplete, and often incorrect, user queries are subject to various types of failure. Querying databases to obtain information requires the user's knowledge of query language and underlying data.