Representing ER models (and other abstractions) in ISO Schematron

by Rick Jelliffe

Here is a way to express basic Entity Relationship model using ISO Schematron. Schematron allows you to model entities and various relationships using "abstract patterns" (a parameterized macro facility.) You can use the same idea to model other kinds of diagramming and modeling systems.

I think what it quite powerful about this approach is that we can separate the information relationships from the XML serialization. Fields can be child elements, attributes, attributes of the parent, any kind of XPath, we don't care. Similarly, if two fields are related, they may use a key or containment, but we don't care. If you like you see this a technique for capturing information from a model in a form which also happens to hook into Schematron validation; but you can use the captured model for non-Schematron purposes too!

(This is an updated version of a post to XML-DEV mail list, in Nov 2006.)

2 Comments

W^L+
2007-03-22 16:48:29
Hey, that's cool!


I'm assuming then that there could be an automated way to go from this to the SQL DDL. Is this set to go into the ISO standard any time soon? Or will your implementation be the only one?


I ask because this looks like it would be really useful for designing relational databases. It looks like the kind of tool that everyone that deals with them would want.

Rick Jelliffe
2007-03-22 21:35:16
W^L+: Thanks. Yes, if there is any demand, a mapping between DDL and Schematron would be logical to provide.


There are already tools for DDL to XSD, so I don"t know whether everyone would actually want or need this.