Conceptual models, like the Entity-Relationship (ER) model, provide a high-level abstraction for information on a given application domain and are useful for database design, reverse engineering and semantics integration.
XML Schemas (XSD) are an XML language developed by the W3C as a substitution for Document Type Definitions (DTD). Initially designed only to better define the structure of XML document classes, Schemas are gradually becoming another powerful model to describe the fragments of reality of our universe of discourse.
Therefore, having a standard presentation of the conceptual model induced by XML Schemas is helpful in designing better applications. Xere is a mapping algorithm which allows the translation of XML Schemas into Entity-Relationship diagrams.
The Xere algorithm is being developed and it currently handles:
We are working to add support for:
Since XSD are written in XML, the prototype implementation of the Xere algorithm is coded in XSLT language. The Xere stylesheet takes a Schema definition and outputs a XML document describing the corresponding ER diagram.
To test the Xere algorithm, you can download the Xere stylesheet and apply it to your schemas, or try the online transformation tool.
The Xere stylesheet can be downloaded
here. It has to be considered as alpha software, so it is not guaranteed to be bug-free.
To use the stylesheet you need:
The output XML document of the Xere stylesheet is written with a very simple XML language. The following table describes the elements used. You can also download the schema definition for this language.
Element name | Attributes | Children | Description |
---|---|---|---|
entity
|
name
- the entity name.
|
zero or more
attribute
elements, defining the entity attributes.
|
Defines an entity in the ER diagram. |
attribute
|
name
- the attribute name.
type
- the attribute type.
|
None. |
Defines an attribute for an ER entity. The special names
value
and
text
are used for attributes holding the element simple value and the mixed element text, respectively.
|
relation
|
from
- name of the first entity in the relation.
to
- name of the second entity in the relation.
card
- cardinality of the relation in the form "a,b-c,d", where (a,b) is the cardinality on the
"from" table side.
|
None. | Defines a binary ER relation. |
specialization
|
base
- the specialized entity.
|
one or more
entity
elements, defining the possible specializations.
|
Defines an ER total specialization construct. |
er
|
None | None. | The document root. |