/[volute]/trunk/projects/theory/snapdm/res/ivoaDMMetamodel.xsd
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/res/ivoaDMMetamodel.xsd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 126 - (show annotations)
Mon Mar 31 19:41:40 2008 UTC (12 years, 7 months ago) by gerard.lemson
File size: 5927 byte(s)
Clean up after Laurent and I decided to concentrate on the pure XSLT way of generating code. This does require Saxon to be able to use the xsl:result-document syntax to output multiple files.
1 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
2 targetNamespace="http://ivoa.org/theory/datamodel/generationmetadata/v0.1"
3 xmlns:dmmd="http://ivoa.org/theory/datamodel/generationmetadata/v0.1">
4 <xsd:annotation>
5 <xsd:documentation>
6 This schema aims to capture the UML profile we are using (implicitly so far).
7 Might be used as the schema for documents generated form the XMI in the first
8 step in the code generation pipeline.
9 Inspired by Laurent's .._FOR_GEN.xml file generated for use by Java code.
10 But such an intermediate representation of our models can be made much more
11 explicit than the XMI and therefore may allow easier XSLT scripts for generating
12 the final products.
13 Note, I have strayed from Laurent's use of &lt;bean&gt; and other java-like names.
14 I am also using names for referring to (packages.)types defined in the document
15 iso ID/IDREF or key/keyref constructs. I am asusming a validator will have
16 ensured that the types exist etc.
17 </xsd:documentation>
18 </xsd:annotation>
19
20 <xsd:element name="model" type="Model">
21 <xsd:key name="uniquePackageName">
22 <xsd:selector xpath="./package"/>
23 <xsd:field xpath="@name"/>
24 </xsd:key>
25 </xsd:element>
26
27 <xsd:complexType name="Element" abstract="true">
28 <xsd:sequence>
29 <xsd:element name="name" type="xsd:string"/>
30 <xsd:element name="description" type="xsd:string"/>
31 </xsd:sequence>
32 </xsd:complexType>
33
34 <xsd:complexType name="Model">
35 <xsd:complexContent>
36 <xsd:extension base="Element">
37 <xsd:sequence>
38 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
39 </xsd:sequence>
40 </xsd:extension>
41 </xsd:complexContent>
42 </xsd:complexType>
43
44 <xsd:complexType name="Package">
45 <xsd:complexContent>
46 <xsd:extension base="Element">
47 <xsd:sequence>
48 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
49 <xsd:element name="objectType" type="ObjectType" minOccurs="0" maxOccurs="unbounded"/>
50 <xsd:element name="dataType" type="DataType" minOccurs="0" maxOccurs="unbounded"/>
51 <xsd:element name="enumeration" type="Enumeration" minOccurs="0" maxOccurs="unbounded"/>
52 </xsd:sequence>
53 </xsd:extension>
54 </xsd:complexContent>
55 </xsd:complexType>
56
57
58 <xsd:complexType name="Type" abstract="true">
59 <xsd:complexContent>
60 <xsd:extension base="Element">
61 <xsd:sequence>
62 <xsd:element name="extends" type="TypeReference" minOccurs="0"/>
63 </xsd:sequence>
64 <xsd:attribute name="isAbstract" type="xsd:boolean" default="false" use="optional"/>
65 </xsd:extension>
66 </xsd:complexContent>
67 </xsd:complexType>
68
69 <xsd:complexType name="ObjectType">
70 <xsd:complexContent>
71 <xsd:extension base="Type">
72 <xsd:sequence>
73 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
74 <xsd:element name="collection" type="Collection" minOccurs="0" maxOccurs="unbounded"/>
75 <xsd:element name="reference" type="Reference" minOccurs="0" maxOccurs="unbounded"/>
76 </xsd:sequence>
77 </xsd:extension>
78 </xsd:complexContent>
79 </xsd:complexType>
80
81 <xsd:complexType name="ValueType" abstract="true">
82 <xsd:complexContent>
83 <xsd:extension base="Type">
84 </xsd:extension>
85 </xsd:complexContent>
86 </xsd:complexType>
87
88 <xsd:complexType name="DataType">
89 <xsd:complexContent>
90 <xsd:extension base="ValueType">
91 <xsd:sequence>
92 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
93 </xsd:sequence>
94 </xsd:extension>
95 </xsd:complexContent>
96 </xsd:complexType>
97
98 <xsd:complexType name="Enumeration">
99 <xsd:complexContent>
100 <xsd:extension base="ValueType">
101 <xsd:sequence>
102 <xsd:element name="literal" maxOccurs="unbounded">
103 <xsd:complexType>
104 <xsd:sequence>
105 <xsd:element name="value" type="xsd:string"/>
106 <xsd:element name="description" type="xsd:string"/>
107 </xsd:sequence>
108 </xsd:complexType>
109 </xsd:element>
110 </xsd:sequence>
111 </xsd:extension>
112 </xsd:complexContent>
113 </xsd:complexType>
114
115 <xsd:complexType name="Attribute">
116 <xsd:complexContent>
117 <xsd:extension base="Element">
118 <xsd:sequence>
119 <xsd:element name="datatype" type="TypeReference"/>
120 <xsd:element name="multiplicity" type="Multiplicity"/>
121 </xsd:sequence>
122 </xsd:extension>
123 </xsd:complexContent>
124 </xsd:complexType>
125
126 <xsd:complexType name="TypeReference">
127 <xsd:sequence>
128 <xsd:element name="package" type="xsd:string" minOccurs="0"/>
129 <xsd:element name="type" type="xsd:string"/>
130 </xsd:sequence>
131 </xsd:complexType>
132
133 <xsd:complexType name="Relation" abstract="true">
134 <xsd:complexContent>
135 <xsd:extension base="Element">
136 <xsd:sequence>
137 <xsd:element name="datatype" type="TypeReference"/>
138 <xsd:element name="multiplicity" type="Multiplicity"/>
139 <xsd:element name="subsets" type="xsd:string" minOccurs="0"/>
140 </xsd:sequence>
141 </xsd:extension>
142 </xsd:complexContent>
143 </xsd:complexType>
144
145 <xsd:complexType name="Reference">
146 <xsd:complexContent>
147 <xsd:extension base="Relation"/>
148 </xsd:complexContent>
149 </xsd:complexType>
150
151 <xsd:complexType name="Collection">
152 <xsd:complexContent>
153 <xsd:extension base="Relation"/>
154 </xsd:complexContent>
155 </xsd:complexType>
156
157 <xsd:complexType name="PrimitiveType">
158 <xsd:complexContent>
159 <xsd:extension base="ValueType"/>
160 </xsd:complexContent>
161 </xsd:complexType>
162
163 <xsd:simpleType name="Multiplicity">
164 <xsd:restriction base="xsd:string">
165 <xsd:enumeration value="1"/>
166 <xsd:enumeration value="0..1"/>
167 <xsd:enumeration value="0..*"/>
168 <xsd:enumeration value="1..*"/>
169 </xsd:restriction>
170 </xsd:simpleType>
171 </xsd:schema>

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