-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtumorml.rnc
367 lines (310 loc) · 9.23 KB
/
tumorml.rnc
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
# RELAX NG 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
default namespace tumorml = "http://www.tumor-project.eu/tumorml/1.2"
# Regex for alphanumeric combinations w/ underscores OR MIRIAM URIs
ident = xsd:token { pattern = "(_*[0-9a-zA-Z][\w_]*)|(urn:miriam:[0-9a-zA-Z][\w]*:[0-9a-zA-Z][\w]*)|(urn:miriam:[0-9a-zA-Z][\w]*\.[0-9a-zA-Z][\w]*:[0-9a-zA-Z][\w:\.]*)|(urn:orcid:[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9])|(urn:[0-9a-zA-Z][\w]*\.[0-9a-zA-Z][\w]*:[0-9a-zA-Z][\w]*:[0-9a-zA-Z][\w]*)" }
url = xsd:token { pattern = "[hH][tT]{2}[pP]://[wW]{3}.*" }
# Tumor Model Taxonomy
mathType =
string "discrete"
| string "continuous"
| string "hybrid"
multiScaleType =
string "topDown"
| string "bottomUp"
| string "middleOut"
singleScaleType =
string "gene"
| string "subcellular"
| string "cell"
| string "tissue"
| string "organ"
cancerType =
string "glioma"
| string "glioblastoma"
| string "nephroblastoma"
| string "lung"
| string "breast"
| string "generic"
homogeneityType =
string "homogeneous"
| string "non-homogeneous"
# JSDL types
# n.b. Restricted due to TUMOR repository DB schema restrictions
osType =
string "unknown"
| string "linux"
| string "winNT"
| string "macOS"
| string "winXP"
| string "winVista"
| string "win7"
| string "solaris"
| string "sunOS"
| string "javaVM"
cpuType =
string "sparc"
| string "powerpc"
| string "x86"
| string "x86_32"
| string "x86_64"
| string "parisc"
| string "mips"
| string "ia64"
| string "arm"
| string "other"
langType =
string "c"
| string "cpp"
| string "java"
| string "python"
| string "perl"
| string "fortran"
| string "bash"
| string "multiple"
| string "matlab"
commandLineDataTypes =
string "int"
| string "double"
| string "filename"
| string "string"
# some simple Dublin Core elements
# n.b. Simplified due to TUMOR repository DB schema restrictions
dc_elements = (
element title { text }
& element creator { person }?
& element description { text }?
& element publisher { person }?
& element contributor { person }*
& element date { xsd: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
person = element person {
attribute id { ident }
, element fullname { text }?
, element name {
element surname { text }
, element given { text }
, element prefix { text }*
, element suffix { text }*
}?
, element email { text }*
, element org { text }*
}
# TUMOR repository specific metadata
# n.b. Based on TUMOR repository DB schema
tumor_elements = (
element math { mathType | text }?
& element singleScale { singleScaleType | text }?
& element multiScale { multiScaleType | text }?
& element cancer { cancerType | text }?
& element homogeneity { homogeneityType | text }?
& element freeGrowth { xsd:boolean }?
& element treatmentIncluded { xsd:boolean }?
)
# External references
# n.b. Based on TUMOR repository DB schema
# bibType is based on BibTeX
bibType = string "article"
| string "book"
| string "booklet"
| string "manual"
| string "techreport"
| string "mastersthesis"
| string "phdthesis"
| string "inbook"
| string "incollection"
| string "proceedings"
| string "inproceedings"
| string "conference"
| string "unpublished"
| string "misc"
reference = element reference {
element title { text }
& element source { text }?
& element creator { text }?
& element citation { text }?
& element type { bibType | text }
}
# SI base units based on NIST Reference
# http://physics.nist.gov/cuu/Units/current.html
siBaseUnitTypes =
string "meter"
| string "kilogram"
| string "second"
| string "ampere"
| string "kelvin"
| string "mole"
| string "candela"
# Some extra non standard units used in cancer modelling, e.g. arbitrary counts
tumorExtraUnitTypes =
string "item"
| string "gray"
# Combined lists of unit types used in TumorML
unitTypes = siBaseUnitTypes | tumorExtraUnitTypes
# or derived unit name
# Units model
derivedUnit = element derivedUnit {
attribute name { text }
, element unit {
attribute name { text }
, attribute multiplier { xsd:int }?
, attribute offset { xsd:int }?
, attribute scale { xsd:int }?
, attribute exp { xsd:int }?
}+
}
# Each TumorML model has an ID to lookup in the repository
start = tumorml
tumorml_id = attribute id { ident }
# Basic structure is a model ID, header containing metadata, followed by the model description
tumorml = element tumorml {
tumorml_id
, header
, model
}
# The header contains metadata as:
# * Dublin Core elements
# * TUMOR repository DB specific elements
# * Bibliographical references (optional)
header = element header {
dc_elements
& tumor_elements
& reference*
}
# 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
model = element model {
simpleModel
| complexModel
}
simpleModel = (
parameters
, implementation+
)
complexModel = (
submodel
, submodel+
, topology
)
# 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
implementation = element implementation {
attribute id { ident }
& dc_elements
& reference*
& package
& command
& requirements
}
# A package consists of a package name and a list of files
package = element package {
attribute name { text }
& attribute checksum { text }
& file+
}
# A file has a name, a full path relative to the package root, and a checksum (optional)
fname = xsd:token { pattern = "[A-Za-z0-9\\-\\._]+" } # not tested yet
file = element file {
attribute name { fname } # regex describing valid filenames
& attribute source { ident } # refer to URN within DB
& attribute checksum { text }?
}
# A command is a simple string for now.
command = element command { text } #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)
requirements = element requirements{
element operatingSystem{ osType }?
& element CPUArchitecture{ cpuType }?
& element language { langType }*
}
# Each submodel has a unique ID and:
# * All the elements of a simple model
# or
# * All the elements of a complex model
submodel = element submodel {
(
attribute id { ident }
, simpleModel
)
| complexModel
}
# A topology declares a 2 or more instances and at least one coupling of instance parameters together
topology = element topology {
instance, instance+
, coupling+
}
# An instance has a unique ID, references a submodel by ID and has a multiplicity (currently fixed)
instance = element instance {
attribute id { ident }
& attribute submodel { ident }
& attribute multiplicity { xsd:int }?
}
# A coupling refers to a specific parameter of two different submodels
# * from submodel.parameter
# * to submodel.parameter
coupling = element coupling {
attribute from { ident }
& attribute to { ident }
}
# The parameters element defines at least on input parameter and multiple output parameters
# n.b. There must be at least one input parameter
parameters = element parameters {
element units { derivedUnit+ }*
& element in { parameter }+
& element out { 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
parameter = (
attribute name { ident }
& attribute label { text }?
& attribute optional { xsd:boolean }?
& element description { text }?
& element concept_id { url }?
& element value {
attribute type { commandLineDataTypes }
& attribute \default { text }?
& element range {
element min {
attribute inclusive { xsd:boolean }?
& text
}?
& element max {
attribute inclusive { xsd:boolean }?
& text
}?
}?
& element unit {
# SI unit, or an ID referencing a derived unit
attribute type { unitTypes | ident }
}?
}
)