Real-world ontologies have associated data sets. In order to exploit ontologies as a means to provide semantics to the data it is necessary not only to reason about concepts and their properties but also to be able to query the underlying data and efficiently obtain answers. We view ontologies as conceptual schemas that are populated with data. We define a generic graph-based representation for ontology schemas and provide a language for querying ontologies. This language is appropriate for ontology transformation and ontology integration. We show how ontologies can be integrated by defining views over multiple ontologies, and how user queries can be specified using views. Our approach can be easily implemented on top of a relational database management system.