Published: Early 1980s
Author: S. R. Petrick, IBM Research
Abstract
In the early 1980s, the challenge of Natural Language Access to Databases (NLIDB) centered on bridging the gap between the inherent ambiguity of human language and the rigid, schema-dependent nature of relational databases. This paper details the TQA (Transformational Question Answering) System, a pioneering framework that utilizes transformational grammar to translate natural language queries into SQL. By employing a multi-layered pipeline—moving from surface English to a deep linguistic representation and finally to a logical calculus—the TQA system systematically addresses complex issues such as quantification, semantic mapping, and implicit multi-table joins.
Introduction
As database management systems matured, the need for intuitive interfaces became paramount. However, natural language is flexible and context-dependent, while SQL requires literal precision. S. R. Petrick identifies three primary technical hurdles for NLIDB systems: handling aggregate and quantity questions (e.g., "How many...?"), mapping semantically complex phrases to specific database attributes, and resolving multi-file queries (joins) without requiring the user to specify foreign key relationships.
The TQA Pipeline and Methodology
The TQA System addresses these hurdles through a pipeline based on Transformational Grammar and Knuth Attribute Grammars. The translation process follows a specific trajectory:
- Surface Structure: The raw English sentence input.
- Underlying Structure: A deep linguistic representation that strips away surface-level syntactic variation.
- Logical Form: A representation in Set Domain Relational Calculus.
- SQL: The final executable database query.
Mapping Language to Logic
One of the system's core strengths is its use of "precyclic" and "postcyclic" transformations. While some transformations are application-independent, others are application-specific, mapping lexical items to specific database tables. For instance, the system uses feature-triggered mapping; a noun like "parking space" might carry a + UNIT feature that triggers a SUM operation in SQL, whereas a noun without that feature might trigger a simple COUNT.
To handle the complexity of joins, the system assigns logical variables (e.g., $X1, X2$) to noun phrases. If the linguistic analysis reveals that two different relations in the underlying structure refer to the same variable, the system automatically identifies this as a join condition, sparing the user from understanding the underlying schema.
Quantification and Complexity
Quantification—handling terms like "how many," "for all," or "at least"—is managed by translating these into set-domain expressions. The system elegantly handles universal quantification ("For all X, Y is true") by normalizing it into a negative existential form ("There does not exist an X such that Y is false"), which maps directly to SQL’s NOT EXISTS operator.
Real-World Application: The White Plains Experiment
The TQA system was evaluated using a real-world land-use database for the city of White Plains. This application involved complex relations such as PARCFL (parcel information), LUCF (land use codes), and ZONEF (zoning). The system successfully translated sophisticated queries, such as "What gas stations are in a ward in which there is no drug store?", into nested SQL queries involving multiple tables and negative existential quantifiers.
Conclusion and Legacy
While the TQA system demonstrated that principled transformations could bridge the gap between English and SQL, Petrick acknowledged the significant "linguistic engineering" required to produce adequate grammars. Despite these challenges, the system's use of a deep structural intermediate level provided a robust framework for separating linguistic complexity from database schema, a concept that remains influential in the design of modern natural language interfaces.
Summary updated