Statistics
| Revision:

root / tmp / org.txm.tigersearch.rcp / groovy / org / txm / importer / tigersearch / TigerXMLSubcorpus.xsd @ 911

History | View | Annotate | Download (7.3 kB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3

    
4
 <!-- ===========================================================================
5
      XML Schema for the subcorpus part of the TIGER-XML format
6
      http://www.ims.uni-stuttgart.de/projekte/TIGER/public/TigerXMLSubcorpus.xsd
7
      ===========================================================================
8
      TIGER Project, Wolfgang Lezius
9
      IMS, University of Stuttgart, 04/01/2003
10
      =========================================================================== -->
11

    
12
  <!-- ======================================================
13
       DECLARATION OF SUBCORPORA AND SENTENCES
14
       ====================================================== -->
15

    
16

    
17
  <!-- declaration of the subcorpus element -->
18

    
19
  <xs:element name="subcorpus" type="subcorpusType"/>
20

    
21

    
22
  <!-- declaration of the subcorpus type -->
23

    
24
  <xs:complexType name="subcorpusType">
25

    
26
    <!-- A subcorpus may comprise another subcorpora or sentences -->
27

    
28
    <xs:choice minOccurs="0" maxOccurs="unbounded">
29
      <xs:element name="subcorpus" type="subcorpusType" minOccurs="1" maxOccurs="1"/>
30
      <xs:element name="s" type="sentenceType" minOccurs="1" maxOccurs="1"/>
31
    <xs:/choice>
32

    
33
    <!-- required: subcorpus name -->
34
 
35
    <xs:attribute name="name" type="xsd:string" use="required"/>
36

    
37
    <!-- optional: reference to external subcorpus file 
38

    
39
         A subcorpus of a TigerXML corpus can also be stored in separate file. 
40
         This attribute points to the external subcorpus file. The pointer is
41
         an URI. Examples: file:relative.xml or file:/path/to/absolute.xml 
42

    
43
         Note: If there is a pointer to an external file, the subcorpus
44
               element must be empty. -->
45

    
46
    <xs:attribute name="external" type="xsd:anyURI"/>  
47

    
48
  <xs:/complexType>
49

    
50

    
51
  <!-- declaration of the sentence type -->
52

    
53
  <xs:complexType name="sentenceType">
54

    
55
    <xs:sequence>
56
      <xs:element name="graph" type="graphType" minOccurs="0" maxOccurs="1"/>
57
      <xs:element name="matches" type="matchesType" minOccurs="0" maxOccurs="1"/>
58
    <xs:/sequence>
59

    
60
    <xs:attribute name="id" type="idType" use="required"/>
61

    
62
  <xs:/complexType>
63

    
64

    
65
  <!-- declaration of the graph type -->
66

    
67
  <xs:complexType name="graphType">
68

    
69
    <xs:sequence>
70
      <xs:element name="terminals" type="terminalsType" minOccurs="1" maxOccurs="1"/>
71
      <xs:element name="nonterminals" type="nonterminalsType" minOccurs="1" maxOccurs="1"/>
72
    <xs:/sequence>
73

    
74
    <xs:attribute name="root" type="idrefType" use="required"/>
75

    
76
    <!-- indicated that the exported sentence is discontinuous -->
77
    <xs:attribute name="discontinuous" type="xsd:boolean" default="false" use="optional"/>
78

    
79
  <xs:/complexType>
80

    
81

    
82
  <!-- declaration of the terminals type -->
83

    
84
  <xs:complexType name="terminalsType">
85

    
86
    <xs:sequence>
87
      <xs:element name="t" type="tType" minOccurs="1" maxOccurs="unbounded"/>
88
    <xs:/sequence>
89

    
90
  <xs:/complexType>
91

    
92

    
93
  <!-- declaration of the t element -->
94

    
95
  <xs:complexType name="tType">
96

    
97
    <!-- secondary edges possible -->
98
    <xs:sequence>
99
      <xs:element name="secedge" type="secedgeType" minOccurs="0" maxOccurs="unbounded"/>
100
    <xs:/sequence>
101

    
102
    <xs:attribute name="id" type="idType" use="required"/>    
103
    <xs:attributeGroup ref="tfeatureAttributes"/>
104

    
105
  <xs:/complexType>
106

    
107

    
108
  <!-- declaration of the nonterminals type -->
109

    
110
  <xs:complexType name="nonterminalsType">
111

    
112
    <xs:sequence>
113
      <xs:element name="nt" type="ntType" minOccurs="0" maxOccurs="unbounded"/>
114
    <xs:/sequence>
115

    
116
  <xs:/complexType>
117

    
118

    
119
  <!-- declaration of the nt element -->
120

    
121
  <xs:complexType name="ntType">
122

    
123
    <!-- edge and secondary edges possible -->
124
    <xs:sequence>
125
      <xs:element name="edge" type="edgeType" minOccurs="0" maxOccurs="unbounded"/>
126
      <xs:element name="secedge" type="secedgeType" minOccurs="0" maxOccurs="unbounded"/>
127
    <xs:/sequence>
128

    
129
    <xs:attribute name="id" type="idType" use="required"/>    
130
    <xs:attributeGroup ref="ntfeatureAttributes"/>
131

    
132
  <xs:/complexType>
133

    
134

    
135
  <!-- declaration of the edge type -->
136

    
137
  <xs:complexType name="edgeType">
138

    
139
    <xs:attribute name="idref" type="idrefType" use="required"/>    
140

    
141
    <xs:attributeGroup ref="edgelabelAttribute"/>
142

    
143
  <xs:/complexType>
144

    
145

    
146
  <!-- declaration of the secondary edge type -->
147

    
148
  <xs:complexType name="secedgeType">
149

    
150
    <xs:attribute name="idref" type="idrefType" use="required"/>    
151

    
152
    <xs:attributeGroup ref="secedgelabelAttribute"/>
153

    
154
  <xs:/complexType>
155

    
156

    
157
  <!-- declaration of the matches type -->
158

    
159
  <xs:complexType name="matchesType">
160

    
161
    <xs:sequence>
162
      <xs:element name="match" type="matchType" minOccurs="1" maxOccurs="unbounded"/>
163
    <xs:/sequence>
164

    
165
  <xs:/complexType>
166

    
167

    
168
  <!-- declaration of the match type -->
169

    
170
  <xs:complexType name="matchType">
171

    
172
    <xs:sequence>
173
      <xs:element name="variable" type="varType" minOccurs="1" maxOccurs="unbounded"/>
174
    <xs:/sequence>
175

    
176
    <xs:attribute name="subgraph" type="idrefType" use="required"/>    
177

    
178
  <xs:/complexType>
179

    
180

    
181
  <!-- declaration of the variable type -->
182

    
183
  <xs:complexType name="varType">
184

    
185
    <xs:attribute name="name" type="xsd:string" use="required"/>    
186

    
187
    <xs:attribute name="idref" type="idrefType" use="required"/>    
188

    
189
  <xs:/complexType>
190

    
191

    
192
  <!-- ======================================================
193
       SENTENCE DECLARATIONS THAT SHOULD BE REFINED
194
       ====================================================== -->
195

    
196
  <!-- declaration of the TERMINAL FEATURE ATTRIBUTES;
197
       this group is unrestricted, but should be refined by a 
198
       specialised, corpus-dependent schema -->
199

    
200
  <xs:attributeGroup name="tfeatureAttributes">
201
  
202
    <xs:anyAttribute processContents="skip"/>
203

    
204
  <xs:/attributeGroup>
205

    
206

    
207
  <!-- declaration of the NONTERMINAL FEATURE ATTRIBUTES;
208
       this group is unrestricted, but should be refined by a 
209
       specialised, corpus-dependent schema -->
210

    
211
  <xs:attributeGroup name="ntfeatureAttributes">
212
  
213
    <xs:anyAttribute processContents="skip"/>
214

    
215
  <xs:/attributeGroup>
216

    
217

    
218
  <!-- declaration of the EDGE-LABEL ATTRIBUTE;
219
       the label attribute is optional which should be refined by a 
220
       specialised, corpus-dependent schema -->
221

    
222
  <xs:attributeGroup name="edgelabelAttribute">
223
  
224
    <xs:attribute name="label" type="xsd:string" use="optional"/>    
225

    
226
  <xs:/attributeGroup>
227
    
228

    
229
  <!-- declaration of the SECONDARY-EDGE-LABEL ATTRIBUTE;
230
       the label attribute is optional which should be refined by a 
231
       specialised, corpus-dependent schema -->
232

    
233
  <xs:attributeGroup name="secedgelabelAttribute">
234
  
235
    <xs:attribute name="label" type="xsd:string" use="optional"/>    
236

    
237
  <xs:/attributeGroup>
238
 
239

    
240
  <!-- ======================================================
241
       ID and IDREF TYPE DECLARATIONS
242
       ====================================================== -->
243

    
244
  <!-- Even though XML Schema are a W3C Recommendation, schema
245
       support of XML parsers is still restricted. Using some
246
       parsers you might have problems with the ID and IDREF
247
       attributes in combination with an "anyAttribute"
248
       declaration. In this case, just modify the base type 
249
       of the following two declarations to "xsd:string".  -->
250

    
251

    
252
  <!-- declaration of idType -->
253

    
254
  <xs:simpleType name="idType">
255

    
256
    <xs:restriction base="xsd:ID"/>
257

    
258
  <xs:/simpleType>
259

    
260

    
261
  <!-- declaration of idrefType -->
262

    
263
  <xs:simpleType name="idrefType">
264

    
265
    <xs:restriction base="xsd:IDREF"/>
266

    
267
  <xs:/simpleType>
268

    
269

    
270
<xs:/schema>