-
Notifications
You must be signed in to change notification settings - Fork 0
/
stmml.xsd
3302 lines (3171 loc) · 132 KB
/
stmml.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
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.xml-cml.org/schema/stmml-1.1"
xmlns:sch="http://www.ascc.net/xml/schematron"
targetNamespace="http://www.xml-cml.org/schema/stmml-1.1"
elementFormDefault="qualified">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<div class="curation">
<ul>
<li>created by hand
2001-11-20</li>
<li>First draft 2001-11-20</li>
</ul>
<p>STMML supports domain-independent STM information components</p>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:appinfo>
<sch:title>Schematron validation</sch:title>
<sch:ns uri="http://www.xml-cml.org/schema/stmml-1.1"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
<div class="heading">Data Types and Data Structure</div>
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
<div class="subheading">Overview</div>
<div class="description">
<p>STM-ML defines a number of data types suited to STM. It also defines
a number of complex data strucures such as arrays, matrices and tables.
the constraints are sometimes created through elements and sometimes
through attributes. We classify the general components as follows:</p>
<p>
<b>Abstract Data Structures</b>
</p>
<ul>
<li>
<a href="el.scalar">scalar</a>. A scalar quantity, expressible as a string, but
with many optional facets such as errors, units, ranges, etc. Most elements
may have <a href="st.countType">countType</a> attribute to indicate more than
one instance.</li>
<li>
<a href="el.array">array</a>. An array of homogeneous <tt>scalar</tt>s
whose size is described by <a href="st.sizeType">sizeType</a>. <a href="st.delimiterType">
Delimiter</a>s in string representations can ve varied.</li>
<li>
<a href="el.matrix">matrix</a>. A rectangular (often square) matrix of
homogeneous <tt>scalar</tt>s. Many matrices have special functions
(see <a href="el.matrixType">matrixType</a>) such as geometric
transformations</li>
<li>
<a href="el.table">table</a>. An table where the columns are homogeneous
<tt>array</tt>s. </li>
<li>
<a href="el.list">list</a>. A list of heterogeneous components from any
namespace.</li>
<li>
<a href="st.sizeType">sizeType</a>. Size of arrays</li>
<li>
<a href="st.delimiterType">delimiterType</a>. A lexical delimiter</li>
</ul>
<p>
<b>Links and References</b>
</p>
<ul>
<li>
<a href="el.link">link</a>. Support for simple hyperlinks and link structures</li>
<li>
<a href="st.refType">refType</a>. A reference to an element</li>
<li>
<a href="st.namespaceRefType">namespaceRefType</a>. A reference to an element, including
namespace-like prefixes</li>
</ul>
<p>
<b>Data-based simpleTypes</b>
</p>
<ul>
<li>
<a href="st.coordinate2Type">coordinate2Type</a>. A 2-D coordinate</li>
<li>
<a href="st.coordinate3Type">coordinate3Type</a>. A 3-D coordinate</li>
<li>
<a href="st.dataTypeType">dataTypeType</a>. An enumeration of
data types (similar to those in XML Schema).</li>
<li>
<a href="st.errorBasisType">errorBasisType</a>. Basis of numeric error estimates</li>
<li>
<a href="st.minType">minType</a>. Minimum value</li>
<li>
<a href="st.maxType">maxType</a>. Maximum value</li>
</ul>
<p>
<b>Common attribute types</b>
</p>
<ul>
<li>
<a href="st.idType">idType</a>. Specifies lexical patterns for IDs</li>
<li>
<a href="attGp.idGroup">idGroup</a>. ID attribute (highly encouraged)</li>
<li>
<a href="attGp.titleGroup">titleGroup</a>. Title attribute (highly encouraged)</li>
<li>
<a href="attGp.convGroup">convGroup</a>. Convention attribute</li>
</ul>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
<div class="subheading">Data structure</div>
</xsd:documentation>
</xsd:annotation>
<xsd:element name="array" id="el.array">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
A homogenous 1-dimensional array of similar objects.</div>
<div class="description">
<p>
<tt>array</tt> manages a homogenous 1-dimensional array of similar objects. These
can be encoded as strings (i.e. XSD-like datatypes) and are concatenated as
string content. The size of the array should always be >= 1.
</p>
<p>The default delimiter is whitespace. The <tt>normalize-space()</tt> function of
XSLT could be used to normalize all whitespace to single spaces and this would not affect
the value of the array elements. To extract the elements <tt>java.lang.StringTokenizer</tt>
could be used. If the elements themselves contain whitespace then a different delimiter
must be used and is identified through the <tt>delimiter</tt> attribute. This method is
mandatory if it is required to represent empty strings. If a delimiter is used it MUST
start and end the array - leading and trailing whitespace is ignored. Thus <tt>size+1</tt>
occurrences of the delimiter character are required. If non-normalized whitespace is to be
encoded (e.g. newlines, tabs, etc) you are recommended to translate it character-wise
to XML character entities.
</p>
<p>Note that normal Schema validation tools cannot validate the elements
of <b>array</b> (they are defined as <tt>string</tt>) However if the string is
split, a temporary schema
can be constructed from the type and used for validation. Also the type
can be contained in a dictionary and software could decide to retrieve this
and use it for validation.</p>
<p>When the elements of the <tt>array</tt> are not simple scalars
(e.g. <a href="el.scalar">scalar</a>s with a value and an error, the
<tt>scalar</tt>s should be used as the elements. Although this is
verbose, it is simple to understand. If there is a demand for
more compact representations, it will be possible to define the
syntax in a later version.</p>
</div>
<div class="example">
<pre>
<array size="5" title="value"
dataType="xsd:decimal"> 1.23 2.34 3.45 4.56 5.67</array>
</pre>
<p>the <tt>size</tt> attribute is not mandatory but provides a useful validity
check): </p>
</div>
<div class="example">
<pre>
<array size="5" title="initials" dataType="xsd:string"
delimiter="/">/A B//C/D-E/F/</array>
</pre>
<p>Note that the second array-element is the empty string ''.</p>
</div>
<div class="example">
<pre>
<array title="mass" size="4"
units="unit:g"
errorBasis="observedStandardDeviation"
minValues="10 11 10 9"
maxValues="12 14 12 11"
errorValues="1 2 1 1"
dataType="xsd:float">11 12.5 10.9 10.2
</array>
</pre>
</div>
</xsd:documentation>
<xsd:appinfo>
<sch:pattern xmlns="http://www.ascc.net/xml/schematron" name="array">
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
<xsd:attribute name="dataType" type="dataTypeType" default="xsd:string">
<xsd:annotation>
<xsd:documentation>
<div class="summary">all elements of the array must have the same dataType</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="errorValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of error values for numeric arrays</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="errorBasis" type="errorBasisType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A string describing the basis of the errors</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="minValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of minimum values for numeric arrays</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maxValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of maximum values for numeric arrays</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="units" type="unitsType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">a string denoting the units (recommended for numeric quantities!!).
All elements must have the same units</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="delimiter" type="delimiterType"/>
<xsd:attribute name="size" type="xsd:positiveInteger"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="scalar" id="el.scalar">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An element to hold scalar data.</div>
<div class="description">
<p>
<tt>scalar</tt> holds scalar data under a single
generic container. The semantics are usually resolved by
linking to a dictionary.
<b>scalar</b> defaults to a scalar string but
has attributes which affect the type.
</p>
<p>
<tt>scalar</tt> does not necessarily reflect a physical object (for which
<a href="el.object">object</a> should be used). It may reflect a property of an object
such as temperature, size, etc. </p>
<p>Note that normal Schema validation tools cannot validate the data type
of <b>scalar</b> (it is defined as <tt>string</tt>), but that a temporary schema
can be constructed from the type and used for validation. Also the type
can be contained in a dictionary and software could decide to retrieve this
and use it for validation.</p>
</div>
<div class="example">
<pre>
<scalar
dataType="xsd:decimal"
errorValue="1.0"
errorBasis="observedStandardDeviation"
title="body weight"
dictRef="zoo:bodywt"
units="units:g">34.3</scalar>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
<xsd:attribute name="dataType" type="dataTypeType" default="xsd:string"/>
<xsd:attribute name="errorValue" type="xsd:decimal"/>
<xsd:attribute name="errorBasis" type="errorBasisType"/>
<xsd:attribute name="minValue" type="minType"/>
<xsd:attribute name="maxValue" type="maxType"/>
<xsd:attribute name="units" type="unitsType"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="matrix" id="el.matrix">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A rectangular matrix of any quantities</div>
<div class="description">
<p>By default <tt>matrix</tt> represents
a rectangular matrix of any quantities
representable as XSD or STMML dataTypes. It consists of
<tt>rows*columns</tt> elements, where <tt>columns</tt> is the
fasting moving index. Assuming the elements are counted from 1 they are
ordered <tt>V[1,1],V[1,2],...V[1,columns],V[2,1],V[2,2],...V[2,columns],
...V[rows,1],V[rows,2],...V[rows,columns]</tt>
</p>
<p>By default whitespace is used to separate matrix elements; see
<a href="el.array">array</a> for details. There are NO characters or markup
delimiting the end of rows; authors must be careful!. The <tt>columns</tt>
and <tt>rows</tt> attributes have no default values; a row vector requires
a <tt>rows</tt> attribute of 1.</p>
<p>
<tt>matrix</tt> also supports many types of square matrix, but at present we
require all elements to be given, even if the matrix is symmetric, antisymmetric
or banded diagonal. The <tt>matrixType</tt> attribute allows software to
validate and process the type of matrix.</p>
</div>
<div class="example">
<pre>
<matrix id="m1" title="mattrix-1" dictRef="foo:bar"
rows="3" columns="3" dataType="xsd:decimal"
delimiter="|" matrixType="squareSymmetric" units="unit:m"
>|1.1|1.2|1.3|1.2|2.2|2.3|1.3|2.3|3.3!</matrix>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="dataType" type="dataTypeType" default="xsd:float"/>
<xsd:attribute name="delimiter" type="delimiterType"/>
<xsd:attribute name="rows" type="sizeType" use="required">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>Number of rows</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="columns" type="sizeType" use="required">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>Number of columns</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="units" type="unitsType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>units (recommended for numeric quantities!!)</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
<xsd:attribute name="matrixType" type="matrixType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>Type of matrix (mainly square ones)</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="errorValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of error values for numeric matrices</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="errorBasis" type="errorBasisType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A string describing the basis of the errors</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="minValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of minimum values for numeric matrices</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maxValues" type="floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">an optional array of maximum values for numeric matrices</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="table" id="el.table">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A rectangular table of any quantities</div>
<div class="description">
<p>By default <tt>table</tt> represents a rectangular table of any quantities
representable as XSD or STMML dataTypes. The default layout is columnwise,
with <tt>columns</tt> columns,
where each column is a (homogeneous) <a href="el.array">array</a> of
size <tt>rows</tt> data. This is the "normal" orientation of data tables
but the table display could be transposed by XSLT transformation if required.
Access is to columns, and thence to the data within them. DataTyping, delimiters,
etc are delegated to the arrays, which must all be of the same size. For
verification it is recommended that every array carries a <tt>size</tt>
attribute.
</p>
</div>
<div class="example">
<pre><table rows="3" columns="2" title="people">
<array title="age" dataType="xsd:integer">3 5 7</array>
<array title="name" dataType="xsd:string">Sue Fred Sandy</array>
</table>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="array" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="rows" type="sizeType" use="required">
<xsd:annotation>
<xsd:documentation>
<div class="description">
<p>Number of rows</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="columns" type="sizeType" use="required">
<xsd:annotation>
<xsd:documentation>
<div class="description">
<p>Number of columns</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="list" id="el.list">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A generic container with no implied semantics</div>
<div class="description">
<p>
A generic container with no implied semantics. It just contains
things and can have attributes which bind conventions to it. It could often
act as the root element in an STM document.</p>
</div>
<div class="example">
<pre>
<list>
<array title="animals">frog bear toad</array>
<scalar title="weight" dataType="xsd:float">3.456</scalar>
</list>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:any minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attributeGroup ref="tit_id_conv_dictGroup"/>
<xsd:attribute name="type" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:annotation>
<xsd:documentation>
<div class="subheading">Data-based simpleTypes</div>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="coordinate2Type" id="st.coordinate2Type">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An x/y coordinate pair</div>
<div class="description">
<p>An x/y coordinate pair consisting of
two real numbers, separated by whitespace or a comma.
In arrays and matrices, it may be useful to set a separate delimiter</p>
</div>
<div class="example">
<pre>
<list>
<array
>1.2,3.4 3.2,4.5 6.7,23.1 </array>
<array delimiter="/"
>/1.2 3.4/3.2 4.5/6.7 23.1/</array>
</list>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\s*([\-]|[+])?\d*\.?\d*(\s+|[,])([\-]|[+])?\d*\.?\d*\s*"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="coordinate3Type" id="st.coordinate3Type">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An x/y/z coordinate triple</div>
<div class="description">
<p>An x/y/z coordinate triple consisting of
three real numbers, separated by whitespace or commas.
In arrays and matrices, it may be useful to set a separate delimiter</p>
</div>
<div class="example">
<pre>
<list>
<array>1.2,3.4,1.2
3.2,4.5,7.3 6.7,23.1,5.6 </array>
<array delimiter="/"
>/1.2 3.4 3.3/3.2 4.5 4.5/6.7 23.1 5.6/</array>
</list>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\s*([\-]|[+])?\d*\.?\d*(\s+|[,])([\-]|[+])?\d*\.?\d*(\s+|[,])([\-]|[+])?\d*\.?\d*\s*"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="dataTypeType" id="st.dataTypeType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>an enumerated type for all builtin allowed dataTypes in STM</p>
</div>
<div class="description">
<p>
<tt>dataTypeType</tt> represents an enumeration of allowed dataTypes
(at present identical with those in XML-Schemas (Part2- datatypes).
This means that implementers should be able to use standard XMLSchema-based
tools for validation without major implementation problems.
</p>
<p>It will often be used an an attribute on
<a href="el.scalar">scalar</a>,
<a href="el.array">array</a> or
<a href="el.matrix">matrix</a>
elements.</p>
</div>
<div class="example">
<pre>
<list xmlns="http://www.xml-cml.org/schema/core">
<scalar dataType="xsd:boolean" title="she loves me">true</scalar>
<scalar dataType="xsd:float" title="x">23.2</scalar>
<scalar dataType="xsd:duration" title="egg timer">PM4</scalar>
<scalar dataType="xsd:dateTime" title="current data and time">2001-02-01:00:30</scalar>
<scalar dataType="xsd:time" title="wake up">06:00</scalar>
<scalar dataType="xsd:date" title="where is it">1752-09-10</scalar>
<scalar dataType="xsd:anyURI" title="CML site">http://www.xml-cml.org/</scalar>
<scalar dataType="xsd:QName" title="CML atom">cml:atom</scalar>
<scalar dataType="xsd:normalizedString" title="song">the mouse ran up the clock</scalar>
<scalar dataType="xsd:language" title="UK English">en-GB</scalar>
<scalar dataType="xsd:Name" title="atom">atom</scalar>
<scalar dataType="xsd:ID" title="XML ID">_123</scalar>
<scalar dataType="xsd:integer" title="the answer">42</scalar>
<scalar dataType="xsd:nonPositiveInteger" title="zero">0</scalar>
</list>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="xsd:string"/>
<xsd:enumeration value="xsd:boolean"/>
<xsd:enumeration value="xsd:float"/>
<xsd:enumeration value="xsd:double"/>
<xsd:enumeration value="xsd:decimal"/>
<xsd:enumeration value="xsd:duration"/>
<xsd:enumeration value="xsd:dateTime"/>
<xsd:enumeration value="xsd:time"/>
<xsd:enumeration value="xsd:date"/>
<xsd:enumeration value="xsd:gYearMonth"/>
<xsd:enumeration value="xsd:gYear"/>
<xsd:enumeration value="xsd:gMonthDay"/>
<xsd:enumeration value="xsd:gDay"/>
<xsd:enumeration value="xsd:gMonth"/>
<xsd:enumeration value="xsd:hexBinary"/>
<xsd:enumeration value="xsd:base64Binary"/>
<xsd:enumeration value="xsd:anyURI"/>
<xsd:enumeration value="xsd:QName"/>
<xsd:enumeration value="xsd:NOTATION"/>
<xsd:enumeration value="xsd:normalizedString"/>
<xsd:enumeration value="xsd:token"/>
<xsd:enumeration value="xsd:language"/>
<xsd:enumeration value="xsd:IDREFS"/>
<xsd:enumeration value="xsd:ENTITIES"/>
<xsd:enumeration value="xsd:NMTOKEN"/>
<xsd:enumeration value="xsd:NMTOKENS"/>
<xsd:enumeration value="xsd:Name"/>
<xsd:enumeration value="xsd:NCName"/>
<xsd:enumeration value="xsd:ID"/>
<xsd:enumeration value="xsd:IDREF"/>
<xsd:enumeration value="xsd:ENTITY"/>
<xsd:enumeration value="xsd:integer"/>
<xsd:enumeration value="xsd:nonPositiveInteger"/>
<xsd:enumeration value="xsd:negativeInteger"/>
<xsd:enumeration value="xsd:long"/>
<xsd:enumeration value="xsd:int"/>
<xsd:enumeration value="xsd:short"/>
<xsd:enumeration value="xsd:byte"/>
<xsd:enumeration value="xsd:nonNegativeInteger"/>
<xsd:enumeration value="xsd:unsignedLong"/>
<xsd:enumeration value="xsd:unsignedInt"/>
<xsd:enumeration value="xsd:unsignedShort"/>
<xsd:enumeration value="xsd:unsignedByte"/>
<xsd:enumeration value="xsd:positiveInteger"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:annotation>
<xsd:documentation>
<div class="summary">Array-based simpleTypes</div>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="sizeType" id="st.sizeType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">The size of an array</div>
<div class="description">
<p>The size of an array. Redundant, but serves as a check
for processing software (useful if delimiters are used)</p>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:positiveInteger"/>
</xsd:simpleType>
<xsd:simpleType name="delimiterType" id="st.delimiterType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A non-whitespace character used in arrays to separate components</div>
<div class="description">
<p>Some STM-ML elements (such as <a href="el.array">array</a>) have
content representing concatenated values. The default separator is
whitespace (which can be normalised) and this should be used whenever
possible. However in some cases the values are empty, or contain whitespace or other
problematic punctuation, and a delimiter is required.</p>
<p>Note that the content string MUST start and end with the delimiter so
there is no ambiguity as to what the components are. Only printable
characters from the ASCII character set should be used, and character
entities should be avoided.</p>
<p>When delimiters are used to separate precise whitespace this should always
consist of spaces and not the other allowed whitespace characters
(newline, tabs, etc.). If the latter are important it is probably best to redesign
the application.</p>
</div>
<div class="example">
<pre>
<array size="4" delimiter="|">|A|B12||D and E|</array>
<em>The values in the array are</em>
"A", "B12", "" (empty string) and "D and E"
<em>note the spaces</em>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="floatArrayType" id="st.floatArrayType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An array of floats</div>
<div class="description">
<p>An array of floats or other real numbers.
Not used in STM Schema, but re-used by CML.
</p>
</div>
<div class="example">
<pre>
<atomArray xmlns="http://www.xml-cml.org/schema/core"
x2="1.2 2.3 3.4 5.6"/>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:list itemType="xsd:decimal"/>
</xsd:simpleType>
<xsd:simpleType name="matrixType" id="st.matrixType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">Allowed <a href="el.matrix">matrix</a> types</div>
<div class="description">
<p>Allowed <tt>matrix</tt> types.
These are mainly square matrices</p>
</div>
<div class="example">
<pre>
<matrix id="m1" title="mattrix-1" dictRef="foo:bar"
rows="3" columns="3" dataType="xsd:decimal"
delimiter="|" matrixType="squareSymmetric" units="unit:m"
>|1.1|1.2|1.3|1.2|2.2|2.3|1.3|2.3|3.3!</matrix>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="rectangular"/>
<xsd:enumeration value="square"/>
<xsd:enumeration value="squareSymmetric"/>
<xsd:enumeration value="squareAntisymmetric"/>
<xsd:enumeration value="diagonal">
<xsd:annotation>
<xsd:documentation>
<div class="description">Symmetric. Elements are zero except on the diagonal</div>
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="upperTriangular">
<xsd:annotation>
<xsd:documentation>
<div class="description">Square. Elements are zero below the diagonal
<pre>
1 2 3 4
0 3 5 6
0 0 4 8
0 0 0 2
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="lowerTriangular">
<xsd:annotation>
<xsd:documentation>
<div class="description">Symmetric. Elements are zero except on the diagonal</div>
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="unitary"/>
<xsd:enumeration value="rowEigenvectors"/>
<xsd:enumeration value="rotation22"/>
<xsd:enumeration value="rotationTranslation32"/>
<xsd:enumeration value="homogeneous33"/>
<xsd:enumeration value="rotation33"/>
<xsd:enumeration value="rotationTranslation43"/>
<xsd:enumeration value="homogeneous44"/>
<xsd:enumeration value="square"/>
<xsd:enumeration value="square"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="namespaceRefType"/>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>
<xsd:simpleType name="countType" id="st.countType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">
<p>A count multiplier for certain elements</p>
</div>
<div class="description">
<p>A count multiplier for certain elements, such as
<tt>action</tt> or <tt>object</tt>.</p>
</div>
<div class="example">
<pre>
<list>
<object title="frog" count="10"/>
<action title="step3" count="3">
<p>Add 10 ml reagent</p>
</action>
</list>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="999999999999"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:annotation>
<xsd:documentation>
<div class="summary">General simpleTypes</div>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="idType" id="st.idType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A unique ID for STM elements</div>
<div class="description">
<p>A unique ID for STM elements. This is not formally
of type ID (an XML NAME which must start with a letter and contain only letters,
digits and <tt>.-_:</tt>). It is recommended that IDs start with a letter,
and contain no punctuation or whitespace. The function <tt>generate-id()</tt>
in XSLT will generate semantically void unique IDs</p>.
<p>It is difficult to ensure uniqueness when documents are merged. We suggest
namespacing IDs, perhaps using the containing elements as the base.
Thus <tt>mol3:a1</tt> could be a useful unique ID.
However this is still experimental.</p>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Za-z0-9_\-]+(:[A-Za-z0-9_\-]+)?"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:attributeGroup name="idGroup" id="attGp.id">
<xsd:attribute name="id" type="idType" id="att.id">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A attribute prividing a unique ID for STM elements</div>
<div class="description">
<p>See <a href="st.idType">idType</a> for full documentation.</p>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:attributeGroup name="titleGroup" id="attGp.title">
<xsd:attribute name="title" type="xsd:string" id="att.title">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An (optional) title on most STM elements. Uncontrolled</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:attributeGroup name="convGroup" id="attGp.conv">
<xsd:attribute name="convention" type="namespaceRefType" default="CML" id="att.convention">
<xsd:annotation>
<xsd:documentation>
<div class="summary">A reference to a convention</div>
<div class="description">
<p>A reference to a convention which is inherited by all the subelements.</p>
<p>It may be useful to create conventions with namespaces,
</p>
<p>this attribute is inherited by its child elements; thus a <tt>molecule</tt>
with a convention sets the default for its bonds and atoms. This can be overwritten
if necessary by an explicit <tt>convention</tt>.</p>
<p>Use of convention will normally require non-STM-ML semantics, and should be used with
caution. We would expect that conventions prefixed with "ISO" would be useful,
such as ISO8601 for dateTimes.</p>
</div>
<div class="example">
<pre>
<bond convention="fooChem" order="-5"
xmlns:fooChem="http://www.fooChem/conventions"/>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:annotation>
<xsd:documentation>
<div class="summary">Numeric types</div>
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="errorBasisType" id="st.errorBasisType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">The basis of an error value</div>
<div class="description">
<p>Errors in values can be of several types and this simpleType
provides a small controlled vocabulary</p>
</div>
<div class="example">
<pre>
<scalar
dataType="xsd:decimal"
errorValue="1.0"
errorBasis="observedStandardDeviation"
title="body weight"
dictRef="zoo:bodywt"
units="units:g">34.3</scalar>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="observedRange"/>
<xsd:enumeration value="observedStandardDeviation"/>
<xsd:enumeration value="observedStandardError"/>
<xsd:enumeration value="estimatedStandardDeviation"/>
<xsd:enumeration value="estimatedStandardError"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="maxType" id="st.maxType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">The maximum INCLUSIVE value of a quantity</div>
<div class="description">
<p>The maximum INCLUSIVE value of a sortable quantity such as
numeric, date or string. It should be ignored for dataTypes such as URL.
The use of <tt>min</tt> and
<tt>max</tt> attributes can be used to give a range for the quantity.
The statistical basis of this range is not defined. The value of <tt>max</tt>
is usually an observed
quantity (or calculated from observations). To restrict a value, the <tt>
maxExclusive</tt> type in a dictionary should be used.</p>
<p>The type of the maximum is the same as the quantity to which it refers - numeric,
date and string are currently allowed</p>
</div>
<div class="example">
<pre><scalar dataType="xsd:float" maxValue="20" minValue="12">15</scalar>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="minType" id="st.minType">
<xsd:annotation>
<xsd:documentation>
<div class="summary">The minimum INCLUSIVE value of a quantity</div>
<div class="description">
<p>The minimum INCLUSIVE value of a sortable quantity such as
numeric, date or string. It should be ignored for dataTypes such as URL.
The use of <tt>min</tt> and
<tt>min</tt> attributes can be used to give a range for the quantity.
The statistical basis of this range is not defined. The value of <tt>min</tt>
is usually an observed
quantity (or calculated from observations). To restrict a value, the <tt>
minExclusive</tt> type in a dictionary should be used.</p>
<p>The type of the minimum is the same as the quantity to which it refers - numeric,
date and string are currently allowed</p>
</div>
<div class="example">
<pre><scalar dataType="xsd:float" maxValue="20" minValue="12">15</scalar>
</pre>
</div>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:annotation>
<xsd:documentation>
<div class="subheading">Links and References</div>
</xsd:documentation>
</xsd:annotation>
<xsd:element name="link" id="el.link">
<xsd:annotation>
<xsd:documentation>
<div class="summary">An internal or external link to STMML or other object(s)</div>
<div class="description">
<p>
<tt>link</tt> is an internal or external link to STMML or other object(s). </p>
<p>
<b>Semantics are similar to XLink, but simpler and only a subset is implemented.</b>
This is intended to make the instances easy to create and read, and software
relatively easy to implement. The architecture is:</p>
<ul>
<li>
<b>A single element (<tt>link</tt>) used for all linking purposes</b>. </li>
<li>
<b>The link types are determined by the <tt>type</tt> attribute and can be:</b>.
<ul>
<li>
<b>locator</b>. This points to a single target and must carry either a <tt>ref</tt> or <tt>href</tt> attribute.
<tt>locator</tt> links are usually children of an extended link.
<li>
<b>arc</b>. This is a 1:1 link with both ends (<tt>from</tt> and <tt>to</tt>) defined.</li>
<li>
<b>extended</b>. This is usually a parent of several locator links and serves
to create a grouping of link ends (i.e. a list of references in documents).</li>
Many-many links can be built up from arcs linking extended elements</li>
</ul>
<p>All links can have optional <tt>role</tt> attributes. The semantics of this are not defined;
you are encouraged to use a URI as described in the XLink specification.</p>
<p>There are two address spaces: </p>
<ul>
<li>The <tt>href</tt> attribute on locators behaves in the same way as <tt>href</tt> in
HTML and is of type <tt>xsd:anyURI</tt>. Its primary use is to use XPointer to reference
elements outside the document.</li>
<li>The <tt>ref</tt> attribute on locators and the <tt>from</tt> and <tt>to</tt>
attributes on <tt>arc</tt>s refer to IDs (<em>without</em> the '#' syntax).</li>
</ul>
<p>Note: several other specific linking mechanisms are defined elsewhere in STM. <a href=" el.relatedEntry">relatedEntry</a> should be used in dictionaries, and <a href="st.dictRef">dictRef</a>
should be used to link to dictionaries. There are no required uses of <tt>link</tt> in STM-ML
but we have used it to map atoms, electrons and bonds in reactions in CML</p>
</li>
</ul>