blob: feb2835bb916696838d0f9f7173e8d91ec3da31e [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>-->
bansp54585bb2022-03-15 03:01:25 +010080 <attribute name="l">
81 <data type="integer"/>
82 </attribute>
banspc3cdcb92022-03-09 03:25:32 +010083 <attribute name="from">
84 <choice>
85 <data type="integer"/>
86 </choice>
87 </attribute>
88 <attribute name="to">
89 <choice>
90 <data type="integer"/>
91 </choice>
92 </attribute>
93 <optional>
94 <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>
95 <attribute name="word">
96 <data type="string"/>
97 </attribute>
98 </optional>
99 <optional>
100 <attribute name="prev">
101 <data type="integer"/>
102 </attribute>
103 </optional>
104 <optional>
105 <attribute name="next">
106 <data type="integer"/>
107 </attribute>
108 </optional>
109 <optional>
110 <attribute name="prev_id">
111 <data type="IDREF"/>
112 </attribute>
113 </optional>
114 <optional>
115 <attribute name="next_id">
116 <data type="IDREF"/>
117 </attribute>
118 </optional>
119
120 <optional>
121 <ref name="fs"/>
122 </optional>
123
124 <zeroOrMore>
125 <ref name="rel"/>
126 </zeroOrMore>
127 </element>
128 </define>
129
130 <define name="rel">
131 <element name="rel">
132 <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>
133 <!--<optional>
134 <attribute name="n">
135 <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>
136 <data type="integer"/>
137 </attribute>
138 </optional>-->
139 <interleave>
140 <choice>
141 <attribute name="label">
142 <text/>
143 </attribute>
144 <ref name="fs"/>
145 </choice>
146 <choice>
147 <choice>
148 <attribute name="target">
149 <data type="IDREF"/>
150 </attribute>
151 <attribute name="uri">
152 <data type="anyURI"/>
153 </attribute>
154 </choice>
155 <oneOrMore><ref name="span"/></oneOrMore>
156<!-- oneOrMore was introduced here for time spans; this could be handled by separate <rel> elements, of course-->
157 <attribute name="type">
158 <choice>
159 <value type="NCName">unary</value>
160 <value type="NCName">refl</value>
161 </choice>
162 </attribute>
163 </choice>
164 </interleave>
165 </element>
166 </define>
167
168 <include href="fsr.rng"/>
169</grammar>