A method and system for generating a user interface in a database management system. A semantic data model is used to describe a database in terms of data types stored in the database and functional types that describe relationships between the data types stored in the database. The system dynamically queries the data model to generate a graph of the data model itself. These queries are initiated by the system without user intervention. The user selects a node on the graph that causes the data model to be searched again to determine the name of the node selected, one or more types of relationships associated with the node selected and one or more instances of the relationships associated with the node selected. This information is used to generate a form containing a plurality of blanks. A user enters a query constraint into one or more of the blanks and the database is searched for instances of data meeting the query constraints. The data model is easily adaptable to reflect changes in the architecture of the database. The user interface reflects those changes without the need to recode or recompile the software that generates the user interface. Also because the data model is semantically the same throughout, the same functions can query the data model itself as well as the data represented by the data model.