/[volute]/trunk/projects/theory/snapdm/input/intermediateModel.xsd
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/input/intermediateModel.xsd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 641 - (show annotations)
Fri Jun 27 16:23:49 2008 UTC (12 years, 5 months ago) by gerard.lemson
File size: 9534 byte(s)
Added uniqueness constraint plus annotation.
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3 xmlns="http://ivoa.org/theory/datamodel/generationmetadata/v0.1"
4 targetNamespace="http://ivoa.org/theory/datamodel/generationmetadata/v0.1"
5 attributeFormDefault="unqualified" elementFormDefault="unqualified">
6 <xsd:annotation>
7 <xsd:documentation>
8 This schema aims to capture the UML profile we are using (implicitly so far).
9 Might be used as the schema for documents generated form the XMI in the first
10 step in the code generation pipeline.
11 Inspired by Laurent's .._FOR_GEN.xml file generated for use by Java code.
12 But such an intermediate representation of our models can be made much more
13 explicit than the XMI and therefore may allow easier XSLT scripts for generating
14 the final products.
15 Note, I have strayed from Laurent's use of &lt;bean&gt; and other java-like names.
16 I am also using names for referring to (packages.)types defined in the document
17 iso ID/IDREF or key/keyref constructs. I am asusming a validator will have
18 ensured that the types exist etc.
19 </xsd:documentation>
20 </xsd:annotation>
21
22 <xsd:complexType name="Element" abstract="true">
23 <xsd:sequence>
24 <xsd:element name="name" type="xsd:string" minOccurs="0"/>
25 <xsd:element name="description" type="xsd:string" minOccurs="0"/>
26 </xsd:sequence>
27 <xsd:attribute name="xmiid" type="xsd:ID">
28 <xsd:annotation>
29 <xsd:documentation>
30 This is the xmi:id of the corresponding element in the source XMI representation.
31 It is used in xmiidref attributes in TypeRef and attributes to provide an explicit
32 lokup functionalirt when we need it and to link back to the original XMI document.
33 </xsd:documentation>
34 </xsd:annotation>
35 </xsd:attribute>
36 </xsd:complexType>
37
38 <xsd:element name="model">
39 <!-- patch so JAXB understands that this element is an XmlRootElement -->
40 <xsd:complexType>
41 <xsd:complexContent>
42 <xsd:extension base="Element">
43 <xsd:sequence>
44 <xsd:element name="lastModifiedDate" type="xsd:long"/>
45 <xsd:element name="author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
46 <xsd:element name="title" type="xsd:string" minOccurs="0" maxOccurs="1"/>
47 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
48 </xsd:sequence>
49 </xsd:extension>
50 </xsd:complexContent>
51 </xsd:complexType>
52 </xsd:element>
53
54 <xsd:complexType name="Package">
55 <xsd:complexContent>
56 <xsd:extension base="Element">
57 <xsd:sequence>
58 <xsd:element name="depends" type="PackageReference" minOccurs="0" maxOccurs="unbounded"/>
59 <xsd:element name="objectType" type="ObjectType" minOccurs="0" maxOccurs="unbounded"/>
60 <xsd:element name="dataType" type="DataType" minOccurs="0" maxOccurs="unbounded"/>
61 <xsd:element name="enumeration" type="Enumeration" minOccurs="0" maxOccurs="unbounded"/>
62 <xsd:element name="primitiveType" type="PrimitiveType" minOccurs="0" maxOccurs="unbounded"/>
63 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
64 </xsd:sequence>
65 </xsd:extension>
66 </xsd:complexContent>
67 </xsd:complexType>
68
69 <xsd:complexType name="PackageReference">
70 <xsd:sequence>
71 <xsd:element name="description" type="xsd:string" minOccurs="0">
72 <xsd:annotation>
73 <xsd:documentation>
74 Describes the dependency relation, if any.
75 </xsd:documentation>
76 </xsd:annotation>
77 </xsd:element>
78 </xsd:sequence>
79 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
80 </xsd:complexType>
81
82 <xsd:complexType name="Type" abstract="true">
83 <xsd:complexContent>
84 <xsd:extension base="Element">
85 <xsd:sequence>
86 <xsd:element name="extends" type="TypeRef" minOccurs="0"/>
87 </xsd:sequence>
88 <xsd:attribute name="abstract" type="xsd:boolean" default="false" use="optional"/>
89 </xsd:extension>
90 </xsd:complexContent>
91 </xsd:complexType>
92
93
94
95 <xsd:complexType name="TypeRef">
96 <xsd:attribute name="name" type="xsd:string"/>
97 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
98 <xsd:attribute name="relation" type="xsd:string" use="optional"/>
99 </xsd:complexType>
100
101
102
103 <xsd:complexType name="ObjectType">
104 <xsd:complexContent>
105 <xsd:extension base="Type">
106 <xsd:sequence>
107 <xsd:element name="container" type="TypeRef" minOccurs="0" maxOccurs="1">
108 <xsd:annotation>
109 <xsd:documentation>
110 Pointer to the xmiid of the type containing this type directly.
111 </xsd:documentation>
112 </xsd:annotation>
113 </xsd:element>
114 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
115 <xsd:element name="collection" type="Collection" minOccurs="0" maxOccurs="unbounded"/>
116 <xsd:element name="reference" type="Reference" minOccurs="0" maxOccurs="unbounded"/>
117 </xsd:sequence>
118 </xsd:extension>
119 </xsd:complexContent>
120 </xsd:complexType>
121
122
123
124 <xsd:complexType name="ValueType" abstract="true">
125 <xsd:complexContent>
126 <xsd:extension base="Type">
127 </xsd:extension>
128 </xsd:complexContent>
129 </xsd:complexType>
130
131
132 <xsd:complexType name="PrimitiveType">
133 <xsd:complexContent>
134 <xsd:extension base="ValueType">
135 </xsd:extension>
136 </xsd:complexContent>
137 </xsd:complexType>
138
139
140
141
142 <xsd:complexType name="DataType">
143 <xsd:complexContent>
144 <xsd:extension base="ValueType">
145 <xsd:sequence>
146 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
147 </xsd:sequence>
148 </xsd:extension>
149 </xsd:complexContent>
150 </xsd:complexType>
151
152 <xsd:complexType name="Enumeration">
153 <xsd:complexContent>
154 <xsd:extension base="ValueType">
155 <xsd:sequence>
156 <xsd:element name="literal" maxOccurs="unbounded">
157 <xsd:complexType>
158 <xsd:sequence>
159 <xsd:element name="value" type="xsd:string"/>
160 <xsd:element name="description" type="xsd:string" minOccurs="0"/>
161 </xsd:sequence>
162 </xsd:complexType>
163 </xsd:element>
164 </xsd:sequence>
165 </xsd:extension>
166 </xsd:complexContent>
167 </xsd:complexType>
168
169 <xsd:complexType name="Attribute">
170 <xsd:complexContent>
171 <xsd:extension base="Element">
172 <xsd:sequence>
173 <xsd:element name="datatype" type="TypeRef"/>
174 <xsd:element name="multiplicity" type="Multiplicity"/>
175 <!-- should next be on TypeReference? the constraints restrict the type after all. -->
176 <xsd:element name="constraints" type="Constraints" minOccurs="0"/>
177 <xsd:element name="ontologyterm" type="OntologyTerm" minOccurs="0"/>
178 </xsd:sequence>
179 </xsd:extension>
180 </xsd:complexContent>
181 </xsd:complexType>
182
183
184
185 <xsd:complexType name="OntologyTerm">
186 <xsd:sequence>
187 <xsd:element name="ontologyURI" type="xsd:anyURI"/>
188 </xsd:sequence>
189 </xsd:complexType>
190
191
192
193 <xsd:complexType name="Relation" abstract="true">
194 <xsd:complexContent>
195 <xsd:extension base="Element">
196 <xsd:sequence>
197 <xsd:element name="datatype" type="TypeRef"/>
198 <xsd:element name="multiplicity" type="Multiplicity"/>
199 <xsd:element name="subsets" type="xsd:string" minOccurs="0"/>
200 </xsd:sequence>
201 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
202 </xsd:extension>
203 </xsd:complexContent>
204 </xsd:complexType>
205
206 <xsd:complexType name="Reference">
207 <xsd:complexContent>
208 <xsd:extension base="Relation"/>
209 </xsd:complexContent>
210 </xsd:complexType>
211
212 <xsd:complexType name="Collection">
213 <xsd:complexContent>
214 <xsd:extension base="Relation"/>
215 </xsd:complexContent>
216 </xsd:complexType>
217
218
219
220 <xsd:simpleType name="Multiplicity">
221 <xsd:restriction base="xsd:string">
222 <xsd:enumeration value="1"/>
223 <xsd:enumeration value="0..1"/>
224 <xsd:enumeration value="0..*"/>
225 <xsd:enumeration value="1..*"/>
226 </xsd:restriction>
227 </xsd:simpleType>
228
229 <xsd:complexType name="Constraints">
230 <xsd:choice minOccurs="0" maxOccurs="unbounded">
231 <xsd:element name="minLength" type="xsd:int"/>
232 <xsd:element name="maxLength" type="xsd:int"/>
233 <xsd:element name="length" type="xsd:int"/>
234 <xsd:element name="unique" type="xsd:string">
235 <xsd:annotation>
236 <xsd:documentation>
237 Indicates that the attribute is part of a global uniqueness constraint,
238 the name of which is given by the value of the constraint.
239 This name allows multiple attributes to be part of the same constraint.
240 TBD We may want to insist that attributes with a uniqeness constraints must be non-null.
241 </xsd:documentation>
242 </xsd:annotation>
243 </xsd:element>
244 <xsd:element name="uniqueInCollection" type="xsd:string">
245 <xsd:annotation>
246 <xsd:documentation>
247 Indicates that the attribute is part of a uniqueness constraint that pertains to the context of the collection
248 the object is in only. The name of the constraint is given by the value of the uniqueInCollection element.
249 This name allows multiple attributes to be part of the same constraint.
250 TBD We may want to insist that attributes with a uniqeness constraints must be non-null.
251 </xsd:documentation>
252 </xsd:annotation>
253 </xsd:element>
254 </xsd:choice>
255 </xsd:complexType>
256
257
258
259 </xsd:schema>

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