/[volute]/trunk/projects/theory/snapdm/doc/XSD generation.txt
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/doc/XSD generation.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 228 - (show annotations)
Tue Apr 15 16:29:44 2008 UTC (13 years, 2 months ago) by gerard.lemson
File MIME type: text/plain
File size: 2143 byte(s)


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

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26