Blame view

php/XML/VOTable-1.0.xsd 15.5 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema for VOTable  = Virtual Observatory Tabular Format
     See History at      http://vizier.u-strasbg.fr/doc/VOTable
     See Discussions at  http://archives.us-vo.org/VOTable
  This XML schema can be referenced by
       http://us-vo.org/xml/VOTable.xsd
   or  http://cdsweb.u-strasbg.fr/xml/VOTable.xsd 
  The DTD is available from
       http://us-vo.org/xml/VOTable.dtd
   or  http://cdsweb.u-strasbg.fr/xml/VOTable.dtd 
.Version 1.0 : 15-Apr-2002
.Version 1.0a: 27-Sep-2001 in MIN MAX STREAM
.Version 1.0b: 09-Nov-2002 from Steve Lowe, slowe@head-cfa.harvard.edu:
	       in DEFINITIONS, use 'xs:sequence' rather than 'xs:all'
.Version 1.0c: 12-Nov-2002 from Steve Lowe, use xs:choice in DEFINITIONS
.Version 1.0d: 10-Dec-2002 Allow several INFO TABLE
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.ivoa.net/xml/VOTable/v1.0" xmlns:vot="http://www.ivoa.net/xml/VOTable/v1.0">

<!-- Here we define some interesting new datatypes:
     - anyTEXT   may have embedded XHTML (conforming HTML)
     - astroYear is an epoch in Besselian or Julian year, e.g. J2000
     - arrayDEF  specifies an array size e.g. 12x23x*
     - dataType  defines the acceptable datatypes
     - precType  defines the acceptable precisions
     - yesno     defines just the 2 alternatives
-->

<xs:complexType name="anyTEXT" mixed="true">
      <xs:sequence>
        <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
      </xs:sequence>
</xs:complexType>

<xs:simpleType name="astroYear">
  <xs:restriction base="xs:token">
    <xs:pattern value="[JB][0-9]+([.][0-9]*)?"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="arrayDEF">
  <xs:restriction base="xs:token">
    <xs:pattern value="([0-9]+x)*[0-9]*[*]?"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="dataType">
  <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="boolean"/>
    <xs:enumeration value="bit"/>
    <xs:enumeration value="unsignedByte"/>
    <xs:enumeration value="short"/>
    <xs:enumeration value="int"/>
    <xs:enumeration value="long"/>
    <xs:enumeration value="char"/>
    <xs:enumeration value="unicodeChar"/>
    <xs:enumeration value="float"/>
    <xs:enumeration value="double"/>
    <xs:enumeration value="floatComplex"/>
    <xs:enumeration value="doubleComplex"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="precType">
  <xs:restriction base="xs:token">
    <xs:pattern value="[EF]?[1-9][0-9]*"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="yesno">
  <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="yes"/>
    <xs:enumeration value="no"/>
  </xs:restriction>
</xs:simpleType>

<!-- VOTable is the root element -->
  <xs:element name="VOTABLE">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:DESCRIPTION" minOccurs="0"/>
        <xs:element ref="vot:DEFINITIONS" minOccurs="0"/>
        <xs:element ref="vot:INFO" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:RESOURCE" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="version">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="1.0"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

<!-- RESOURCES can contain DESCRIPTION, (INFO|PARM|LINK), (TABLE|RESOURCE) -->
  <xs:element name="RESOURCE">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:DESCRIPTION" minOccurs="0"/>
        <xs:element ref="vot:INFO" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:COOSYS" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:PARAM" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:LINK" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:TABLE" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:RESOURCE" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:token"/>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="type" default="results">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="results"/>
            <xs:enumeration value="meta"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

  <xs:element name="DESCRIPTION" type="vot:anyTEXT"/>

  <xs:element name="DEFINITIONS">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="vot:COOSYS"/>
        <xs:element ref="vot:PARAM"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

<!-- INFO is a name-value pair -->
  <xs:element name="INFO">
    <xs:complexType mixed="true"><xs:complexContent>
      <xs:extension base="vot:anyTEXT">
        <xs:attribute name="ID" type="xs:ID"/>
        <xs:attribute name="name" type="xs:token" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent></xs:complexType>
  </xs:element>

<!-- A PARAM is similar to a FIELD, but it also has a "value" attribute -->
  <xs:element name="PARAM">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:DESCRIPTION" minOccurs="0"/>
        <xs:element ref="vot:VALUES" minOccurs="0"/>
        <xs:element ref="vot:LINK" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="unit" type="xs:token"/>
      <xs:attribute name="datatype" type="vot:dataType"/>
      <xs:attribute name="precision" type="vot:precType"/>
      <xs:attribute name="width" type="xs:positiveInteger"/>
      <xs:attribute name="ref" type="xs:IDREF"/>
      <xs:attribute name="name" type="xs:token" use="required"/>
      <xs:attribute name="ucd" type="xs:token"/>
      <xs:attribute name="value" type="xs:string"/>
      <xs:attribute name="arraysize" type="vot:arrayDEF"/>
    </xs:complexType>
  </xs:element>

<!-- A TABLE is a sequence of FIELDS and LINKS and DESCRIPTION, 
     possibly followed by a DATA section 
-->
  <xs:element name="TABLE">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:DESCRIPTION" minOccurs="0"/>
        <xs:element ref="vot:FIELD" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:LINK" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="vot:DATA" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="name" type="xs:token"/>
      <xs:attribute name="ref" type="xs:IDREF"/>
    </xs:complexType>
  </xs:element>

<!-- FIELD is the definition of what is in a column of the table -->
  <xs:element name="FIELD">
    <xs:complexType>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="vot:DESCRIPTION" minOccurs="0"/>
        <xs:element ref="vot:VALUES" minOccurs="0" maxOccurs="2"/>
        <xs:element ref="vot:LINK" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="unit" type="xs:token"/>
      <xs:attribute name="datatype" type="vot:dataType" use="required"/>
      <xs:attribute name="precision" type="vot:precType"/>
      <xs:attribute name="width" type="xs:positiveInteger"/>
      <xs:attribute name="ref" type="xs:IDREF"/>
      <xs:attribute name="name" type="xs:token" use="required"/>
      <xs:attribute name="ucd" type="xs:string"/>
      <xs:attribute name="arraysize" type="xs:string"/>
      <xs:attribute name="type">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="hidden"/>
            <xs:enumeration value="no_query"/>
            <xs:enumeration value="trigger"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

<!-- VALUES expresses the values that can be taken by the data 
     in a column or by a parameter
-->
  <xs:element name="VALUES">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:MIN" minOccurs="0"/>
        <xs:element ref="vot:MAX" minOccurs="0"/>
        <xs:element ref="vot:OPTION" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="type" default="legal">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="legal"/>
            <xs:enumeration value="actual"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="null" type="xs:token"/>
      <xs:attribute name="invalid" type="vot:yesno" default="no"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="MIN">
    <xs:complexType>
      <xs:simpleContent><xs:extension base="xs:string">
        <xs:attribute name="value" type="xs:string" use="required"/>
        <xs:attribute name="inclusive" type="vot:yesno" default="yes"/>
      </xs:extension></xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="MAX">
    <xs:complexType>
      <xs:simpleContent><xs:extension base="xs:string">
        <xs:attribute name="value" type="xs:string" use="required"/>
        <xs:attribute name="inclusive" type="vot:yesno" default="yes"/>
      </xs:extension></xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="OPTION">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:OPTION" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:token"/>
      <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>

<!-- The LINK is a URL (href) or some other kind of reference (gref) -->
  <xs:element name="LINK">
    <xs:complexType><xs:simpleContent><xs:extension base="xs:string">
    <xs:attribute name="ID" type="xs:ID"/>
      <xs:attribute name="content-role">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="query"/>
            <xs:enumeration value="hints"/>
            <xs:enumeration value="doc"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="content-type" type="xs:token"/>
      <xs:attribute name="title" type="xs:string"/>
      <xs:attribute name="value" type="xs:string"/>
      <xs:attribute name="href" type="xs:anyURI"/>
      <xs:attribute name="gref" type="xs:token"/>
      <xs:attribute name="action" type="xs:anyURI"/>
  </xs:extension></xs:simpleContent></xs:complexType>
  </xs:element>

<!-- DATA is the actual table data, in one of three formats -->
  <xs:element name="DATA">
    <xs:complexType>
      <xs:sequence>
         <xs:element ref="vot:TABLEFORMAT"/>
      </xs:sequence>
<!--
      <xs:choice>
        <xs:element ref="vot:TABLEDATA"/>
        <xs:element ref="vot:BINARY"/>
        <xs:element ref="vot:FITS"/>
      </xs:choice>
  -->
    </xs:complexType>
  </xs:element>

  <xs:element name="TABLEFORMAT" type="vot:TABLEFORMATType" abstract="true">
    <xs:annotation>
      <xs:documentation>
        an abstract representation of the tables storage form.  
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:complexType name="TABLEFORMATType">
    <xs:sequence/>
  </xs:complexType>

  <xs:complexType name="StreamTABLEFORMATType">
    <xs:complexContent>
      <xs:extension base="vot:TABLEFORMATType">
        <xs:sequence>
          <xs:element ref="vot:STREAM"/>
        </xs:sequence>
      </xs:extension>    
    </xs:complexContent>
  </xs:complexType>

<!-- Pure XML data -->
  <xs:element name="TABLEDATA" substitutionGroup="vot:TABLEFORMAT">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="vot:TABLEFORMATType">
      	  <xs:sequence>
      	    <xs:element ref="vot:TR" minOccurs="0" maxOccurs="unbounded"/>
      	  </xs:sequence>
        </xs:extension>    
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="TD">
    <xs:complexType mixed="true"><xs:complexContent>
      <xs:extension base="vot:anyTEXT">
        <xs:attribute name="ref" type="xs:IDREF"/>
      </xs:extension>
    </xs:complexContent></xs:complexType>
  </xs:element>

  <xs:element name="TR">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="vot:TD" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

<!-- FITS file, perhaps with specification of which extension to seek to -->
  <xs:element name="FITS" substitutionGroup="vot:TABLEFORMAT">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="vot:StreamTABLEFORMATType">
          <xs:attribute name="extnum" type="xs:positiveInteger"/>
        </xs:extension>    
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

<!-- BINARY data format -->
  <xs:element name="BINARY" type="vot:StreamTABLEFORMATType" substitutionGroup="vot:TABLEFORMAT"/>

<!-- STREAM can be local or remote, encoded or not -->
  <xs:element name="STREAM">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="type" default="locator">
            <xs:simpleType>
              <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="locator"/>
                <xs:enumeration value="other"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="href" type="xs:anyURI"/>
          <xs:attribute name="actuate" default="onRequest">
            <xs:simpleType>
              <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="onLoad"/>
                <xs:enumeration value="onRequest"/>
                <xs:enumeration value="other"/>
                <xs:enumeration value="none"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="encoding" default="none">
            <xs:simpleType>
              <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="gzip"/>
                <xs:enumeration value="base64"/>
                <xs:enumeration value="dynamic"/>
                <xs:enumeration value="none"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="expires" type="xs:dateTime"/>
          <xs:attribute name="rights" type="xs:token"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

<!-- Expresses the coordinate system we are using -->
  <xs:element name="COOSYS">
    <xs:complexType mixed="true"><xs:complexContent>
      <xs:extension base="vot:anyTEXT">
        <xs:attribute name="ID" type="xs:ID"/>
        <xs:attribute name="equinox" type="vot:astroYear"/>
        <xs:attribute name="epoch" type="vot:astroYear"/>
        <xs:attribute name="system" default="eq_FK5">
          <xs:simpleType>
            <xs:restriction base="xs:NMTOKEN">
              <xs:enumeration value="eq_FK4"/>
              <xs:enumeration value="eq_FK5"/>
              <xs:enumeration value="ICRS"/>
              <xs:enumeration value="ecl_FK4"/>
              <xs:enumeration value="ecl_FK5"/>
              <xs:enumeration value="galactic"/>
              <xs:enumeration value="supergalactic"/>
              <xs:enumeration value="xy"/>
              <xs:enumeration value="barycentric"/>
              <xs:enumeration value="geo_app"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension></xs:complexContent></xs:complexType>
  </xs:element>

</xs:schema>