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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 230 - (show annotations)
Wed Apr 16 06:39:25 2008 UTC (12 years, 7 months ago) by gerard.lemson
File size: 7487 byte(s)


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:attribute name="xmiid" type="xsd:ID">
33 <xsd:annotation>
34 <xsd:documentation>
35 This is the xmi:id of the corresponding element in the source XMI representation.
36 It is used in xmiidref attributes in TypeRef and attributes to provide an explicit
37 lokup functionalirt when we need it and to link back to the original XMI document.
38 </xsd:documentation>
39 </xsd:annotation>
40 </xsd:attribute>
41 </xsd:complexType>
42
43 <xsd:complexType name="Model">
44 <xsd:complexContent>
45 <xsd:extension base="Element">
46 <xsd:sequence>
47 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
48 </xsd:sequence>
49 </xsd:extension>
50 </xsd:complexContent>
51 </xsd:complexType>
52
53 <xsd:complexType name="Package">
54 <xsd:complexContent>
55 <xsd:extension base="Element">
56 <xsd:sequence>
57 <xsd:element name="depends" type="PackageReference" minOccurs="0" maxOccurs="unbounded"/>
58 <xsd:element name="objectType" type="ObjectType" minOccurs="0" maxOccurs="unbounded"/>
59 <xsd:element name="dataType" type="DataType" minOccurs="0" maxOccurs="unbounded"/>
60 <xsd:element name="enumeration" type="Enumeration" minOccurs="0" maxOccurs="unbounded"/>
61 <xsd:element name="package" type="Package" minOccurs="0" maxOccurs="unbounded"/>
62 </xsd:sequence>
63 <xsd:attribute name="xmiid" type="xsd:ID"/>
64 </xsd:extension>
65 </xsd:complexContent>
66 </xsd:complexType>
67
68 <xsd:complexType name="PackageReference">
69 <xsd:sequence>
70 <xsd:element name="description" type="xsd:string" minOccurs="0">
71 <xsd:annotation>
72 <xsd:documentation>
73 Describes the dependency relation, if any.
74 </xsd:documentation>
75 </xsd:annotation>
76 </xsd:element>
77 </xsd:sequence>
78 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
79 </xsd:complexType>
80
81 <xsd:complexType name="Type" abstract="true">
82 <xsd:complexContent>
83 <xsd:extension base="Element">
84 <xsd:sequence>
85 <xsd:element name="extends" type="TypeReference" minOccurs="0"/>
86 </xsd:sequence>
87 <xsd:attribute name="isAbstract" type="xsd:boolean" default="false" use="optional"/>
88 </xsd:extension>
89 </xsd:complexContent>
90 </xsd:complexType>
91
92 <xsd:complexType name="ObjectType">
93 <xsd:complexContent>
94 <xsd:extension base="Type">
95 <xsd:sequence>
96 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
97 <xsd:element name="collection" type="Collection" minOccurs="0" maxOccurs="unbounded"/>
98 <xsd:element name="reference" type="Reference" minOccurs="0" maxOccurs="unbounded"/>
99 </xsd:sequence>
100 </xsd:extension>
101 </xsd:complexContent>
102 </xsd:complexType>
103
104 <xsd:complexType name="ValueType" abstract="true">
105 <xsd:complexContent>
106 <xsd:extension base="Type">
107 </xsd:extension>
108 </xsd:complexContent>
109 </xsd:complexType>
110
111 <xsd:complexType name="DataType">
112 <xsd:complexContent>
113 <xsd:extension base="ValueType">
114 <xsd:sequence>
115 <xsd:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded"/>
116 </xsd:sequence>
117 </xsd:extension>
118 </xsd:complexContent>
119 </xsd:complexType>
120
121 <xsd:complexType name="Enumeration">
122 <xsd:complexContent>
123 <xsd:extension base="ValueType">
124 <xsd:sequence>
125 <xsd:element name="literal" maxOccurs="unbounded">
126 <xsd:complexType>
127 <xsd:sequence>
128 <xsd:element name="value" type="xsd:string"/>
129 <xsd:element name="description" type="xsd:string"/>
130 </xsd:sequence>
131 </xsd:complexType>
132 </xsd:element>
133 </xsd:sequence>
134 </xsd:extension>
135 </xsd:complexContent>
136 </xsd:complexType>
137
138 <xsd:complexType name="Attribute">
139 <xsd:complexContent>
140 <xsd:extension base="Element">
141 <xsd:sequence>
142 <xsd:element name="datatype" type="TypeReference"/>
143 <xsd:element name="multiplicity" type="Multiplicity"/>
144 <!-- should next be on TypeReference? the constraints restrict the type after all. -->
145 <xsd:element name="constraints" type="Constraints" minOccurs="0"/>
146 </xsd:sequence>
147 </xsd:extension>
148 </xsd:complexContent>
149 </xsd:complexType>
150
151 <xsd:complexType name="TypeReference">
152 <xsd:sequence>
153 <xsd:element name="package" type="xsd:string" minOccurs="0"/>
154 <xsd:element name="type" type="xsd:string"/>
155 </xsd:sequence>
156 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
157 </xsd:complexType>
158
159 <xsd:complexType name="Relation" abstract="true">
160 <xsd:complexContent>
161 <xsd:extension base="Element">
162 <xsd:sequence>
163 <xsd:element name="datatype" type="TypeReference"/>
164 <xsd:element name="multiplicity" type="Multiplicity"/>
165 <xsd:element name="subsets" type="xsd:string" minOccurs="0"/>
166 </xsd:sequence>
167 <xsd:attribute name="xmiidref" type="xsd:IDREF"/>
168 </xsd:extension>
169 </xsd:complexContent>
170 </xsd:complexType>
171
172 <xsd:complexType name="Reference">
173 <xsd:complexContent>
174 <xsd:extension base="Relation"/>
175 </xsd:complexContent>
176 </xsd:complexType>
177
178 <xsd:complexType name="Collection">
179 <xsd:complexContent>
180 <xsd:extension base="Relation"/>
181 </xsd:complexContent>
182 </xsd:complexType>
183
184 <xsd:complexType name="PrimitiveType">
185 <xsd:complexContent>
186 <xsd:extension base="ValueType"/>
187 </xsd:complexContent>
188 </xsd:complexType>
189
190 <xsd:simpleType name="Multiplicity">
191 <xsd:restriction base="xsd:string">
192 <xsd:enumeration value="1"/>
193 <xsd:enumeration value="0..1"/>
194 <xsd:enumeration value="0..*"/>
195 <xsd:enumeration value="1..*"/>
196 </xsd:restriction>
197 </xsd:simpleType>
198
199 <xsd:complexType name="Constraints">
200 <xsd:choice minOccurs="0" maxOccurs="unbounded">
201 <xsd:element name="minLength" type="xsd:int"/>
202 <xsd:element name="maxLength" type="xsd:int"/>
203 <xsd:element name="length" type="xsd:int"/>
204 </xsd:choice>
205 </xsd:complexType>
206
207
208
209 </xsd:schema>

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