blob: 029c92060a6123332660e85101fe7ec5b71fb7ba [file] [log] [blame]
banspc3cdcb92022-03-09 03:25:32 +01001<?xml version="1.0" encoding="UTF-8"?>
2
3<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="http://ids-mannheim.de/ns/KorAP" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
4 <!-- $Id$ -->
5 <start>
6 <element name="layer">
7 <optional>
8 <attribute name="type">
9 <a:documentation>As of Sep 2013, this isn't used anywhere.</a:documentation>
10 <data type="NCName"/>
11 </attribute>
12 </optional>
13 <attribute name="version">
14 <value>KorAP-0.4</value>
15 </attribute>
16 <attribute name="docid">
17 <data type="NCName"/>
18 </attribute>
19 <optional>
20 <attribute name="unit" a:defaultValue="char">
21 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">Default: character</documentation>
22 <choice>
23 <value type="NCName">char</value>
24 <value type="NCName">msec</value>
25 <value type="NCName">sec</value>
26 </choice>
27 </attribute>
28 </optional>
29 <oneOrMore>
30 <element name="spanList">
31 <!-- shouldn't this come straight from XML?
32 <optional>
33 <attribute>
34 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">If you ask me about why we need xml:base here, the answer is probably: I forgot to remove it and maybe I should -P</documentation>
35 <name ns="http://www.w3.org/XML/1998/namespace">base</name>
36 <data type="anyURI"/>
37 </attribute>
38 </optional>-->
39 <optional>
40 <attribute name="fragmented">
41 <a:documentation>For spanLists non-exhaustively covered by the spans therein.</a:documentation>
42 <data type="boolean"/>
43 </attribute>
44 </optional>
45 <optional>
46 <attribute name="speaker-id">
47 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">This is for speech corpora; the datatype restriction may be too strict, I assumed it is a real ID in the source</documentation>
48 <data type="NCName"/>
49 </attribute>
50 </optional>
51 <optional>
52 <attribute name="id">
53 <data type="ID"/>
54 </attribute>
55 </optional>
56 <optional>
57 <attribute name="type">
58 <data type="NCName"/>
59 </attribute>
60 </optional>
61 <oneOrMore>
62 <ref name="span"/>
63 </oneOrMore>
64 </element>
65 </oneOrMore>
66 </element>
67 </start>
68 <define name="span">
69 <element name="span">
70 <optional>
71 <attribute name="id">
72 <data type="ID"/>
73 </attribute>
74 </optional>
75 <!--<optional>
76 <attribute name="type">
77 <data type="NCName"/>
78 </attribute>
79 </optional>-->
80 <attribute name="from">
81 <choice>
82 <data type="integer"/>
83 </choice>
84 </attribute>
85 <attribute name="to">
86 <choice>
87 <data type="integer"/>
88 </choice>
89 </attribute>
90 <optional>
91 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">This attribute is used in the base foundry tokenization files only, and only for a while, for debugging purposes. It may be that the time has come to comment it out.</documentation>
92 <attribute name="word">
93 <data type="string"/>
94 </attribute>
95 </optional>
96 <optional>
97 <attribute name="prev">
98 <data type="integer"/>
99 </attribute>
100 </optional>
101 <optional>
102 <attribute name="next">
103 <data type="integer"/>
104 </attribute>
105 </optional>
106 <optional>
107 <attribute name="prev_id">
108 <data type="IDREF"/>
109 </attribute>
110 </optional>
111 <optional>
112 <attribute name="next_id">
113 <data type="IDREF"/>
114 </attribute>
115 </optional>
116
117 <optional>
118 <ref name="fs"/>
119 </optional>
120
121 <zeroOrMore>
122 <ref name="rel"/>
123 </zeroOrMore>
124 </element>
125 </define>
126
127 <define name="rel">
128 <element name="rel">
129 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">The possible children are <fs/> and <span/>, in any order. <fs/> or the @label attribute are used to encode the 'labelling' information. Instead of <span/>, one can use either the @target attribute (for referring to IDs within the same file), or the @uri attribute (for URIs), or the attribute @type with the values set to either "unary" (for e.g. the malformed dependencies that XIP produces) or "refl" for reflexive relationships.</documentation>
130 <!--<optional>
131 <attribute name="n">
132 <documentation xmlns="http://relaxng.org/ns/compatibility/annotations/1.0">This is a kludgey attribute, currently used for dependencies that target e.g. a compound or an infinitive together with "zu"</documentation>
133 <data type="integer"/>
134 </attribute>
135 </optional>-->
136 <interleave>
137 <choice>
138 <attribute name="label">
139 <text/>
140 </attribute>
141 <ref name="fs"/>
142 </choice>
143 <choice>
144 <choice>
145 <attribute name="target">
146 <data type="IDREF"/>
147 </attribute>
148 <attribute name="uri">
149 <data type="anyURI"/>
150 </attribute>
151 </choice>
152 <oneOrMore><ref name="span"/></oneOrMore>
153<!-- oneOrMore was introduced here for time spans; this could be handled by separate <rel> elements, of course-->
154 <attribute name="type">
155 <choice>
156 <value type="NCName">unary</value>
157 <value type="NCName">refl</value>
158 </choice>
159 </attribute>
160 </choice>
161 </interleave>
162 </element>
163 </define>
164
165 <include href="fsr.rng"/>
166</grammar>