In this paper we present an approach to represent schema information,
application data and integrity constraints as a logic program in form
of Datalog. The schema information is supplied as an enhanced entity r
elationship (EER) model which is transformed by a one-to-one mapping i
nto a set of ground facts. The application data corresponding to the s
chema is also represented by ground facts in a single table. In order
to check whether the application data conforms to the given schema, ge
neric functional and inclusion dependencies are introduced, which can
be mapped into concrete dependencies using the schema information. The
concrete dependencies are used for checking the consistency between a
pplication data and the schema. The formulation of the constraints bas
ed on functional and inclusion dependencies led to a small extension o
f the EER model by allowing identifying attributes in relationship typ
es. This extension leads to both simpler constraints and simpler EER a
pplication models. Furthermore, we provide a meta EER model which can
be used to check whether the application EER model is a structural val
id EER model. Any application EER diagram is an instance of the meta E
ER diagram which can be specified using the proposed application data
representation. The same integrity rules can be used to check the conf
ormance between the application data and the application EER diagram,
the meta EER diagram and the application EER diagram, and finally it c
an be used to check the meta EER model itself.