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,294 @@
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
+ elementFormDefault="qualified">
7
+ <xs:annotation>
8
+ <xs:documentation>
9
+ This module defines subclasses of the dictionaries
10
+ defined in the <a href="../annotations">annotations</a>
11
+ module. The subclasses are used to attach metadata about
12
+ revision control status of a file (the RCS* types),
13
+ <a href="http://dublincore.org/">dublin core</a> metadata
14
+ and common web formats (XHTML, RSS).
15
+ </xs:documentation>
16
+ </xs:annotation>
17
+ <xs:include schemaLocation="annotations.xsd"/>
18
+
19
+ <!-- a simple key/value pair, where key
20
+ *must* be <key>date</key>, and value
21
+ must be of the pattern
22
+ <string>$Date: [svn date here]$</string> -->
23
+ <xs:simpleType name="DateKey">
24
+ <xs:restriction base="xs:string">
25
+ <xs:pattern value="date"/>
26
+ </xs:restriction>
27
+ </xs:simpleType>
28
+ <xs:simpleType name="DateVal">
29
+ <xs:restriction base="xs:string">
30
+ <xs:pattern value="$Date: .*$"/>
31
+ </xs:restriction>
32
+ </xs:simpleType>
33
+ <!--xs:complexType name="RCSDate">
34
+ <xs:annotation>
35
+ <xs:documentation>
36
+ a simple key/value pair, where key
37
+ <em>must</em> be /^date$/, and value
38
+ must be of the pattern
39
+ /^$Date: .*\$$/
40
+ </xs:documentation>
41
+ </xs:annotation>
42
+ <xs:complexContent>
43
+ <xs:restriction base="Dict">
44
+ <xs:sequence minOccurs="1" maxOccurs="1">
45
+ <xs:element name="key" type="DateKey" minOccurs="1" maxOccurs="1"/>
46
+ <xs:element name="string" type="DateVal" minOccurs="1" maxOccurs="1"/>
47
+ </xs:sequence>
48
+ </xs:restriction>
49
+ </xs:complexContent>
50
+ </xs:complexType-->
51
+
52
+ <!-- same thing for svn $Rev: $ -->
53
+ <xs:simpleType name="RevKey">
54
+ <xs:restriction base="xs:string">
55
+ <xs:pattern value="rev"/>
56
+ </xs:restriction>
57
+ </xs:simpleType>
58
+ <xs:simpleType name="RevVal">
59
+ <xs:restriction base="xs:string">
60
+ <xs:pattern value="$Rev: .*$"/>
61
+ </xs:restriction>
62
+ </xs:simpleType>
63
+ <!--xs:complexType name="RCSRev">
64
+ <xs:annotation>
65
+ <xs:documentation>
66
+ a simple key/value pair, where key
67
+ <em>must</em> be /^rev$/, and value
68
+ must be of the pattern
69
+ /^$Rev: .*\$$/
70
+ </xs:documentation>
71
+ </xs:annotation>
72
+ <xs:complexContent>
73
+ <xs:restriction base="Dict">
74
+ <xs:sequence minOccurs="1" maxOccurs="1">
75
+ <xs:element name="key" type="RevKey" minOccurs="1" maxOccurs="1"/>
76
+ <xs:element name="string" type="RevVal" minOccurs="1" maxOccurs="1"/>
77
+ </xs:sequence>
78
+ </xs:restriction>
79
+ </xs:complexContent>
80
+ </xs:complexType-->
81
+
82
+ <!-- same thing for svn $Author: $ -->
83
+ <xs:simpleType name="AuthorKey">
84
+ <xs:restriction base="xs:string">
85
+ <xs:pattern value="author"/>
86
+ </xs:restriction>
87
+ </xs:simpleType>
88
+ <xs:simpleType name="AuthorVal">
89
+ <xs:restriction base="xs:string">
90
+ <xs:pattern value="$Author: .*$"/>
91
+ </xs:restriction>
92
+ </xs:simpleType>
93
+ <!--xs:complexType name="RCSAuthor">
94
+ <xs:annotation>
95
+ <xs:documentation>
96
+ a simple key/value pair, where key
97
+ <em>must</em> be /^author$/, and value
98
+ must be of the pattern
99
+ /^$Author: .*\$$/
100
+ </xs:documentation>
101
+ </xs:annotation>
102
+ <xs:complexContent>
103
+ <xs:restriction base="Dict">
104
+ <xs:sequence minOccurs="1" maxOccurs="1">
105
+ <xs:element name="key" type="AuthorKey" minOccurs="1" maxOccurs="1"/>
106
+ <xs:element name="string" type="AuthorVal" minOccurs="1" maxOccurs="1"/>
107
+ </xs:sequence>
108
+ </xs:restriction>
109
+ </xs:complexContent>
110
+ </xs:complexType-->
111
+
112
+ <!-- same thing for svn $URL: $ -->
113
+ <xs:simpleType name="URLKey">
114
+ <xs:restriction base="xs:string">
115
+ <xs:pattern value="url"/>
116
+ </xs:restriction>
117
+ </xs:simpleType>
118
+ <xs:simpleType name="URLVal">
119
+ <xs:restriction base="xs:string">
120
+ <xs:pattern value="$URL: .*$"/>
121
+ </xs:restriction>
122
+ </xs:simpleType>
123
+ <!--xs:complexType name="RCSURL">
124
+ <xs:annotation>
125
+ <xs:documentation>
126
+ a simple key/value pair, where key
127
+ <em>must</em> be /^url$/, and value
128
+ must be of the pattern
129
+ /^$URL: .*\$$/
130
+ </xs:documentation>
131
+ </xs:annotation>
132
+ <xs:complexContent>
133
+ <xs:restriction base="Dict">
134
+ <xs:sequence minOccurs="1" maxOccurs="1">
135
+ <xs:element name="key" type="URLKey" minOccurs="1" maxOccurs="1"/>
136
+ <xs:element name="string" type="URLVal" minOccurs="1" maxOccurs="1"/>
137
+ </xs:sequence>
138
+ </xs:restriction>
139
+ </xs:complexContent>
140
+ </xs:complexType-->
141
+
142
+ <!-- same thing for svn $Id: $ -->
143
+ <xs:simpleType name="IdKey">
144
+ <xs:restriction base="xs:string">
145
+ <xs:pattern value="id"/>
146
+ </xs:restriction>
147
+ </xs:simpleType>
148
+ <xs:simpleType name="IdVal">
149
+ <xs:restriction base="xs:string">
150
+ <xs:pattern value="$Id: .*$"/>
151
+ </xs:restriction>
152
+ </xs:simpleType>
153
+ <!--xs:complexType name="RCSId">
154
+ <xs:annotation>
155
+ <xs:documentation>
156
+ a simple key/value pair, where key
157
+ <em>must</em> be /^id$/, and value
158
+ must be of the pattern
159
+ /^$Id: .*\$$/
160
+ </xs:documentation>
161
+ </xs:annotation>
162
+ <xs:complexContent>
163
+ <xs:restriction base="Dict">
164
+ <xs:sequence minOccurs="1" maxOccurs="1">
165
+ <xs:element name="key" type="IdKey" minOccurs="1" maxOccurs="1"/>
166
+ <xs:element name="string" type="IdVal" minOccurs="1" maxOccurs="1"/>
167
+ </xs:sequence>
168
+ </xs:restriction>
169
+ </xs:complexContent>
170
+ </xs:complexType-->
171
+
172
+ <!-- same thing for svn $Header: $ -->
173
+ <xs:simpleType name="HeaderKey">
174
+ <xs:restriction base="xs:string">
175
+ <xs:pattern value="header"/>
176
+ </xs:restriction>
177
+ </xs:simpleType>
178
+ <xs:simpleType name="HeaderVal">
179
+ <xs:restriction base="xs:string">
180
+ <xs:pattern value="$Header: .*$"/>
181
+ </xs:restriction>
182
+ </xs:simpleType>
183
+ <!--xs:complexType name="RCSHeader">
184
+ <xs:annotation>
185
+ <xs:documentation>
186
+ a simple key/value pair, where key
187
+ <em>must</em> be /^header$/, and value
188
+ must be of the pattern
189
+ /^$Header: .*\$$/
190
+ </xs:documentation>
191
+ </xs:annotation>
192
+ <xs:complexContent>
193
+ <xs:restriction base="Dict">
194
+ <xs:sequence minOccurs="1" maxOccurs="1">
195
+ <xs:element name="key" type="HeaderKey" minOccurs="1" maxOccurs="1"/>
196
+ <xs:element name="string" type="HeaderVal" minOccurs="1" maxOccurs="1"/>
197
+ </xs:sequence>
198
+ </xs:restriction>
199
+ </xs:complexContent>
200
+ </xs:complexType-->
201
+
202
+ <!-- this is just syntax sugar to indicate that
203
+ the elements within the <any> tag are
204
+ Dublin Core metadata -->
205
+ <xs:simpleType name="DCKey">
206
+ <xs:restriction base="xs:string">
207
+ <xs:pattern value="dublincore"/>
208
+ </xs:restriction>
209
+ </xs:simpleType>
210
+ <xs:complexType name="DCAny">
211
+ <xs:complexContent>
212
+ <xs:extension base="Base">
213
+ <xs:sequence>
214
+ <xs:any
215
+ namespace="http://purl.org/dc/elements/1.1/ http://purl.org/dc/terms/ http://www.w3.org/1999/02/22-rdf-syntax-ns#"
216
+ processContents="lax"
217
+ minOccurs="0"
218
+ maxOccurs="unbounded"/>
219
+ </xs:sequence>
220
+ </xs:extension>
221
+ </xs:complexContent>
222
+ </xs:complexType>
223
+ <!--xs:complexType name="DC">
224
+ <xs:complexContent>
225
+ <xs:restriction base="Dict">
226
+ <xs:sequence minOccurs="1" maxOccurs="1">
227
+ <xs:element name="key" type="DCKey" minOccurs="1" maxOccurs="1"/>
228
+ <xs:element name="any" type="DCAny" minOccurs="1" maxOccurs="1"/>
229
+ </xs:sequence>
230
+ </xs:restriction>
231
+ </xs:complexContent>
232
+ </xs:complexType-->
233
+
234
+ <!-- this is a wrapper around XHTML -->
235
+ <xs:simpleType name="XHTMLKey">
236
+ <xs:restriction base="xs:string">
237
+ <xs:pattern value="xhtml"/>
238
+ </xs:restriction>
239
+ </xs:simpleType>
240
+ <xs:complexType name="XHTMLAny">
241
+ <xs:complexContent>
242
+ <xs:extension base="Base">
243
+ <xs:sequence>
244
+ <xs:any
245
+ namespace="http://www.w3.org/1999/xhtml"
246
+ processContents="lax"
247
+ minOccurs="0"
248
+ maxOccurs="unbounded"/>
249
+ </xs:sequence>
250
+ </xs:extension>
251
+ </xs:complexContent>
252
+ </xs:complexType>
253
+ <!--xs:complexType name="XHTML">
254
+ <xs:complexContent>
255
+ <xs:restriction base="Dict">
256
+ <xs:sequence minOccurs="1" maxOccurs="1">
257
+ <xs:element name="key" type="XHTMLKey" minOccurs="1" maxOccurs="1"/>
258
+ <xs:element name="any" type="XHTMLAny"/>
259
+ </xs:sequence>
260
+ </xs:restriction>
261
+ </xs:complexContent>
262
+ </xs:complexType-->
263
+
264
+ <!-- this is a wrapper around RSS -->
265
+ <xs:simpleType name="RSSKey">
266
+ <xs:restriction base="xs:string">
267
+ <xs:pattern value="rss"/>
268
+ </xs:restriction>
269
+ </xs:simpleType>
270
+ <xs:complexType name="RSSAny">
271
+ <xs:complexContent>
272
+ <xs:extension base="Base">
273
+ <xs:sequence>
274
+ <xs:any
275
+ namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
276
+ processContents="lax"
277
+ minOccurs="0"
278
+ maxOccurs="unbounded"/>
279
+ </xs:sequence>
280
+ </xs:extension>
281
+ </xs:complexContent>
282
+ </xs:complexType>
283
+ <!--xs:complexType name="RSS">
284
+ <xs:complexContent>
285
+ <xs:restriction base="Dict">
286
+ <xs:sequence minOccurs="1" maxOccurs="1">
287
+ <xs:element name="key" type="RSSKey" minOccurs="1" maxOccurs="1"/>
288
+ <xs:element name="any" type="RSSAny" form="unqualified"/>
289
+ </xs:sequence>
290
+ </xs:restriction>
291
+ </xs:complexContent>
292
+ </xs:complexType-->
293
+
294
+ </xs:schema>
@@ -0,0 +1,104 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns="http://www.nexml.org/2009" xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ targetNamespace="http://www.nexml.org/2009" elementFormDefault="qualified">
4
+ <xs:annotation>
5
+ <xs:documentation>
6
+ This module constitutes in effect the 'main' class of the nexml schema.
7
+ It defines the complex type for the root &lt;<a href="#Nexml">nex:nexml</a>&gt;
8
+ element and a simple type for the schema <a href="#Nexml1_0">"version" attribute</a>
9
+ of the root element. In addition, this module includes the main schema modules for
10
+ <a href="../taxa/taxa">OTUs</a>, <a href="../characters/characters">characters</a>,
11
+ <a href="../trees/trees">trees</a> and <a href="../meta/meta">metadata</a>. The data
12
+ type definitions in these included schema modules are then used to define element
13
+ instances in the child substructures of the &lt;nex:nexml&gt; root element.
14
+
15
+ $Id: $
16
+ </xs:documentation>
17
+ </xs:annotation>
18
+
19
+ <xs:include schemaLocation="taxa/taxa.xsd"/>
20
+ <xs:include schemaLocation="characters/characters.xsd"/>
21
+ <xs:include schemaLocation="trees/trees.xsd"/>
22
+ <xs:include schemaLocation="meta/annotations.xsd"/>
23
+ <!-- xs:include schemaLocation="meta/meta.xsd"/-->
24
+ <!--<xs:include schemaLocation="models/models.xsd"/>-->
25
+
26
+ <xs:simpleType name="Nexml1_0">
27
+ <xs:annotation>
28
+ <xs:documentation>
29
+ This simple type is the fixed version value, which in this
30
+ iteration must be constrained to 0.9 (and will be incremented
31
+ in future versions).
32
+ </xs:documentation>
33
+ </xs:annotation>
34
+ <xs:restriction base="xs:decimal">
35
+ <xs:pattern value="0\.9"/>
36
+ </xs:restriction>
37
+ </xs:simpleType>
38
+
39
+ <xs:complexType name="Nexml" mixed="true">
40
+ <xs:annotation>
41
+ <xs:documentation>
42
+ The root element for nexml.
43
+ </xs:documentation>
44
+ </xs:annotation>
45
+ <xs:complexContent mixed="true">
46
+ <xs:extension base="Annotated">
47
+ <xs:sequence maxOccurs="unbounded" minOccurs="0">
48
+ <xs:element maxOccurs="unbounded" minOccurs="1" name="otus" type="Taxa"/>
49
+ <xs:sequence maxOccurs="unbounded" minOccurs="0">
50
+ <xs:choice>
51
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="characters" type="AbstractBlock"/>
52
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="trees" type="Trees">
53
+ <xs:key name="tree">
54
+ <xs:selector xpath="./tree"/>
55
+ <xs:field xpath="@id"/>
56
+ </xs:key>
57
+ </xs:element>
58
+ </xs:choice>
59
+ </xs:sequence>
60
+ </xs:sequence>
61
+ <xs:attribute name="version" type="Nexml1_0" use="required"/>
62
+ <xs:attribute name="generator" type="xs:string" use="optional"/>
63
+ </xs:extension>
64
+ </xs:complexContent>
65
+ </xs:complexType>
66
+
67
+ <!-- the root of the document -->
68
+ <xs:element name="nexml" type="Nexml">
69
+
70
+ <!-- keys for child-of-root biodata containers: taxa, characters trees -->
71
+ <xs:key name="taxa">
72
+ <xs:selector xpath="./taxa"/>
73
+ <xs:field xpath="@id"/>
74
+ </xs:key>
75
+ <xs:key name="characters">
76
+ <xs:selector xpath="./characters"/>
77
+ <xs:field xpath="@id"/>
78
+ </xs:key>
79
+ <xs:key name="trees">
80
+ <xs:selector xpath="./trees"/>
81
+ <xs:field xpath="@id"/>
82
+ </xs:key>
83
+
84
+ <xs:key name="taxon">
85
+ <xs:selector xpath="./taxa/taxon"/>
86
+ <xs:field xpath="@id"/>
87
+ </xs:key>
88
+
89
+ <!-- links to taxon objects: from row to taxon, from node to taxon -->
90
+ <xs:keyref name="rowTaxonRef" refer="taxon">
91
+ <xs:selector xpath="./characters/matrix/row"/>
92
+ <xs:field xpath="@taxon"/>
93
+ </xs:keyref>
94
+ <xs:keyref name="listNodeTaxonRef" refer="taxon">
95
+ <xs:selector xpath="./trees/tree/terminal"/>
96
+ <xs:field xpath="@taxon"/>
97
+ </xs:keyref>
98
+ <xs:keyref name="nestedNodeTaxonRef" refer="taxon">
99
+ <xs:selector xpath="./trees/tree/root/internal/*/terminal"/>
100
+ <xs:field xpath="@taxon"/>
101
+ </xs:keyref>
102
+
103
+ </xs:element>
104
+ </xs:schema>
@@ -0,0 +1,2 @@
1
+ This directory contains schema fragments to represent operational
2
+ taxonomic units (OTUs, or taxa according to the NEXUS format).
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.nexml.org/2009"
3
+ xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns="http://www.nexml.org/2009"
4
+ elementFormDefault="qualified">
5
+ <xs:annotation>
6
+ <xs:documentation>
7
+ This module defines complex types for <a href="#Taxon">OTU</a>
8
+ objects and their <a href="#Taxa">container objects</a>. These
9
+ types are analogous to the "taxa" block in NEXUS files. They
10
+ are used in the nexml schema, and in instance documents, to
11
+ normalize the cardinality between nodes in trees and rows in
12
+ matrices.
13
+ </xs:documentation>
14
+ </xs:annotation>
15
+ <xs:include schemaLocation="../abstract.xsd"/>
16
+ <!--
17
+ The following type definitions build up a taxa block
18
+ -->
19
+
20
+ <!-- Otu data type -->
21
+ <xs:complexType name="Taxon"
22
+ sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#TU">
23
+ <xs:complexContent>
24
+ <xs:extension base="IDTagged"/>
25
+ </xs:complexContent>
26
+ </xs:complexType>
27
+
28
+ <!-- Otus data type -->
29
+ <xs:complexType name="Taxa">
30
+ <xs:complexContent mixed="true">
31
+ <xs:extension base="IDTagged">
32
+ <xs:sequence>
33
+ <xs:element name="otu" type="Taxon" minOccurs="0" maxOccurs="unbounded"/>
34
+ </xs:sequence>
35
+ </xs:extension>
36
+ </xs:complexContent>
37
+ </xs:complexType>
38
+
39
+ </xs:schema>
@@ -0,0 +1,2 @@
1
+ This directory contains schema fragments for trees and networks of
2
+ various types.
@@ -0,0 +1,135 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
3
+ targetNamespace="http://www.nexml.org/2009" xmlns="http://www.nexml.org/2009"
4
+ elementFormDefault="qualified">
5
+ <xs:annotation>
6
+ <xs:documentation>
7
+ This module defines abstract superclasses for tree components.
8
+ Nexml defines trees as a sequence of nodes, zero or one root edge
9
+ and a sequence of edges. There are different concrete instances
10
+ of edges, namely those with lengths formatted as integers, and
11
+ lengths formatted as floating point numbers.
12
+ <br/><br/>
13
+ In addition, there are different types of trees: those where nodes
14
+ have an in-degree of 1 - true trees - and those with in-degree that
15
+ can exceed 1 - networks.
16
+ </xs:documentation>
17
+ </xs:annotation>
18
+
19
+ <xs:include schemaLocation="../abstract.xsd"/>
20
+
21
+ <xs:complexType name="AbstractNode" abstract="true"
22
+ sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#Node">
23
+ <xs:annotation>
24
+ <xs:documentation>
25
+ The AbstractNode superclass is what concrete nodes inherit
26
+ from by restriction. It represents a node element much like
27
+ that of GraphML, i.e. an element that is connected into a
28
+ tree by edge elements.
29
+ </xs:documentation>
30
+ </xs:annotation>
31
+ <xs:complexContent>
32
+ <xs:extension base="OptionalTaxonLinked">
33
+ <xs:attribute name="root" type="xs:boolean" default="false" use="optional"/>
34
+ </xs:extension>
35
+ </xs:complexContent>
36
+ </xs:complexType>
37
+
38
+ <xs:complexType name="AbstractEdge" abstract="true"
39
+ sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#Edge">
40
+ <xs:annotation>
41
+ <xs:documentation>
42
+ The AbstractEdge superclass is what concrete edges inherit
43
+ from by restriction. It represents an edge element much like
44
+ that of GraphML, i.e. an element that connects node elements.
45
+ </xs:documentation>
46
+ <xs:appinfo>Edge</xs:appinfo>
47
+ </xs:annotation>
48
+ <xs:complexContent>
49
+ <xs:extension base="IDTagged">
50
+ <xs:attribute name="source" type="xs:IDREF" use="required"/>
51
+ <xs:attribute name="target" type="xs:IDREF" use="required"/>
52
+ <xs:attribute name="length" type="xs:anySimpleType" use="optional"/>
53
+ </xs:extension>
54
+ </xs:complexContent>
55
+ </xs:complexType>
56
+
57
+ <xs:complexType name="AbstractRootEdge" abstract="true">
58
+ <xs:annotation>
59
+ <xs:documentation>
60
+ The AbstractRootEdge complex type is a superclass for the
61
+ edge that leads into a root, i.e. an edge with only a target
62
+ attribute, but no source attribute. This type of edge is
63
+ used for coalescent trees, where the initial lineage has
64
+ a certain length before things start splitting up.
65
+ </xs:documentation>
66
+ </xs:annotation>
67
+ <xs:complexContent>
68
+ <xs:extension base="IDTagged">
69
+ <xs:attribute name="target" type="xs:IDREF" use="required"/>
70
+ <xs:attribute name="length" type="xs:anySimpleType" use="optional"/>
71
+ </xs:extension>
72
+ </xs:complexContent>
73
+ </xs:complexType>
74
+
75
+ <xs:complexType name="AbstractTree" abstract="true"
76
+ sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#Tree">
77
+ <xs:annotation>
78
+ <xs:documentation>
79
+ The AbstractTree superclass is what a concrete tree inherits
80
+ from.
81
+ </xs:documentation>
82
+ </xs:annotation>
83
+ <xs:complexContent mixed="true">
84
+ <xs:extension base="IDTagged">
85
+ <xs:sequence minOccurs="1" maxOccurs="1">
86
+ <xs:element name="node" type="AbstractNode" minOccurs="1" maxOccurs="unbounded"/>
87
+ <xs:element name="rootedge" type="AbstractRootEdge" minOccurs="0" maxOccurs="1"/>
88
+ <xs:element name="edge" type="AbstractEdge" minOccurs="1" maxOccurs="unbounded"
89
+ />
90
+ </xs:sequence>
91
+ </xs:extension>
92
+ </xs:complexContent>
93
+ </xs:complexType>
94
+
95
+ <xs:complexType name="AbstractNetwork" abstract="true"
96
+ sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#Network">
97
+ <xs:annotation>
98
+ <xs:documentation>
99
+ The AbstractNetwork superclass is what a concrete network inherits
100
+ from.
101
+ </xs:documentation>
102
+ </xs:annotation>
103
+ <xs:complexContent mixed="true">
104
+ <xs:extension base="IDTagged">
105
+ <xs:sequence minOccurs="1" maxOccurs="1">
106
+ <xs:element name="node" type="AbstractNode" minOccurs="1" maxOccurs="unbounded"/>
107
+ <xs:element name="edge" type="AbstractEdge" minOccurs="1" maxOccurs="unbounded"
108
+ />
109
+ </xs:sequence>
110
+ </xs:extension>
111
+ </xs:complexContent>
112
+ </xs:complexType>
113
+
114
+ <xs:complexType name="AbstractTrees" abstract="true">
115
+ <xs:annotation>
116
+ <xs:documentation>
117
+ The AbstractTrees superclass is what concrete trees inherit
118
+ from.
119
+ </xs:documentation>
120
+ </xs:annotation>
121
+ <xs:complexContent mixed="true">
122
+ <xs:extension base="IDTagged">
123
+ <xs:sequence minOccurs="1" maxOccurs="1">
124
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
125
+ <xs:element name="network" type="AbstractNetwork" minOccurs="1"
126
+ maxOccurs="unbounded"/>
127
+ <xs:element name="tree" type="AbstractTree" minOccurs="1"
128
+ maxOccurs="unbounded"/>
129
+ </xs:choice>
130
+ </xs:sequence>
131
+ </xs:extension>
132
+ </xs:complexContent>
133
+ </xs:complexType>
134
+
135
+ </xs:schema>