-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtumorml.xsd
536 lines (534 loc) · 18.4 KB
/
tumorml.xsd
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<?xml version="1.0" encoding="UTF-8"?>
<!--
XML schema for TumorML 1.2
Author: David Johnson
Contributors: Stelios Sfakianakis
Created with oXygen XML editor
Copyright (c) 2012-2013, University of Oxford; 2013-, TumorML contributors.
The TumorML schema is distributed under the terms of the GNU Lesser General Public License (LGPL)
http://www.gnu.org/licenses/lgpl.html
-->
<xs:schema xmlns="http://www.tumorml.org/tumorml/1.2" targetNamespace="http://www.tumorml.org/tumorml/1.2" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!-- Regex for alphanumeric combinations w/ underscores OR MIRIAM URIs -->
<xs:simpleType name="ident">
<xs:restriction base="xs:token">
<xs:pattern value="_*[0-9a-zA-Z][_0-9a-zA-Z]*|(urn:miriam:([\w\-\.]+\.[\w\-\.]+)+:[\w\-\.]+:[\w\-\.]+)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="url">
<xs:restriction base="xs:token">
<xs:pattern value="[hH][tT]{2}[pP]://[wW]{3}.*"/>
</xs:restriction>
</xs:simpleType>
<!-- Tumor Model Taxonomy -->
<xs:simpleType name="mathType">
<xs:restriction base="xs:string">
<xs:enumeration value="discrete"/>
<xs:enumeration value="continuous"/>
<xs:enumeration value="hybrid"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="multiScaleType">
<xs:restriction base="xs:string">
<xs:enumeration value="topDown"/>
<xs:enumeration value="bottomUp"/>
<xs:enumeration value="middleOut"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="singleScaleType">
<xs:restriction base="xs:string">
<xs:enumeration value="gene"/>
<xs:enumeration value="subcellular"/>
<xs:enumeration value="cell"/>
<xs:enumeration value="tissue"/>
<xs:enumeration value="organ"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="cancerType">
<xs:restriction base="xs:string">
<xs:enumeration value="glioma"/>
<xs:enumeration value="glioblastoma"/>
<xs:enumeration value="nephroblastoma"/>
<xs:enumeration value="lung"/>
<xs:enumeration value="breast"/>
<xs:enumeration value="generic"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="homogeneityType">
<xs:restriction base="xs:string">
<xs:enumeration value="homogeneous"/>
<xs:enumeration value="non-homogeneous"/>
</xs:restriction>
</xs:simpleType>
<!--
JSDL types
n.b. Restricted due to TUMOR repository DB schema restrictions
-->
<xs:simpleType name="osType">
<xs:restriction base="xs:string">
<xs:enumeration value="unknown"/>
<xs:enumeration value="linux"/>
<xs:enumeration value="winNT"/>
<xs:enumeration value="macOS"/>
<xs:enumeration value="winXP"/>
<xs:enumeration value="winVista"/>
<xs:enumeration value="win7"/>
<xs:enumeration value="solaris"/>
<xs:enumeration value="sunOS"/>
<xs:enumeration value="javaVM"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="cpuType">
<xs:restriction base="xs:string">
<xs:enumeration value="sparc"/>
<xs:enumeration value="powerpc"/>
<xs:enumeration value="x86"/>
<xs:enumeration value="x86_32"/>
<xs:enumeration value="x86_64"/>
<xs:enumeration value="parisc"/>
<xs:enumeration value="mips"/>
<xs:enumeration value="ia64"/>
<xs:enumeration value="arm"/>
<xs:enumeration value="other"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="langType">
<xs:restriction base="xs:string">
<xs:enumeration value="c"/>
<xs:enumeration value="cpp"/>
<xs:enumeration value="java"/>
<xs:enumeration value="python"/>
<xs:enumeration value="perl"/>
<xs:enumeration value="fortran"/>
<xs:enumeration value="bash"/>
<xs:enumeration value="multiple"/>
<xs:enumeration value="matlab"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="commandLineDataTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="int"/>
<xs:enumeration value="double"/>
<xs:enumeration value="filename"/>
<xs:enumeration value="string"/>
</xs:restriction>
</xs:simpleType>
<!--
some simple Dublin Core elements
n.b. Simplified due to TUMOR repository DB schema restrictions
-->
<xs:group name="dc_elements">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="title"/>
<xs:element ref="creator"/>
<xs:element ref="description"/>
<xs:element ref="publisher"/>
<xs:element ref="contributor"/>
<xs:element ref="date"/>
</xs:choice>
</xs:sequence>
</xs:group>
<xs:element name="title" type="xs:string"/>
<xs:element name="creator" type="person"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="publisher" type="person"/>
<xs:element name="contributor" type="person"/>
<xs:element name="date" type="xs:dateTime"/>
<!--
some simple xCard (vCard) elements describing an individual person, including a TUMOR user ID
n.b. Simplified due to TUMOR repository DB schema restrictions
-->
<xs:complexType name="person">
<xs:sequence>
<xs:element ref="person"/>
</xs:sequence>
</xs:complexType>
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="fullname"/>
<xs:element minOccurs="0" ref="name"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="email"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="org"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="ident"/>
</xs:complexType>
</xs:element>
<xs:element name="fullname" type="xs:string"/>
<xs:element name="name">
<xs:complexType>
<xs:sequence>
<xs:element ref="surname"/>
<xs:element ref="given"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="prefix"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="suffix"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="surname" type="xs:string"/>
<xs:element name="given" type="xs:string"/>
<xs:element name="prefix" type="xs:string"/>
<xs:element name="suffix" type="xs:string"/>
<xs:element name="email" type="xs:string"/>
<xs:element name="org" type="xs:string"/>
<!--
TUMOR repository specific metadata
n.b. Based on TUMOR repository DB schema
-->
<xs:group name="tumor_elements">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="math"/>
<xs:element ref="singleScale"/>
<xs:element ref="multiScale"/>
<xs:element ref="cancer"/>
<xs:element ref="homogeneity"/>
<xs:element ref="freeGrowth"/>
<xs:element ref="treatmentIncluded"/>
</xs:choice>
</xs:sequence>
</xs:group>
<xs:element name="math" type="xs:string"/>
<xs:element name="singleScale" type="xs:string"/>
<xs:element name="multiScale" type="xs:string"/>
<xs:element name="cancer" type="xs:string"/>
<xs:element name="homogeneity" type="xs:string"/>
<xs:element name="freeGrowth" type="xs:boolean"/>
<xs:element name="treatmentIncluded" type="xs:boolean"/>
<!--
External references
n.b. Based on TUMOR repository DB schema
-->
<!-- bibType is based on BibTeX -->
<xs:simpleType name="bibType">
<xs:restriction base="xs:string">
<xs:enumeration value="article"/>
<xs:enumeration value="book"/>
<xs:enumeration value="booklet"/>
<xs:enumeration value="manual"/>
<xs:enumeration value="techreport"/>
<xs:enumeration value="mastersthesis"/>
<xs:enumeration value="phdthesis"/>
<xs:enumeration value="inbook"/>
<xs:enumeration value="incollection"/>
<xs:enumeration value="proceedings"/>
<xs:enumeration value="inproceedings"/>
<xs:enumeration value="conference"/>
<xs:enumeration value="unpublished"/>
<xs:enumeration value="misc"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="reference">
<xs:complexType>
<xs:all>
<xs:element ref="title"/>
<xs:element minOccurs="0" ref="source"/>
<xs:element minOccurs="0" name="creator" type="xs:string"/>
<xs:element minOccurs="0" ref="citation"/>
<xs:element ref="type"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="source" type="xs:string"/>
<xs:element name="citation" type="xs:string"/>
<xs:element name="type" type="xs:string"/>
<!--
SI base units based on NIST Reference
http://physics.nist.gov/cuu/Units/current.html
-->
<xs:simpleType name="siBaseUnitTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="meter"/>
<xs:enumeration value="kilogram"/>
<xs:enumeration value="second"/>
<xs:enumeration value="ampere"/>
<xs:enumeration value="kelvin"/>
<xs:enumeration value="mole"/>
<xs:enumeration value="candela"/>
</xs:restriction>
</xs:simpleType>
<!-- Some extra non standard units used in cancer modelling, e.g. arbitrary counts -->
<xs:simpleType name="tumorExtraUnitTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="item"/>
<xs:enumeration value="gray"/>
</xs:restriction>
</xs:simpleType>
<!-- Combined lists of unit types used in TumorML -->
<xs:simpleType name="unitTypes">
<xs:union memberTypes="siBaseUnitTypes tumorExtraUnitTypes"/>
</xs:simpleType>
<!-- or derived unit name -->
<!-- Units model -->
<xs:element name="derivedUnit">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="unit">
<xs:complexType>
<xs:attribute name="name" use="required"/>
<xs:attribute name="multiplier" type="xs:int"/>
<xs:attribute name="offset" type="xs:int"/>
<xs:attribute name="scale" type="xs:int"/>
<xs:attribute name="exp" type="xs:int"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<!-- Each TumorML model has an ID to lookup in the repository -->
<xs:attributeGroup name="tumorml_id">
<xs:attribute name="id" use="required" type="ident"/>
</xs:attributeGroup>
<!-- Basic structure is a model ID, header containing metadata, followed by the model description -->
<xs:element name="tumorml">
<xs:complexType>
<xs:sequence>
<xs:element ref="header"/>
<xs:element ref="model"/>
</xs:sequence>
<xs:attributeGroup ref="tumorml_id"/>
</xs:complexType>
</xs:element>
<!--
The header contains metadata as:
* Dublin Core elements
* TUMOR repository DB specific elements
* Bibliographical references (optional)
-->
<xs:element name="header">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="dc_elements"/>
<xs:group ref="tumor_elements"/>
<xs:element ref="reference"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!--
The model description contains either:
1) a simple model as
* One or more implementations
* A input/output parameters profile
or
2) a complex model as
* Multiple submodels
* A model instance topology
-->
<xs:element name="model">
<xs:complexType>
<xs:choice>
<xs:group ref="simpleModel"/>
<xs:group ref="complexModel"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:group name="simpleModel">
<xs:sequence>
<xs:element ref="parameters"/>
<xs:element maxOccurs="unbounded" ref="implementation"/>
</xs:sequence>
</xs:group>
<xs:group name="complexModel">
<xs:sequence>
<xs:element ref="submodel"/>
<xs:element maxOccurs="unbounded" ref="submodel"/>
<xs:element ref="topology"/>
</xs:sequence>
</xs:group>
<!--
Each implementation contains:
* Metadata as Dublin Core and any number of bibliographic references (optional)
* A package file name
* A command line to initiate model execution
* A list of runtime environment requirements
-->
<xs:element name="implementation">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="dc_elements"/>
<xs:element ref="reference"/>
<xs:element ref="package"/>
<xs:element ref="command"/>
<xs:element ref="requirements"/>
</xs:choice>
<xs:attribute name="id" use="required" type="ident"/>
</xs:complexType>
</xs:element>
<!-- A package consists of a package name and a list of files -->
<xs:element name="package">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="file"/>
</xs:sequence>
<xs:attribute name="name" use="required"/>
<xs:attribute name="checksum" use="required"/>
</xs:complexType>
</xs:element>
<!-- A file has a name, a full path relative to the package root, and a checksum (optional) -->
<xs:simpleType name="fname">
<xs:restriction base="xs:token">
<xs:pattern value="[A-Za-z0-9\\-\\._]+"/>
</xs:restriction>
</xs:simpleType>
<!-- not tested yet -->
<xs:simpleType name="dpath">
<xs:restriction base="xs:token">
<xs:pattern value="(/)?([^\\0]+(/)?)+"/>
</xs:restriction>
</xs:simpleType>
<!-- not tested yet -->
<xs:element name="file">
<xs:complexType>
<xs:attribute name="name" use="required" type="fname"/>
<xs:attribute name="source" use="required" type="dpath"/>
<xs:attribute name="checksum"/>
</xs:complexType>
</xs:element>
<!-- A command is a simple string for now. -->
<xs:element name="command" type="xs:string"/>
<!-- TODO replace with a suitable regex -->
<!--
The requirements include:
* Operating system (optional)
* CPU architecture (optional)
* Languages that need to be supported (optional, can be multiple)
-->
<xs:element name="requirements">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="operatingSystem"/>
<xs:element ref="CPUArchitecture"/>
<xs:element ref="language"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="operatingSystem" type="osType"/>
<xs:element name="CPUArchitecture" type="cpuType"/>
<xs:element name="language" type="langType"/>
<!--
Each submodel has a unique ID and:
* All the elements of a simple model
or
* All the elements of a complex model
-->
<xs:element name="submodel">
<xs:complexType>
<xs:choice>
<xs:group ref="simpleModel"/>
<xs:group ref="complexModel"/>
</xs:choice>
<xs:attribute name="id" type="ident"/>
</xs:complexType>
</xs:element>
<!-- A topology declares a 2 or more instances and at least one coupling of instance parameters together -->
<xs:element name="topology">
<xs:complexType>
<xs:sequence>
<xs:element ref="instance"/>
<xs:element maxOccurs="unbounded" ref="instance"/>
<xs:element maxOccurs="unbounded" ref="coupling"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- An instance has a unique ID, references a submodel by ID and has a multiplicity (currently fixed) -->
<xs:element name="instance">
<xs:complexType>
<xs:attribute name="id" use="required" type="ident"/>
<xs:attribute name="submodel" use="required" type="ident"/>
<xs:attribute name="multiplicity" type="xs:int"/>
</xs:complexType>
</xs:element>
<!--
A coupling refers to a specific parameter of two different submodels
* from submodel.parameter
* to submodel.parameter
-->
<xs:element name="coupling">
<xs:complexType>
<xs:attribute name="from" use="required" type="ident"/>
<xs:attribute name="to" use="required" type="ident"/>
</xs:complexType>
</xs:element>
<!--
The parameters element defines at least on input parameter and multiple output parameters
n.b. There must be at least one input parameter
-->
<xs:element name="parameters">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="units"/>
<xs:element ref="in"/>
<xs:element ref="out"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="units">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="derivedUnit"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="in" type="parameter"/>
<xs:element name="out" type="parameter"/>
<!--
Parameters consist of:
* A unique ID/name
* A label (optional)
* A description (optional)
* Whether or not this parameter is optional (optional)
* A value descriptor (optional)
* The descriptor contains a datatype, optional default value, and optional value range
* A unit constraint, based on SI prefix and base units (optional)
regardless of whether they are inputs or outputs
-->
<xs:complexType name="parameter">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="description"/>
<xs:element ref="concept_id"/>
<xs:element ref="value"/>
</xs:choice>
<xs:attribute name="name" use="required" type="ident"/>
<xs:attribute name="label"/>
<xs:attribute name="optional" type="xs:boolean"/>
</xs:complexType>
<xs:element name="concept_id" type="url"/>
<xs:element name="value">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" ref="range"/>
<xs:element minOccurs="0" name="unit">
<xs:complexType>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:union memberTypes="unitTypes ident"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="type" use="required" type="commandLineDataTypes"/>
<xs:attribute name="default"/>
</xs:complexType>
</xs:element>
<xs:element name="range">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" ref="min"/>
<xs:element minOccurs="0" ref="max"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="min">
<xs:complexType mixed="true">
<xs:attribute name="inclusive" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="max">
<xs:complexType mixed="true">
<xs:attribute name="inclusive" type="xs:boolean"/>
</xs:complexType>
</xs:element>
</xs:schema>