A database retrieval system having a natural language interface is provided. A database developer creates a knowledge base containing a structural description and semantic description of an application database from which data is to be retrieved. A database independent, canonical internal meaning representation of a natural language query is produced. An expert system accesses structural and semantic description information in the knowledge base and, in accordance with predefined rules, identifies database elements from said information that are necessary to satisfy the query represented by the internal meaning representation. A database query is generated among the database elements, enabling the retrieval and aggregation of data from the database to satisfy the natural language query. A debugging facility derives an external meaning representation from the internal meaning representation. The external meaning representation is database-independent, canonical, and easily understandable to the database developer. The external meaning representation enables the database developer to comprehend the internal meaning representation and verify that a natural language query is properly interpreted by the system to effect the accurate retrieval and aggregation of data from the database. The external meaning representation comprises entities and constraints relating to the entities, without reference to factual or linguistic relationships between entities that would prevent the external meaning representation from being easily understood.