bio-nexml 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/Gemfile +15 -0
  2. data/Gemfile.lock +24 -0
  3. data/LICENSE.txt +20 -0
  4. data/README.rdoc +47 -0
  5. data/Rakefile +55 -0
  6. data/TODO.txt +6 -0
  7. data/VERSION +1 -0
  8. data/bio-nexml.gemspec +126 -0
  9. data/extconf.rb +2 -0
  10. data/lib/bio-nexml.rb +0 -0
  11. data/lib/bio.rb +321 -0
  12. data/lib/bio/db/nexml.rb +109 -0
  13. data/lib/bio/db/nexml/mapper.rb +113 -0
  14. data/lib/bio/db/nexml/mapper/framework.rb +157 -0
  15. data/lib/bio/db/nexml/mapper/inflection.rb +99 -0
  16. data/lib/bio/db/nexml/mapper/repository.rb +59 -0
  17. data/lib/bio/db/nexml/matrix.rb +1046 -0
  18. data/lib/bio/db/nexml/parser.rb +622 -0
  19. data/lib/bio/db/nexml/schema/README.txt +21 -0
  20. data/lib/bio/db/nexml/schema/abstract.xsd +159 -0
  21. data/lib/bio/db/nexml/schema/characters/README.txt +1 -0
  22. data/lib/bio/db/nexml/schema/characters/abstractcharacters.xsd +361 -0
  23. data/lib/bio/db/nexml/schema/characters/characters.xsd +22 -0
  24. data/lib/bio/db/nexml/schema/characters/continuous.xsd +190 -0
  25. data/lib/bio/db/nexml/schema/characters/dna.xsd +282 -0
  26. data/lib/bio/db/nexml/schema/characters/protein.xsd +280 -0
  27. data/lib/bio/db/nexml/schema/characters/restriction.xsd +239 -0
  28. data/lib/bio/db/nexml/schema/characters/rna.xsd +283 -0
  29. data/lib/bio/db/nexml/schema/characters/standard.xsd +261 -0
  30. data/lib/bio/db/nexml/schema/external/sawsdl.xsd +21 -0
  31. data/lib/bio/db/nexml/schema/external/xhtml-datatypes-1.xsd +177 -0
  32. data/lib/bio/db/nexml/schema/external/xlink.xsd +75 -0
  33. data/lib/bio/db/nexml/schema/external/xml.xsd +145 -0
  34. data/lib/bio/db/nexml/schema/meta/README.txt +2 -0
  35. data/lib/bio/db/nexml/schema/meta/annotations.xsd +100 -0
  36. data/lib/bio/db/nexml/schema/meta/meta.xsd +294 -0
  37. data/lib/bio/db/nexml/schema/nexml.xsd +104 -0
  38. data/lib/bio/db/nexml/schema/taxa/README.txt +2 -0
  39. data/lib/bio/db/nexml/schema/taxa/taxa.xsd +39 -0
  40. data/lib/bio/db/nexml/schema/trees/README.txt +2 -0
  41. data/lib/bio/db/nexml/schema/trees/abstracttrees.xsd +135 -0
  42. data/lib/bio/db/nexml/schema/trees/network.xsd +113 -0
  43. data/lib/bio/db/nexml/schema/trees/tree.xsd +149 -0
  44. data/lib/bio/db/nexml/schema/trees/trees.xsd +36 -0
  45. data/lib/bio/db/nexml/taxa.rb +147 -0
  46. data/lib/bio/db/nexml/trees.rb +663 -0
  47. data/lib/bio/db/nexml/writer.rb +265 -0
  48. data/test/data/nexml/test.xml +69 -0
  49. data/test/test_bio-nexml.rb +17 -0
  50. data/test/unit/bio/db/nexml/tc_factory.rb +119 -0
  51. data/test/unit/bio/db/nexml/tc_mapper.rb +78 -0
  52. data/test/unit/bio/db/nexml/tc_matrix.rb +551 -0
  53. data/test/unit/bio/db/nexml/tc_parser.rb +21 -0
  54. data/test/unit/bio/db/nexml/tc_taxa.rb +118 -0
  55. data/test/unit/bio/db/nexml/tc_trees.rb +370 -0
  56. data/test/unit/bio/db/nexml/tc_writer.rb +633 -0
  57. metadata +253 -0
@@ -0,0 +1,283 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ targetNamespace="http://www.nexml.org/2009"
5
+ xmlns="http://www.nexml.org/2009"
6
+ xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
7
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
8
+ elementFormDefault="qualified">
9
+ <xs:include schemaLocation="abstractcharacters.xsd"/>
10
+
11
+ <!--
12
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace"
13
+ schemaLocation="http://www.w3.org/2001/xml.xsd"/>-->
14
+ <xs:annotation>
15
+ <xs:documentation>
16
+ This module defines concrete subclasses for the
17
+ <a href="../abstract">abstract</a> character matrix components
18
+ that all character matrices must implement. The subclasses
19
+ defined here apply to RNA character data. In a verbose notation,
20
+ this data is represented as the "state" attribute of the &lt;cell&gt;
21
+ element, whose value-space is limited to the IUPAC single character
22
+ nucleotide symbols (except T). In a compact notation, the same data
23
+ is represented as a sequence of tokens (whitespace is allowed but has no meaning).
24
+ </xs:documentation>
25
+ </xs:annotation>
26
+ <xs:simpleType name="RNAToken">
27
+ <xs:annotation>
28
+ <xs:documentation>
29
+ The RNAToken simple type is a restriction of AbstractSymbol that defines
30
+ a token of a IUPAC single character nucleotide token.
31
+ </xs:documentation>
32
+ </xs:annotation>
33
+ <xs:restriction base="AbstractSymbol">
34
+ <xs:pattern value="[\-\?ABCDGHKMNRSUVWXY]"/>
35
+ <xs:length value="1"/>
36
+ </xs:restriction>
37
+ </xs:simpleType>
38
+ <!--
39
+
40
+ The following types would be used if we explicitly defined ambiguity mappings,
41
+ allowed states, etc. But we don't, because we use the IUPAC symbols anyway.
42
+ -->
43
+ <xs:complexType name="RNAMapping">
44
+ <xs:annotation>
45
+ <xs:documentation>
46
+ An IUPAC ambiguity mapping.
47
+ </xs:documentation>
48
+ </xs:annotation>
49
+ <xs:complexContent>
50
+ <xs:restriction base="AbstractMapping" />
51
+ </xs:complexContent>
52
+ </xs:complexType>
53
+
54
+ <xs:complexType name="RNAState">
55
+ <xs:annotation>
56
+ <xs:documentation>
57
+ This is a concrete implementation of the state element, which requires
58
+ a symbol element, in this case restricted to RNAToken, i.e. a single IUPAC nucleotide
59
+ symbol, and optional mapping elements to refer to other states.
60
+ </xs:documentation>
61
+ </xs:annotation>
62
+ <xs:complexContent>
63
+ <xs:restriction base="AbstractState">
64
+ <xs:sequence minOccurs="1" maxOccurs="1"/>
65
+ <xs:attribute name="symbol" type="RNAToken" use="required"></xs:attribute>
66
+ </xs:restriction>
67
+ </xs:complexContent>
68
+ </xs:complexType>
69
+
70
+ <xs:complexType name="RNAUncertainStateSet">
71
+ <xs:annotation>
72
+ <xs:documentation>
73
+ The AbstractState type is the superclass for a state definition.
74
+ The element encloses a required AbstractSymbol element that in restricted concrete
75
+ subclasses must be of a sensible type such as a single IUPAC character. It may
76
+ enclose zero or more AbstractMapping elements to resolve ambiguities.
77
+ </xs:documentation>
78
+ </xs:annotation>
79
+ <xs:complexContent>
80
+ <xs:restriction base="AbstractUncertainStateSet">
81
+ <xs:sequence minOccurs="1" maxOccurs="1">
82
+ <xs:element name="member" type="RNAMapping" minOccurs="0" maxOccurs="unbounded"/>
83
+ </xs:sequence>
84
+ <xs:attribute name="symbol" type="RNAToken" use="required"></xs:attribute>
85
+ </xs:restriction>
86
+ </xs:complexContent>
87
+ </xs:complexType>
88
+
89
+ <xs:complexType name="RNAPolymorphicStateSet">
90
+ <xs:annotation>
91
+ <xs:documentation>
92
+ The AbstractState type is the superclass for a state definition.
93
+ The element encloses a required AbstractSymbol element that in restricted concrete
94
+ subclasses must be of a sensible type such as a single IUPAC character. It may
95
+ enclose zero or more AbstractMapping elements to resolve ambiguities.
96
+ </xs:documentation>
97
+ </xs:annotation>
98
+ <xs:complexContent>
99
+ <xs:restriction base="AbstractPolymorphicStateSet">
100
+ <xs:sequence minOccurs="1" maxOccurs="1">
101
+ <xs:element name="member" type="RNAMapping" minOccurs="0" maxOccurs="unbounded"/>
102
+ <xs:element name="uncertain_state_set" type="RNAUncertainStateSet" minOccurs="0" maxOccurs="unbounded"/>
103
+ </xs:sequence>
104
+ <xs:attribute name="symbol" type="RNAToken" use="required"></xs:attribute>
105
+ </xs:restriction>
106
+ </xs:complexContent>
107
+ </xs:complexType>
108
+
109
+ <xs:complexType name="RNAStates">
110
+ <xs:annotation>
111
+ <xs:documentation>
112
+ A container for a set of states.
113
+ </xs:documentation>
114
+ </xs:annotation>
115
+ <xs:complexContent>
116
+ <xs:restriction base="AbstractStates">
117
+ <xs:sequence minOccurs="1" maxOccurs="1">
118
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
119
+ <xs:element name="state" type="RNAState" minOccurs="0" maxOccurs="unbounded"/>
120
+ <xs:element name="polymorphic_state_set" type="RNAPolymorphicStateSet" minOccurs="0" maxOccurs="unbounded"/>
121
+ <xs:element name="uncertain_state_set" type="RNAUncertainStateSet" minOccurs="0" maxOccurs="unbounded"/>
122
+ </xs:sequence>
123
+ </xs:restriction>
124
+ </xs:complexContent>
125
+ </xs:complexType>
126
+
127
+ <xs:complexType name="RNAChar" sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#RNAResidueCharacter">
128
+ <xs:annotation>
129
+ <xs:documentation>
130
+ A concrete implementation of the AbstractChar element. In this implementation
131
+ there is no reference to explicitly defined states, as we use the IUPAC standard.
132
+ There may be a CodonPosition ("codon") attribute, and there must be an identifier
133
+ ("id") that is of type xs:nonNegativeInteger to define the column number.
134
+ </xs:documentation>
135
+ </xs:annotation>
136
+ <xs:complexContent>
137
+ <xs:restriction base="AbstractChar">
138
+ <xs:sequence minOccurs="1" maxOccurs="1">
139
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
140
+ </xs:sequence>
141
+ <xs:attribute name="tokens" type="MSTokenLength" use="prohibited"/>
142
+ <xs:attribute name="states" type="xs:IDREF" use="required"/>
143
+ <xs:attribute name="codon" type="CodonPosition" use="optional"/>
144
+ <xs:attribute name="id" type="xs:ID" use="required"/>
145
+ </xs:restriction>
146
+ </xs:complexContent>
147
+ </xs:complexType>
148
+
149
+ <xs:complexType name="RNAFormat" abstract="false">
150
+ <xs:annotation>
151
+ <xs:documentation> The RNAFormat class is the container of RNA column definitions.
152
+ </xs:documentation>
153
+ </xs:annotation>
154
+ <xs:complexContent>
155
+ <xs:restriction base="AbstractFormat">
156
+ <xs:sequence minOccurs="1" maxOccurs="1">
157
+ <xs:element name="states" type="RNAStates" minOccurs="1" maxOccurs="unbounded"/>
158
+ <xs:element name="char" type="RNAChar" minOccurs="1" maxOccurs="unbounded"/>
159
+ </xs:sequence>
160
+ </xs:restriction>
161
+ </xs:complexContent>
162
+ </xs:complexType>
163
+
164
+ <xs:complexType name="RNAObs" abstract="false" sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#RNAResidueStateDatum">
165
+ <xs:annotation>
166
+ <xs:documentation> This is a single cell in a matrix containing a nucleotide
167
+ observation. </xs:documentation>
168
+ </xs:annotation>
169
+ <xs:complexContent>
170
+ <xs:restriction base="AbstractObs">
171
+ <xs:sequence minOccurs="1" maxOccurs="1">
172
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
173
+ </xs:sequence>
174
+ <xs:attribute name="char" use="required" type="xs:IDREF"/>
175
+ <xs:attribute name="state" use="required" type="xs:IDREF"/>
176
+ </xs:restriction>
177
+ </xs:complexContent>
178
+ </xs:complexType>
179
+
180
+ <xs:simpleType name="RNASeq">
181
+ <xs:annotation>
182
+ <xs:documentation> This is a simple type that specifies a sequence of RNA characters,
183
+ following IUPAC single character symbols for nucleotides (and ambiguities).
184
+ </xs:documentation>
185
+ </xs:annotation>
186
+ <xs:restriction base="AbstractSeq">
187
+ <xs:pattern value="[\-\?ABCDGHKMNRSUVWXY\s]*"/>
188
+ </xs:restriction>
189
+ </xs:simpleType>
190
+
191
+ <xs:complexType name="RNAMatrixSeqRow" abstract="false">
192
+ <xs:annotation>
193
+ <xs:documentation> This is a row in a matrix of RNA data containing raw sequence data. </xs:documentation>
194
+ </xs:annotation>
195
+ <xs:complexContent>
196
+ <xs:restriction base="AbstractSeqRow">
197
+ <xs:sequence minOccurs="1" maxOccurs="1">
198
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
199
+ <xs:element name="seq" minOccurs="1" maxOccurs="1" type="RNASeq"/>
200
+ </xs:sequence>
201
+ </xs:restriction>
202
+ </xs:complexContent>
203
+ </xs:complexType>
204
+
205
+ <xs:complexType name="RNAMatrixObsRow" abstract="false">
206
+ <xs:annotation>
207
+ <xs:documentation> This is a row in a matrix of RNA data containing granular observations. </xs:documentation>
208
+ </xs:annotation>
209
+ <xs:complexContent>
210
+ <xs:restriction base="AbstractObsRow">
211
+ <xs:sequence minOccurs="1" maxOccurs="1">
212
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
213
+ <xs:element name="cell" minOccurs="1" maxOccurs="unbounded" type="RNAObs"/>
214
+ </xs:sequence>
215
+ </xs:restriction>
216
+ </xs:complexContent>
217
+ </xs:complexType>
218
+
219
+ <xs:complexType name="RNASeqMatrix" abstract="false">
220
+ <xs:annotation>
221
+ <xs:documentation>
222
+ A matrix of rows with seq strings of type RNA.
223
+ </xs:documentation>
224
+ </xs:annotation>
225
+ <xs:complexContent>
226
+ <xs:restriction base="AbstractSeqMatrix">
227
+ <xs:sequence minOccurs="1" maxOccurs="1">
228
+ <xs:element name="row" minOccurs="1" maxOccurs="unbounded" type="RNAMatrixSeqRow"/>
229
+ </xs:sequence>
230
+ </xs:restriction>
231
+ </xs:complexContent>
232
+ </xs:complexType>
233
+
234
+ <xs:complexType name="RNAObsMatrix" abstract="false">
235
+ <xs:annotation>
236
+ <xs:documentation>
237
+ A matrix of rows with single character observations.
238
+ </xs:documentation>
239
+ </xs:annotation>
240
+ <xs:complexContent>
241
+ <xs:restriction base="AbstractObsMatrix">
242
+ <xs:sequence minOccurs="1" maxOccurs="1">
243
+ <xs:element name="row" minOccurs="1" maxOccurs="unbounded" type="RNAMatrixObsRow"/>
244
+ </xs:sequence>
245
+ </xs:restriction>
246
+ </xs:complexContent>
247
+ </xs:complexType>
248
+
249
+ <xs:complexType name="RnaSeqs" abstract="false">
250
+ <xs:annotation>
251
+ <xs:documentation>
252
+ A RNA characters block consisting of sequences preceded by metadata.
253
+ </xs:documentation>
254
+ </xs:annotation>
255
+ <xs:complexContent>
256
+ <xs:restriction base="AbstractSeqs">
257
+ <xs:sequence minOccurs="1" maxOccurs="1">
258
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
259
+ <xs:element name="format" minOccurs="1" maxOccurs="1" type="RNAFormat"/>
260
+ <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="RNASeqMatrix"/>
261
+ </xs:sequence>
262
+ </xs:restriction>
263
+ </xs:complexContent>
264
+ </xs:complexType>
265
+
266
+ <xs:complexType name="RnaCells" abstract="false">
267
+ <xs:annotation>
268
+ <xs:documentation>
269
+ A RNA characters block consisting of granular cells preceded by metadata.
270
+ </xs:documentation>
271
+ </xs:annotation>
272
+ <xs:complexContent>
273
+ <xs:restriction base="AbstractCells">
274
+ <xs:sequence minOccurs="1" maxOccurs="1">
275
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
276
+ <xs:element name="format" minOccurs="0" maxOccurs="1" type="RNAFormat"/>
277
+ <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="RNAObsMatrix"/>
278
+ </xs:sequence>
279
+ </xs:restriction>
280
+ </xs:complexContent>
281
+ </xs:complexType>
282
+
283
+ </xs:schema>
@@ -0,0 +1,261 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ targetNamespace="http://www.nexml.org/2009"
5
+ xmlns="http://www.nexml.org/2009"
6
+ xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
7
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
8
+ elementFormDefault="qualified">
9
+ <xs:include schemaLocation="abstractcharacters.xsd"/>
10
+
11
+ <xs:annotation>
12
+ <xs:documentation>
13
+ This module defines concrete subclasses for the
14
+ <a href="../abstract">abstract</a> character matrix components
15
+ that all character matrices must implement. The subclasses
16
+ defined here apply to "standard" categorical character data, such as
17
+ counts of morpholical features. In a verbose notation, this data
18
+ is represented as the "state" attribute of the &lt;cell&gt;
19
+ element. In a compact notation, the same data is represented as
20
+ a sequence of space-separated integers.
21
+ </xs:documentation>
22
+ </xs:annotation>
23
+
24
+ <xs:simpleType name="StandardToken">
25
+ <xs:restriction base="xs:integer"/>
26
+ </xs:simpleType>
27
+
28
+ <xs:complexType name="StandardMapping">
29
+ <xs:annotation>
30
+ <xs:documentation>A standard character ambiguity mapping.</xs:documentation>
31
+ </xs:annotation>
32
+ <xs:complexContent>
33
+ <xs:restriction base="AbstractMapping"/>
34
+ </xs:complexContent>
35
+ </xs:complexType>
36
+
37
+ <xs:complexType name="StandardState">
38
+ <xs:annotation>
39
+ <xs:documentation> This is a concrete implementation of the state element, which requires
40
+ a symbol element, in this case restricted to integers, and optional mapping
41
+ elements to refer to other states. </xs:documentation>
42
+ </xs:annotation>
43
+ <xs:complexContent>
44
+ <xs:restriction base="AbstractState">
45
+ <xs:sequence minOccurs="1" maxOccurs="1">
46
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
47
+ </xs:sequence>
48
+ <xs:attribute name="symbol" type="StandardToken" use="required"/>
49
+ </xs:restriction>
50
+ </xs:complexContent>
51
+ </xs:complexType>
52
+
53
+ <xs:complexType name="StandardUncertainStateSet">
54
+ <xs:annotation>
55
+ <xs:documentation>
56
+ The AbstractState type is the superclass for a state definition.
57
+ The element encloses a required AbstractSymbol element that in restricted concrete
58
+ subclasses must be of a sensible type such as a single IUPAC character. It may
59
+ enclose zero or more AbstractMapping elements to resolve ambiguities.
60
+ </xs:documentation>
61
+ </xs:annotation>
62
+ <xs:complexContent>
63
+ <xs:restriction base="AbstractUncertainStateSet">
64
+ <xs:sequence minOccurs="1" maxOccurs="1">
65
+ <xs:element name="member" type="StandardMapping" minOccurs="0" maxOccurs="unbounded"/>
66
+ </xs:sequence>
67
+ <xs:attribute name="symbol" type="xs:string" use="required"/>
68
+ </xs:restriction>
69
+ </xs:complexContent>
70
+ </xs:complexType>
71
+
72
+ <xs:complexType name="StandardPolymorphicStateSet">
73
+ <xs:annotation>
74
+ <xs:documentation>
75
+ The AbstractState type is the superclass for a state definition.
76
+ The element encloses a required AbstractSymbol element that in restricted concrete
77
+ subclasses must be of a sensible type such as a single IUPAC character. It may
78
+ enclose zero or more AbstractMapping elements to resolve ambiguities.
79
+ </xs:documentation>
80
+ </xs:annotation>
81
+ <xs:complexContent>
82
+ <xs:restriction base="AbstractPolymorphicStateSet">
83
+ <xs:sequence minOccurs="1" maxOccurs="1">
84
+ <xs:element name="member" type="StandardMapping" minOccurs="0" maxOccurs="unbounded"/>
85
+ <xs:element name="uncertain_state_set" type="StandardUncertainStateSet" minOccurs="0" maxOccurs="unbounded"/>
86
+ </xs:sequence>
87
+ </xs:restriction>
88
+ </xs:complexContent>
89
+ </xs:complexType>
90
+
91
+
92
+ <xs:complexType name="StandardStates">
93
+ <xs:annotation>
94
+ <xs:documentation>
95
+ A container for a set of states.
96
+ </xs:documentation>
97
+ </xs:annotation>
98
+ <xs:complexContent>
99
+ <xs:restriction base="AbstractStates">
100
+ <xs:sequence minOccurs="1" maxOccurs="1">
101
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
102
+ <xs:element name="state" type="StandardState" minOccurs="0" maxOccurs="unbounded"/>
103
+ <xs:element name="polymorphic_state_set" type="StandardPolymorphicStateSet" minOccurs="0" maxOccurs="unbounded"/>
104
+ <xs:element name="uncertain_state_set" type="StandardUncertainStateSet" minOccurs="0" maxOccurs="unbounded"/>
105
+ </xs:sequence>
106
+ </xs:restriction>
107
+ </xs:complexContent>
108
+ </xs:complexType>
109
+
110
+ <xs:complexType name="StandardChar" sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#StandardCharacter">
111
+ <xs:annotation>
112
+ <xs:documentation> A concrete implementation of the char element, which requires
113
+ a states attribute to refer to a set of defined states </xs:documentation>
114
+ </xs:annotation>
115
+ <xs:complexContent>
116
+ <xs:restriction base="AbstractChar">
117
+ <xs:sequence minOccurs="1" maxOccurs="1">
118
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
119
+ </xs:sequence>
120
+ <xs:attribute name="tokens" type="MSTokenLength" use="prohibited"/>
121
+ <xs:attribute name="states" type="xs:IDREF" use="required"/>
122
+ <xs:attribute name="codon" type="CodonPosition" use="prohibited"/>
123
+ <xs:attribute name="id" type="xs:ID" use="required"/>
124
+ </xs:restriction>
125
+ </xs:complexContent>
126
+ </xs:complexType>
127
+
128
+ <xs:complexType name="StandardFormat" abstract="false">
129
+ <xs:annotation>
130
+ <xs:documentation> The StandardFormat class is the container of standard column definitions.
131
+ </xs:documentation>
132
+ </xs:annotation>
133
+ <xs:complexContent>
134
+ <xs:restriction base="AbstractFormat">
135
+ <xs:sequence minOccurs="1" maxOccurs="1">
136
+ <xs:element name="states" type="StandardStates" minOccurs="1" maxOccurs="unbounded"/>
137
+ <xs:element name="char" type="StandardChar" minOccurs="1" maxOccurs="unbounded"/>
138
+ </xs:sequence>
139
+ </xs:restriction>
140
+ </xs:complexContent>
141
+ </xs:complexType>
142
+
143
+ <xs:complexType name="StandardObs" abstract="false" sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#StandardStateDatum">
144
+ <xs:annotation>
145
+ <xs:documentation> This is a single cell in a matrix containing a standard
146
+ observation. </xs:documentation>
147
+ </xs:annotation>
148
+ <xs:complexContent>
149
+ <xs:restriction base="AbstractObs">
150
+ <xs:sequence minOccurs="1" maxOccurs="1">
151
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
152
+ </xs:sequence>
153
+ <xs:attribute name="char" use="required" type="xs:IDREF"/>
154
+ <xs:attribute name="state" use="required" type="xs:IDREF"/>
155
+ </xs:restriction>
156
+ </xs:complexContent>
157
+ </xs:complexType>
158
+
159
+ <xs:simpleType name="StandardSeq">
160
+ <xs:annotation>
161
+ <xs:documentation> This is a simple type that specifies a sequence of standard characters.
162
+ </xs:documentation>
163
+ </xs:annotation>
164
+ <xs:restriction base="AbstractTokenList">
165
+ <xs:pattern value="[0-9\-\?]+(\s[0-9\-\?]+)*"></xs:pattern>
166
+ </xs:restriction>
167
+ </xs:simpleType>
168
+
169
+ <xs:complexType name="StandardMatrixSeqRow" abstract="false">
170
+ <xs:annotation>
171
+ <xs:documentation> This is a row in a matrix of standard data as character sequences. </xs:documentation>
172
+ </xs:annotation>
173
+ <xs:complexContent>
174
+ <xs:restriction base="AbstractSeqRow">
175
+ <xs:sequence minOccurs="1" maxOccurs="1">
176
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
177
+ <xs:element name="seq" minOccurs="1" maxOccurs="1" type="StandardSeq"/>
178
+ </xs:sequence>
179
+ </xs:restriction>
180
+ </xs:complexContent>
181
+ </xs:complexType>
182
+
183
+ <xs:complexType name="StandardMatrixObsRow" abstract="false">
184
+ <xs:annotation>
185
+ <xs:documentation> This is a row in a matrix of standard data as granular obervations. </xs:documentation>
186
+ </xs:annotation>
187
+ <xs:complexContent>
188
+ <xs:restriction base="AbstractObsRow">
189
+ <xs:sequence minOccurs="1" maxOccurs="1">
190
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
191
+ <xs:element name="cell" minOccurs="1" maxOccurs="unbounded" type="StandardObs"/>
192
+ </xs:sequence>
193
+ </xs:restriction>
194
+ </xs:complexContent>
195
+ </xs:complexType>
196
+
197
+ <xs:complexType name="StandardSeqMatrix" abstract="false">
198
+ <xs:annotation>
199
+ <xs:documentation>
200
+ A matrix of rows with seq strings of type standard.
201
+ </xs:documentation>
202
+ </xs:annotation>
203
+ <xs:complexContent>
204
+ <xs:restriction base="AbstractSeqMatrix">
205
+ <xs:sequence minOccurs="1" maxOccurs="1">
206
+ <xs:element name="row" minOccurs="1" maxOccurs="unbounded" type="StandardMatrixSeqRow"/>
207
+ </xs:sequence>
208
+ </xs:restriction>
209
+ </xs:complexContent>
210
+ </xs:complexType>
211
+
212
+ <xs:complexType name="StandardObsMatrix" abstract="false">
213
+ <xs:annotation>
214
+ <xs:documentation>
215
+ A matrix of rows with single character observations.
216
+ </xs:documentation>
217
+ </xs:annotation>
218
+ <xs:complexContent>
219
+ <xs:restriction base="AbstractObsMatrix">
220
+ <xs:sequence minOccurs="1" maxOccurs="1">
221
+ <xs:element name="row" minOccurs="1" maxOccurs="unbounded" type="StandardMatrixObsRow"/>
222
+ </xs:sequence>
223
+ </xs:restriction>
224
+ </xs:complexContent>
225
+ </xs:complexType>
226
+
227
+ <xs:complexType name="StandardSeqs" abstract="false">
228
+ <xs:annotation>
229
+ <xs:documentation>
230
+ A standard characters block consisting of sequences preceded by metadata.
231
+ </xs:documentation>
232
+ </xs:annotation>
233
+ <xs:complexContent>
234
+ <xs:restriction base="AbstractSeqs">
235
+ <xs:sequence minOccurs="1" maxOccurs="1">
236
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
237
+ <xs:element name="format" minOccurs="1" maxOccurs="1" type="StandardFormat"/>
238
+ <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="StandardSeqMatrix"/>
239
+ </xs:sequence>
240
+ </xs:restriction>
241
+ </xs:complexContent>
242
+ </xs:complexType>
243
+
244
+ <xs:complexType name="StandardCells" abstract="false">
245
+ <xs:annotation>
246
+ <xs:documentation>
247
+ A standard characters block consisting of granular cells preceded by metadata.
248
+ </xs:documentation>
249
+ </xs:annotation>
250
+ <xs:complexContent>
251
+ <xs:restriction base="AbstractCells">
252
+ <xs:sequence minOccurs="1" maxOccurs="1">
253
+ <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
254
+ <xs:element name="format" minOccurs="1" maxOccurs="1" type="StandardFormat"/>
255
+ <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="StandardObsMatrix"/>
256
+ </xs:sequence>
257
+ </xs:restriction>
258
+ </xs:complexContent>
259
+ </xs:complexType>
260
+
261
+ </xs:schema>