SOFTWARE—PRACTICE AND EXPERIENCE, VOL. 23(3), 317–340 (MARCH 1993) Query by Diagram: a Visual Environment for Querying Databases giuseppe santucci Dipartimento di Informatica e Sistemistica, Universita ` degli Studi di Roma ‘La Sapienza’, Via Salaria 113-00198 Rome, Italy and pier angelo sottile GESI Gestione Sistemi per l’Informatica Via Rodi 32-00195 Rome, Italy SUMMARY In recent years, several attempts have been made to define query languages characterized by both high expressive power and easy query formulation. Several issues concern graphical applications, based on the diagrammatic representation of a semantic model and visual interaction. This paper describes the architecture and the implementation of a graphical query system, based on the diagrammatic representation of entity relationship schemata. The query language underlying the system allows the formulation of recursive queries; moreover, user interaction in both managing diagrams and expressing queries is simplified by the presence of a fully visual environment and a rich set of interaction strategies. key words : Entity relationship model Visual query language User interfaces INTRODUCTION A central development in the database area concerns tools that allow non-expert users to understand and easily extract information from a database. Fourth-generation query languages, 1–5 although not procedural, are not friendly enough for a casual user who must know both the logical structure of the database and the syntax and semantics of the DBMS language. Instead, proposed visual or object-oriented query languages, 6–11 which allow a user to extract information by means of graphical commands, have not yet been able to combine ease of use and high expressive power. A key issue, in order to build a bridge between the end-user and the data, is to represent the database by means of a semantic model and to define a visual query language on it. In this way, we obtain full independence not only from the physical implementation of the database but also from the logical model. Moreover, in a semantic model, the existing relationships among objects are explicitly represented, and not ‘embedded’ in obscure attribute equivalences, as in the relational model. Several results 12–14 argue that the entity-relationship model (E-R in what follows) 15 is a good candidate in order to reach the above goals. The choice falls on this model for several reasons. First of all, the model is often used in the database- 0038–0644/93/030317–14$17.00 Received 15 November 1992 1993 by John Wiley & Sons, Ltd. Revised 15 May 1991 and 3 September 1992