We generate XML schemas (.xsd files) from the intermediate representation. We use the following transformation rules: package rules, output files etc ------------------------------- - each package is generated in its own file, named .xsd. - packages import (and assign a prefix to) all parent packages - packages import (etc) all packages with which they have a dependency relation - packages import (etc) all packages that contain objects referred to by types in the package. This is only possible if the package depends on the referred to package, which may be applied recursively. MUST STILL BE IMPLEMENTES - package prefixes are created from the order a package has in the collection of all packages, prefixed with a p. - all schemas are put in a directory named after the owning package, i.e. the directory hierarchy follows the package hierarchy. attributes and relations ------------------------ - attributes and collections are mapped to elements of the appropriate type in the containing type. - mapping references is harder. This is because the referenced object will in general not be contained in the same document as the referrer. This implies that the reference should not be mapped as attributes or collections with an element of the appropriate type. Example, Experiment references Protocol, but the Protocol itself is an object registered in its own document. For now we use a Reference type in the root XML schema document (base.xsd) defining some common base types to be used by schemas generated from data models. Currently the Reference type is a simpleType restricting anyURI. This is to be designed more fully. Each reference element will have this type. Reference-s will furthermore include an appinfo annotation indicating the precise type of the reference. We need to design this appinfo element. For now I use a 'xmiidref=...' pointing to the xmiid of the type that is being referenced. This xmiid can be found in the XMI document and in the intermediate representation. It can also be found in the 'xmiid=...' appinfo annotation of objectType-s.