| Project Home Page | Publication |
Automatic Model Transformation
From Frame-based Models to Relational Models
Transformation Rules as described in [2]
T1. A class, C, is transformed to either a relational table or view, RC, depending on the class's role descriptor and position in a hierarchy.
- If C is a concrete leaf class, create a table, and add primary key, ID.
- If C is a concrete non-leaf class, i.e. has a set of subclasses, transform C to a table, RC . Then create a view, Rc, which selects from the union of RC and all its subclasses' corresponding tables.
- If C is abstract, create a view that selects from the union of all its subclasses' corresponding tables.
- If S has a primitive value type, i.e. string, integer, float, Boolean, and symbol, and has cardinality of 0 or 1, create an attribute, As. As is associated with RC (T1), and has a corresponding relational model primitive type.
- If S is an instance of a class, C , and has cardinality of 0 or 1, create a foreign key (in RC), FC', which references RC . (create an foreign key for each subclass of C' if it's non-leave) (if C' is abstract and non leaf, this will still work. But no foreign key to c'. if C' is abstract and leaf, this will work with foreign keys to only the subclasses.)
- If S has cardinality multiple, create an association table, RS. Add foreign key FC to RS referencing ID in source table, RC. Create AS for S in RS according to single cardinality rules in T2a or T2b.
A1. T2 (alternative) Transform only owned slots to attributes. Add foreign key for each superclasses' transformed tables.
A2. T2.a (addendum) Symbol type in Protégé can either be implemented character type in most relational databases. MySQL has enumerated type that works well for this purpose.
A3. T2.c(addendum) Depending on the actual implementation database, an alternative to T2.c is to transform slots of primitive types and cardinality multiple to array type in some database.
A4. Drop one of the slot-inverse pair from Protégé and keep the one with minimum cardinality.
A5. Slot with value type Any because it does not conform to the definition of a model; every object has a type.
A6. Slot with value type Class is ignored in current version. It will be implemented in future versions. Value type class represents definition of a class, hence, the schema. This is a useful value type for representing templates in for protocols.
Last modified April 3, 2005 by Hao Li (haoli(at)u.washington.edu)