Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xs:schema  targetNamespace="http://ns.dataone.org/service/types/v2.0"
3
  xmlns:d1="http://ns.dataone.org/service/types/v1"
4
    xmlns:d1_v1.1="http://ns.dataone.org/service/types/v1.1"
5
    xmlns:d1_v2.0="http://ns.dataone.org/service/types/v2.0"
6
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
7
    version="2.0.0"
8
    elementFormDefault="unqualified" attributeFormDefault="unqualified">
9

    
10
<!-- 
11
$HeadURL:  $
12
$Id:  $
13

    
14
About this document:
15

    
16
  This XML Schema document defines the common data structures that are used
17
  to support messaging between the major components of the DataONE
18
  infrastructure and to guide structure design for storage of information
19
  required for normal operations.
20

    
21
License:
22

    
23
  This work was created by participants in the DataONE project, and is
24
  jointly copyrighted by participating institutions in DataONE. For
25
  more information on DataONE, see our web site at http://dataone.org.
26

    
27
    Copyright 2015
28

    
29
  Licensed under the Apache License, Version 2.0 (the "License");
30
  you may not use this file except in compliance with the License.
31
  You may obtain a copy of the License at
32

    
33
    http://www.apache.org/licenses/LICENSE-2.0
34

    
35
  Unless required by applicable law or agreed to in writing, software
36
  distributed under the License is distributed on an "AS IS" BASIS,
37
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
  See the License for the specific language governing permissions and
39
  limitations under the License.
40

    
41
Formatting: 
42

    
43
  - This document MUST be saved as a UTF-8 encoded file.
44

    
45
  - Indent using spaces, not tabs, with two spaces per indent level.
46

    
47
  - Line wrapping should be set to 80 chars, adjusted as necessary
48

    
49
  - Documentation entries contain formatting instructions for integration with
50
    the DataONE architecture documentation, available at:
51

    
52
      http://mule1.dataone.org/ArchitectureDocs-current
53

    
54
-->
55

    
56
  <!-- NOTE THAT ALL SERIALIZEABLE ROOT ELEMENTS FOR MESSAGES SHOULD BE OF A
57
       COMPLEX TYPE -->
58

    
59
  <xs:import namespace="http://ns.dataone.org/service/types/v1" 
60
        schemaLocation="http://ns.dataone.org/service/types/v1" />
61
  <xs:import namespace="http://ns.dataone.org/service/types/v1.1" 
62
        schemaLocation="http://ns.dataone.org/service/types/v1.1" />
63

    
64
 <!-- MediaTypeProperty extension-->
65
  <xs:complexType name="MediaTypeProperty">
66
      <xs:annotation>
67
        <xs:documentation>Additional optional properties for MediaType as 
68
          described by IANA.</xs:documentation>
69
      </xs:annotation>
70
      <xs:simpleContent>
71
        <xs:extension base="xs:string">
72
          <xs:attribute name="name" type="xs:string" use="required">
73
            <xs:annotation>
74
                <xs:documentation>The property name for this entry. 
75
                </xs:documentation>
76
          </xs:annotation>
77
          </xs:attribute>
78
        </xs:extension>
79
      </xs:simpleContent>  
80
     </xs:complexType>
81

    
82
  <!--  MediaType -->
83
  <xs:complexType name="MediaType">
84
    <xs:annotation>
85
      <xs:documentation>Value drawn from the value space of IANA Media Types (
86
        http://www.iana.org/assignments/media-types/media-types.xhtml ). When 
87
        specified, indicates the IANA Media Type (aka MIME-Type) of the object. 
88
        The name attribute MUST include the media type and subtype 
89
        (e.g. text/csv). The media type value is not case sensitive.
90
      </xs:documentation>
91
      <xs:documentation>Any required media type parameters must be provided, and
92
        optional parameters may be specified. There are no explicit constraints 
93
        on the name of media-type properties or their values, however they 
94
        SHOULD conform to media type optional and required parameters as 
95
        specified in the respective media type RFC.
96
      </xs:documentation>
97
    </xs:annotation>
98
    <xs:sequence>
99
      <xs:element name="property" 
100
                  type="d1_v2.0:MediaTypeProperty" 
101
                  minOccurs="0" 
102
                  maxOccurs="unbounded">
103
        <xs:annotation>
104
          <xs:documentation>Media-type parameter(s) as specified by the 
105
            respective RFC for the media-type.
106
          </xs:documentation>
107
        </xs:annotation>
108
      </xs:element>
109
    </xs:sequence>
110
    <xs:attribute name="name" type="xs:string" use="required" >
111
      <xs:annotation>
112
        <xs:documentation>The value of the media-type specified as a 
113
          required 'name' attribute of the mediaType element.
114
        </xs:documentation>
115
      </xs:annotation>
116
    </xs:attribute>
117
  </xs:complexType>
118

    
119

    
120
  <!-- Updated SystemMetadata type -->
121
  <xs:complexType name="SystemMetadata" >
122
      <xs:annotation>
123
        <xs:documentation>System metadata in DataONE APIs version 2.0 extends
124
        the :class:`types.SystemMetadata` definition of version 1.x by adding 
125
        :term:`seriesId`, :term:`mediaType`, and :term:`fileName` elements. Each 
126
        of these are optional, so Version 1.x System Metadata is compatible with 
127
        Version 2.x, though not vice-versa.
128
        </xs:documentation>
129
      </xs:annotation>
130
      <xs:complexContent>
131
        <xs:extension base="d1:SystemMetadata">
132
          <xs:sequence>
133
            <xs:element name="seriesId" type="d1:Identifier" minOccurs="0">
134
                <xs:annotation>
135
                  <xs:documentation>The :term:`seriesId` is an optional, unique
136
                  Unicode string that identifies an object revision chain. A
137
                  seriesId will resolve to the latest version of an object. A seriesId can not appear in any other revision chain.
138
                  </xs:documentation>
139
                  <xs:documentation>The values used for seriesId must be unique 
140
                  within DataONE and cannot be the same as the :term:`primary 
141
                  identifier` of an object. </xs:documentation>
142
                  <xs:documentation>The same encoding rules used for identifier 
143
                  values apply to seriesId values.</xs:documentation>
144
                </xs:annotation>
145
              </xs:element>
146
              <xs:element name="mediaType" type="d1_v2.0:MediaType" minOccurs="0">
147
                <xs:annotation>
148
                  <xs:documentation>When specified, indicates the IANA Media 
149
                    Type (aka MIME-Type) of the object. When specified, this 
150
                    value overrides the default value specified in the version 
151
                    2.0 ObjectFormat structure. The value should include the 
152
                    media type and subtype (e.g. text/csv). The mediaType value 
153
                    is not case sensitive.</xs:documentation>
154
                    <xs:documentation>The purpose of this value is to provide 
155
                      more detailed information about the specific media type 
156
                      of the associated object than may be available through 
157
                      the associated ObjectFormat.
158
                    </xs:documentation>
159
                    <xs:documentation>When specified, the mediaType value here 
160
                      overrides the value recorded in the referenced
161
                      :class:`ObjectFormat`.
162
                    </xs:documentation>
163
                    <xs:documentation>This value SHOULD be set by the content 
164
                    creator. It MAY be set by any receiving agent if the value 
165
                    is not already set, the value in the ObjectFormat is less 
166
                    specific, and a correct value is specified elsewhere such 
167
                    as by a HTTP Content-Type parameter.
168
                    </xs:documentation>
169
                    <xs:documentation>This value MAY be changed to correct an
170
                    erroneous entry.</xs:documentation>
171
                </xs:annotation>
172
              </xs:element>
173
              <xs:element name="fileName" type="xs:string" minOccurs="0">
174
                <xs:annotation>
175
                  <xs:documentation>Optional though recommended value providing 
176
                    a suggested file name for the object. Values should
177
                    conform to cross platform file naming conventions.
178
                  </xs:documentation>
179
                  <xs:documentation>This value SHOULD be set by the content 
180
                    creator.</xs:documentation>
181
                  <xs:documentation>This value MAY be set by any receiving agent
182
                    Changing the value is discouraged once set, unless by the 
183
                    authoritative Member Node of content owner.
184
                  </xs:documentation>
185
                </xs:annotation>
186
              </xs:element>
187
          </xs:sequence>
188
        </xs:extension>
189
      </xs:complexContent>  
190
     </xs:complexType>
191
     
192
     <!-- Node List -->  
193
  <xs:complexType name="NodeList">
194
    <xs:annotation>
195
      <xs:documentation> A list of :class:`v2_0.Types.Node` entries returned by
196
      :func:`CNCore.listNodes()`.
197
      </xs:documentation>
198
      <xs:documentation>NodeList is described in :mod:`NodeList`.
199
      </xs:documentation>
200
    </xs:annotation>
201
    <xs:sequence>
202
      <xs:element name="node" 
203
                  type="d1_v2.0:Node"
204
                  maxOccurs="unbounded" 
205
                  minOccurs="1"/>
206
    </xs:sequence>
207
  </xs:complexType>
208

    
209
     
210
     <!-- Updated Node type to allow for Service Extensions-->
211
  <xs:complexType name="Node">
212
    <xs:annotation>
213
      <xs:documentation>Extends the Version 1.x :class:`Types.Node` by adding 
214
        an optional unbounded parameter entry providing additional simple 
215
        metadata relevant to a Node. </xs:documentation>
216
    </xs:annotation>
217
    <xs:complexContent>
218
      <xs:extension base="d1:Node">
219
        <xs:sequence>
220
          <xs:element name="property" 
221
                      type="d1_v2.0:Property" 
222
                      minOccurs="0" 
223
                      maxOccurs="unbounded">
224
            <xs:annotation>
225
              <xs:documentation>Allows additional attributes be added to the 
226
                Node document as needed.</xs:documentation>
227
            </xs:annotation>
228
          </xs:element>
229
        </xs:sequence>
230
      </xs:extension>
231
    </xs:complexContent>  
232
   </xs:complexType>
233

    
234
     
235
  <!-- Property extension-->
236
  <xs:complexType name="Property">
237
      <xs:annotation>
238
        <xs:documentation>Additional Property elements can be included to 
239
          describe the Node in more detail. Some properties will come from 
240
          controlled vocabularies indicated by the type attribute, while 
241
          others will be free-form key value pairs.</xs:documentation>
242
      </xs:annotation>
243
      <xs:simpleContent>
244
        <xs:extension base="xs:string">
245
          <xs:attribute name="key" type="xs:string" use="required">
246
            <xs:annotation>
247
                <xs:documentation>The property key for this entry. Should be 
248
                  unique within the Node element.</xs:documentation>
249
          </xs:annotation>
250
          </xs:attribute>
251
          <xs:attribute name="type" type="xs:string" use="optional">
252
            <xs:annotation>
253
                <xs:documentation>The optional type for the property. Can be 
254
                  used to indicate if a controlled vocabulary is used for the
255
                  property key to better facilitate machine interpretation.
256
                </xs:documentation>
257
          </xs:annotation>
258
          </xs:attribute>
259
        </xs:extension>
260
      </xs:simpleContent>  
261
     </xs:complexType>
262
     
263
     <!-- Updated ObjectFormat type to allow for MIME type and extension -->
264
  <xs:complexType name="ObjectFormat">
265
    <xs:annotation>
266
      <xs:documentation>Extends Version 1.x :class:`Types.ObjectFormat` by 
267
        adding :term:`mediaType` and :term:`extension` elements.
268
       </xs:documentation>
269
    </xs:annotation>
270
    <xs:complexContent>
271
      <xs:extension base="d1:ObjectFormat">
272
        <xs:sequence>
273
          <xs:element name="mediaType" type="d1_v2.0:MediaType" minOccurs="0">
274
              <xs:annotation>
275
                <xs:documentation>The IANA Media Type for this object format.
276
                </xs:documentation>
277
              </xs:annotation>
278
        </xs:element>
279
        <xs:element name="extension" type="xs:string" minOccurs="0">
280
              <xs:annotation>
281
                <xs:documentation>Suggested file name extension to be used 
282
                  when serializing this type of object to a file. The value 
283
                  should not include the period (.).</xs:documentation>
284
              </xs:annotation>
285
        </xs:element>
286
        </xs:sequence>
287
      </xs:extension>
288
    </xs:complexContent>  
289
  </xs:complexType>
290
     
291
  <!--  ObjectFormatList -->
292
  <xs:complexType name="ObjectFormatList">
293
    <xs:annotation>  
294
      <xs:documentation>Extends :class:`Types.ObjectFormatList` to provide a 
295
        list of :class:`v2_0.Types.ObjectFormat`.
296
      </xs:documentation>
297
    </xs:annotation>
298
    <xs:complexContent>
299
      <xs:extension base="d1:Slice">
300
        <xs:sequence>
301
          <xs:element name="objectFormat" 
302
                      type="d1_v2.0:ObjectFormat" 
303
                      minOccurs="1" 
304
                      maxOccurs="unbounded" />
305
        </xs:sequence>
306
      </xs:extension>
307
    </xs:complexContent>
308
  </xs:complexType>
309
  
310
  <!--  Log -->
311
  <xs:complexType name="Log">
312
    <xs:annotation>
313
      <xs:documentation>Extends :class:`Types.Log` to represent a collection of 
314
        :class:`v2_0.Types.LogEntry` elements, used to transfer log information 
315
        between DataONE components.</xs:documentation>
316
    </xs:annotation>
317
    <xs:complexContent>
318
      <xs:extension base="d1:Slice">
319
        <xs:sequence>
320
          <xs:element name="logEntry" type="d1_v2.0:LogEntry" minOccurs="0"
321
            maxOccurs="unbounded" />
322
        </xs:sequence>
323
      </xs:extension>
324
    </xs:complexContent>
325
  </xs:complexType>
326
  
327
  <!-- LogEntry -->
328
  <xs:complexType name="LogEntry">
329
    <xs:annotation>
330
      <xs:documentation>Extends :class:`Types.LogEntry` by relaxing the value 
331
        space for the *event* element.</xs:documentation>
332
    </xs:annotation>
333
    <xs:sequence>
334
      <xs:element name="entryId" type="d1:NonEmptyString" 
335
          minOccurs="1" maxOccurs="1">
336
        <xs:annotation>
337
          <xs:documentation>A unique identifier for this log entry. The
338
          identifier should be unique for a particular node; This is not drawn
339
          from the same value space as other identifiers in DataONE, and so is
340
          not subject to the same restrictions.</xs:documentation>
341
        </xs:annotation>
342
      </xs:element>
343
      <xs:element name="identifier" type="d1:Identifier" 
344
          minOccurs="1" maxOccurs="1">
345
        <xs:annotation>
346
          <xs:documentation>The :term:`identifier` of the object that was the
347
          target of the operation which generated this log entry.</xs:documentation>
348
        </xs:annotation>
349
      </xs:element>
350
      <xs:element name="ipAddress" type="xs:string"
351
          minOccurs="1" maxOccurs="1">
352
        <xs:annotation>
353
          <xs:documentation>The IP address, as reported by the service receiving
354
          the request, of the request origin.</xs:documentation>
355
        </xs:annotation>
356
      </xs:element>
357
      <xs:element name="userAgent" type="xs:string"
358
          minOccurs="1" maxOccurs="1">
359
        <xs:annotation>
360
          <xs:documentation>The user agent of the client making the request, as
361
          reported in the User-Agent HTTP header.</xs:documentation>
362
        </xs:annotation>
363
      </xs:element>
364
      <xs:element name="subject" type="d1:Subject"
365
          minOccurs="1" maxOccurs="1">
366
        <xs:annotation>
367
          <xs:documentation>The :term:`Subject` used for making the request.
368
          This may be the DataONE :term:`public` user if the request is not
369
          authenticated, otherwise it will be the *subject* of the certificate
370
          used for authenticating the request.</xs:documentation>
371
        </xs:annotation>
372
      </xs:element>
373
      <xs:element name="event" type="d1:NonEmptyString"
374
          minOccurs="1" maxOccurs="1">
375
        <xs:annotation>
376
          <xs:documentation>A non-empty string indicating the type of event 
377
            logged. A value from the :class:`Types.Event` enumeration is 
378
            recommended though no longer required for Version 2.x.
379
          </xs:documentation>
380
        </xs:annotation>
381
      </xs:element>
382
      <xs:element name="dateLogged" type="xs:dateTime"
383
          minOccurs="1" maxOccurs="1">
384
        <xs:annotation>
385
          <xs:documentation>A :class:`Types.DateTime` time stamp indicating when
386
          the event triggering the log message ocurred. Note that all time
387
          stamps in DataONE are in UTC.</xs:documentation>
388
        </xs:annotation>
389
      </xs:element>
390
      <xs:element name="nodeIdentifier" type="d1:NodeReference"
391
          minOccurs="1" maxOccurs="1">
392
        <xs:annotation>
393
          <xs:documentation>The unique identifier for the node where the log
394
          message was generated.</xs:documentation>
395
        </xs:annotation>
396
      </xs:element>
397
    </xs:sequence>
398
  </xs:complexType>
399
  
400
  <!-- OptionList -->
401
  <xs:complexType name="OptionList">
402
    <xs:annotation>
403
      <xs:documentation>A list of options that indicate the possible values for 
404
        a DataONE service. Each option that can be validly sent to a service is
405
        listed, providing the specific key that should be used when interacting 
406
        with the service, as well as a description of that key that allows API 
407
        users to understand the usage of the key.  For example, an OptionList 
408
        might contain a list of themes that can be used with the MNView.view 
409
        service, or for other services that have a configurable but controlled 
410
        set of parameters.</xs:documentation>
411
    </xs:annotation>
412
    <xs:sequence>
413
      <xs:element name="option" 
414
                  type="d1:NonEmptyString" 
415
                  minOccurs="0" 
416
                  maxOccurs="unbounded">
417
        <xs:annotation>
418
          <xs:documentation>The key to be used within an API call to a DataONE 
419
          service, including a description of the key and its impact on the 
420
          service. For example, a key 'default' can be provided as the theme for 
421
          the MNView.view service.  Keys must not contain characters that will 
422
          need to be URL escaped.</xs:documentation>
423
        </xs:annotation>
424
      </xs:element>
425
    </xs:sequence>
426
    <xs:attribute name="key" use="required" type="xs:string">
427
      <xs:annotation>
428
        <xs:documentation>A value that can be used with a DataONE service. Key
429
        values must not contain any characters that need to be URL escaped, and
430
        should be short and informative. 
431
        </xs:documentation>
432
      </xs:annotation>
433
    </xs:attribute>
434
    <xs:attribute name="description" use="required" type="xs:string">
435
      <xs:annotation>
436
        <xs:documentation>The description of an option, indicating its intended 
437
          use and impact on a DataONE service invocation.</xs:documentation>
438
      </xs:annotation>
439
    </xs:attribute>
440
  </xs:complexType>
441

    
442
  <!-- ******************************************
443
          DEFINE ROOT ELEMENTS OF MESSAGES HERE 
444
          ****************************************** -->
445
  <!-- NOTE THAT ALL SERIALIZEABLE ROOT ELEMENTS FOR MESSAGES SHOULD BE OF A 
446
       COMPLEX TYPE -->
447

    
448
  <!-- These root-level element definitions are provided for selected types so
449
       that those types can be used in serialized messages in method calls in
450
       DataONE. Any type that is included as a parameter to or a return type
451
       from a DataONE service should have a corresponding root element of that
452
       type defined here.
453
  -->
454

    
455
  <xs:element name="optionList" type="d1_v2.0:OptionList" />
456
  <xs:element name="systemMetadata" type="d1_v2.0:SystemMetadata" />
457
  <xs:element name="property" type="d1_v2.0:Property" />
458
  <xs:element name="node" type="d1_v2.0:Node" />
459
  <xs:element name="nodeList" type="d1_v2.0:NodeList" />  
460
  <xs:element name="objectFormat" type="d1_v2.0:ObjectFormat" />  
461
  <xs:element name="objectFormatList" type="d1_v2.0:ObjectFormatList" />
462
  <xs:element name="log" type="d1_v2.0:Log" />
463
  <xs:element name="logEntry" type="d1_v2.0:LogEntry" />
464
  <xs:element name="mediaType" type="d1_v2.0:MediaType" />
465
    
466
</xs:schema>
467

    
(3-3/3)