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
  <!--  MediaType -->
65
  <xs:complexType name="MediaType">
66
    <xs:annotation>
67
      <xs:documentation>Value drawn from the value space of IANA Media Types (
68
        http://www.iana.org/assignments/media-types/media-types.xhtml ). When 
69
        specified, indicates the IANA Media Type (aka MIME-Type) of the object. 
70
        The value should include the media type and subtype (e.g. text/csv). The 
71
        mediaType value is not case sensitive.
72
      </xs:documentation>
73
      <xs:documentation>Any required media type parameters must be provided, and
74
        optional parameters may be specified. There are no explicit constraints 
75
        on the name of attributes or their values, however they SHOULD conform
76
        to media type optional and required parameters as specified in the 
77
        respective media type RFC.
78
      </xs:documentation>
79
    </xs:annotation>
80
    <xs:simpleContent>
81
      <xs:extension base="xs:string">
82
        <xs:anyAttribute namespace="##any" processContents="lax" />
83
      </xs:extension>
84
    </xs:simpleContent>
85
  </xs:complexType>
86

    
87

    
88
  <!-- Updated SystemMetadata type -->
89
  <xs:complexType name="SystemMetadata" >
90
      <xs:annotation>
91
        <xs:documentation>System metadata in DataONE APIs version 2.0 extends
92
        the :class:`types.SystemMetadata` definition of version 1.x by adding 
93
        :term:`seriesId`, :term:`charset`, :term:`mediaType`, and 
94
        :term:`fileName` elements. Each of these are optional, so Version 1.x 
95
        System Metadata is compatible with Version 2.x, though not vice-versa.
96
        </xs:documentation>
97
      </xs:annotation>
98
      <xs:complexContent>
99
        <xs:extension base="d1:SystemMetadata">
100
          <xs:sequence>
101
            <xs:element name="seriesId" type="d1:Identifier" minOccurs="0">
102
                <xs:annotation>
103
                  <xs:documentation>The :term:`seriesId` is a unique Unicode 
104
                  string that can be used to identify an object revision chain 
105
                  in DataONE. When included, the seriesId can be used to 
106
                  reference the latest version of and object in the revision 
107
                  chain. API methods that rely on byte fixity (e.g. for content 
108
                  replication) will not accept seriesId in place of discrete 
109
                  identifiers.</xs:documentation>
110
                  <xs:documentation>The values used for seriesId must be unique 
111
                  within DataONE and cannot be the same as the :term:`primary 
112
                  identifier` of an object. </xs:documentation>
113
                  <xs:documentation>The same encoding rules used for identifier 
114
                  values apply to seriesId values.</xs:documentation>
115
                </xs:annotation>
116
              </xs:element>
117
              <xs:element name="mediaType" type="d1_v2.0:MediaType" minOccurs="0">
118
                <xs:annotation>
119
                  <xs:documentation>When specified, indicates the IANA Media 
120
                    Type (aka MIME-Type) of the object. When specified, this 
121
                    value overrides the default value specified in the version 
122
                    2.0 ObjectFormat structure. The value should include the 
123
                    media type and subtype (e.g. text/csv). The mediaType value 
124
                    is not case sensitive.</xs:documentation>
125
                    <xs:documentation>The purpose of this value is to provide 
126
                      more detailed information about the specific media type 
127
                      of the associated object than may be available through 
128
                      the associated ObjectFormat.
129
                    </xs:documentation>
130
                    <xs:documentation>When specified, the mediaType value here 
131
                      should be used in preference to the value recorded in the 
132
                      referenced :class:`ObjectFormat`.
133
                    </xs:documentation>
134
                    <xs:documentation>This value SHOULD be set by the content 
135
                    creator. It MAY be set by any receiving agent if the value 
136
                    is not already set, the value in the ObjectFormat is less 
137
                    specific, and a correct value is specified elsewhere such 
138
                    as by a HTTP Content-Type parameter.
139
                    </xs:documentation>
140
                    <xs:documentation>This value may only be changed to correct 
141
                      an erroneous entry.</xs:documentation>
142
                </xs:annotation>
143
              </xs:element>
144
              <xs:element name="fileName" type="xs:string" minOccurs="0">
145
                <xs:annotation>
146
                  <xs:documentation>Optional tough recommended value that 
147
                    provides a suggested file name for the object. Values should
148
                    conform to cross platform file naming conventions.
149
                  </xs:documentation>
150
                  <xs:documentation>This value SHOULD be set by the content 
151
                    creator.</xs:documentation>
152
                  <xs:documentation>This value MAY be set by any receiving agent
153
                    Changing the value is discouraged once set, unless by the 
154
                    authoritative Member Node of content owner.
155
                  </xs:documentation>
156
                </xs:annotation>
157
              </xs:element>
158
          </xs:sequence>
159
        </xs:extension>
160
      </xs:complexContent>  
161
     </xs:complexType>
162
     
163
     <!-- Node List -->  
164
  <xs:complexType name="NodeList">
165
    <xs:annotation>
166
      <xs:documentation> A list of :class:`v2_0.Types.Node` entries returned by
167
      :func:`CNCore.listNodes()`.
168
      </xs:documentation>
169
      <xs:documentation>NodeList is described in :mod:`NodeList`.
170
      </xs:documentation>
171
    </xs:annotation>
172
    <xs:sequence>
173
      <xs:element name="node" 
174
                  type="d1_v2.0:Node"
175
                  maxOccurs="unbounded" 
176
                  minOccurs="1"/>
177
    </xs:sequence>
178
  </xs:complexType>
179

    
180
     
181
     <!-- Updated Node type to allow for Service Extensions-->
182
  <xs:complexType name="Node">
183
    <xs:annotation>
184
      <xs:documentation>Extends the Version 1.x :class:`Types.Node` by adding 
185
        an optional unbounded parameter entry that can be used to provide 
186
        additional simple metadata relevant to a Node. </xs:documentation>
187
    </xs:annotation>
188
    <xs:complexContent>
189
      <xs:extension base="d1:Node">
190
        <xs:sequence>
191
          <xs:element name="property" 
192
                      type="d1_v2.0:Property" 
193
                      minOccurs="0" 
194
                      maxOccurs="unbounded">
195
            <xs:annotation>
196
              <xs:documentation>Allows additional attributes be added to the 
197
                Node document as needed.</xs:documentation>
198
            </xs:annotation>
199
          </xs:element>
200
        </xs:sequence>
201
      </xs:extension>
202
    </xs:complexContent>  
203
   </xs:complexType>
204

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

    
413
  <!-- ******************************************
414
          DEFINE ROOT ELEMENTS OF MESSAGES HERE 
415
          ****************************************** -->
416
  <!-- NOTE THAT ALL SERIALIZEABLE ROOT ELEMENTS FOR MESSAGES SHOULD BE OF A 
417
       COMPLEX TYPE -->
418

    
419
  <!-- These root-level element definitions are provided for selected types so
420
       that those types can be used in serialized messages in method calls in
421
       DataONE. Any type that is included as a parameter to or a return type
422
       from a DataONE service should have a corresponding root element of that
423
       type defined here.
424
  -->
425

    
426
  <xs:element name="optionList" type="d1_v2.0:OptionList" />
427
  <xs:element name="systemMetadata" type="d1_v2.0:SystemMetadata" />
428
  <xs:element name="property" type="d1_v2.0:Property" />
429
  <xs:element name="node" type="d1_v2.0:Node" />
430
  <xs:element name="nodeList" type="d1_v2.0:NodeList" />  
431
  <xs:element name="objectFormat" type="d1_v2.0:ObjectFormat" />  
432
  <xs:element name="objectFormatList" type="d1_v2.0:ObjectFormatList" />
433
  <xs:element name="log" type="d1_v2.0:Log" />
434
  <xs:element name="logEntry" type="d1_v2.0:LogEntry" />
435
  <xs:element name="mediaType" type="d1_v2.0:MediaType" />
436
    
437
</xs:schema>
438

    
(3-3/3)