summary refs log tree commit diff stats
path: root/generator/schema.sql
blob: 6a7d2234727e1883c362b9984cbf2076b08c6c69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
CREATE TABLE `version` (
  `major` INTEGER NOT NULL,
  `minor` INTEGER NOT NULL
);

CREATE TABLE `notions` (
  `notion_id` INTEGER PRIMARY KEY,
  `part_of_speech` SMALLINT NOT NULL,
  `wnid` INTEGER,
  `images` INTEGER
);

CREATE UNIQUE INDEX `notion_by_wnid` ON `notions`(`wnid`);

CREATE TABLE `hypernymy` (
  `hypernym_id` INTEGER NOT NULL,
  `hyponym_id` INTEGER NOT NULL,
  PRIMARY KEY (`hypernym_id`,`hyponym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_hypernymy` ON `hypernymy`(`hyponym_id`,`hypernym_id`);

CREATE TABLE `instantiation` (
  `class_id` INTEGER NOT NULL,
  `instance_id` INTEGER NOT NULL,
  PRIMARY KEY (`class_id`,`instance_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_instantiation` ON `instantiation`(`instance_id`,`class_id`);

CREATE TABLE `member_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  PRIMARY KEY (`meronym_id`,`holonym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_member_meronymy` ON `member_meronymy`(`holonym_id`,`meronym_id`);

CREATE TABLE `part_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  PRIMARY KEY (`meronym_id`,`holonym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_part_meronymy` ON `part_meronymy`(`holonym_id`,`meronym_id`);

CREATE TABLE `substance_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  PRIMARY KEY (`meronym_id`,`holonym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_substance_meronymy` ON `substance_meronymy`(`holonym_id`,`meronym_id`);

CREATE TABLE `variation` (
  `noun_id` INTEGER NOT NULL,
  `adjective_id` INTEGER NOT NULL,
  PRIMARY KEY (`noun_id`,`adjective_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_variation` ON `variation`(`adjective_id`,`noun_id`);

CREATE TABLE `similarity` (
  `adjective_1_id` INTEGER NOT NULL,
  `adjective_2_id` INTEGER NOT NULL,
  PRIMARY KEY (`adjective_1_id`,`adjective_2_id`)
) WITHOUT ROWID;

CREATE TABLE `is_a` (
  `notion_id` INTEGER NOT NULL,
  `groupname` VARCHAR(32) NOT NULL,
  PRIMARY KEY (`notion_id`,`groupname`)
) WITHOUT ROWID;

CREATE TABLE `entailment` (
  `given_id` INTEGER NOT NULL,
  `entailment_id` INTEGER NOT NULL,
  PRIMARY KEY (`given_id`,`entailment_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_entailment` ON `entailment`(`entailment_id`,`given_id`);

CREATE TABLE `causality` (
  `cause_id` INTEGER NOT NULL,
  `effect_id` INTEGER NOT NULL,
  PRIMARY KEY (`cause_id`,`effect_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_causality` ON `causality`(`effect_id`,`cause_id`);

CREATE TABLE `words` (
  `word_id` INTEGER PRIMARY KEY,
  `notion_id` INTEGER NOT NULL,
  `lemma_id` INTEGER NOT NULL,
  `tag_count` INTEGER,
  `position` SMALLINT,
  `group_id` INTEGER
);

CREATE INDEX `notions_lemmas` ON `words`(`notion_id`,`lemma_id`);
CREATE INDEX `lemmas_notions` ON `words`(`lemma_id`,`notion_id`);
CREATE INDEX `group_words` ON `words`(`group_id`);

CREATE TABLE `antonymy` (
  `antonym_1_id` INTEGER NOT NULL,
  `antonym_2_id` INTEGER NOT NULL,
  PRIMARY KEY (`antonym_1_id`,`antonym_2_id`)
) WITHOUT ROWID;

CREATE TABLE `specification` (
  `general_id` INTEGER NOT NULL,
  `specific_id` INTEGER NOT NULL,
  PRIMARY KEY (`general_id`,`specific_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_specification` ON `specification`(`specific_id`,`general_id`);

CREATE TABLE `pertainymy` (
  `noun_id` INTEGER NOT NULL,
  `pertainym_id` INTEGER NOT NULL,
  PRIMARY KEY (`noun_id`,`pertainym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_pertainymy` ON `pertainymy`(`pertainym_id`,`noun_id`);

CREATE TABLE `mannernymy` (
  `adjective_id` INTEGER NOT NULL,
  `mannernym_id` INTEGER NOT NULL,
  PRIMARY KEY (`adjective_id`,`mannernym_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_mannernymy` ON `mannernymy`(`mannernym_id`,`adjective_id`);

CREATE TABLE `usage` (
  `domain_id` INTEGER NOT NULL,
  `term_id` INTEGER NOT NULL,
  PRIMARY KEY (`domain_id`,`term_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_usage` ON `usage`(`term_id`,`domain_id`);

CREATE TABLE `topicality` (
  `domain_id` INTEGER NOT NULL,
  `term_id` INTEGER NOT NULL,
  PRIMARY KEY (`domain_id`,`term_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_topicality` ON `topicality`(`term_id`,`domain_id`);

CREATE TABLE `regionality` (
  `domain_id` INTEGER NOT NULL,
  `term_id` INTEGER NOT NULL,
  PRIMARY KEY (`domain_id`,`term_id`)
) WITHOUT ROWID;

CREATE INDEX `reverse_regionality` ON `regionality`(`term_id`,`domain_id`);

CREATE TABLE `forms` (
  `form_id` INTEGER PRIMARY KEY,
  `form` VARCHAR(32) NOT NULL,
  `complexity` SMALLINT NOT NULL,
  `proper` SMALLINT NOT NULL,
  `length` SMALLINT NOT NULL
);

CREATE UNIQUE INDEX `form_by_string` ON `forms`(`form`);

CREATE TABLE `lemmas_forms` (
  `lemma_id` INTEGER NOT NULL,
  `form_id` INTEGER NOT NULL,
  `category` SMALLINT NOT NULL,
  PRIMARY KEY (`lemma_id`,`category`,`form_id`)
) WITHOUT ROWID;

CREATE INDEX `forms_lemmas` ON `lemmas_forms`(`form_id`,`category`,`lemma_id`);

CREATE TABLE `pronunciations` (
  `pronunciation_id` INTEGER PRIMARY KEY,
  `phonemes` VARCHAR(64) NOT NULL,
  `prerhyme` VARCHAR(8),
  `rhyme` VARCHAR(64),
  `syllables` INTEGER NOT NULL,
  `stress` VARCHAR(64) NOT NULL
);

CREATE INDEX `rhymes_with` ON `pronunciations`(`rhyme`,`prerhyme`);

CREATE TABLE `forms_pronunciations` (
  `form_id` INTEGER NOT NULL,
  `pronunciation_id` INTEGER NOT NULL,
  PRIMARY KEY (`form_id`,`pronunciation_id`)
) WITHOUT ROWID;

CREATE INDEX `pronunciations_forms` ON `forms_pronunciations`(`pronunciation_id`,`form_id`);

CREATE TABLE `frames` (
  `frame_id` INTEGER NOT NULL,
  `group_id` INTEGER NOT NULL,
  'length' INTEGER NOT NULL
);

CREATE INDEX `frames_in` ON `frames`(`group_id`);

CREATE TABLE `parts` (
  `part_id` INTEGER PRIMARY KEY,
  `frame_id` INTEGER NOT NULL,
  `part_index` INTEGER NOT NULL,
  `type` INTEGER NOT NULL,
  `role` VARCHAR(16),
  `prepositions` BLOB,
  `preposition_literality` SMALLINT,
  `literal_value` VARCHAR(64)
);

CREATE INDEX `parts_of` ON `parts`(`frame_id`);
CREATE UNIQUE INDEX `part_by_frame_index` ON `parts`(`frame_id`, `part_index`);

CREATE TABLE `synrestrs` (
  `part_id` INTEGER NOT NULL,
  `synrestr` VARCHAR(32) NOT NULL
);

CREATE INDEX `synrestrs_for` ON `synrestrs`(`part_id`);

CREATE TABLE `selrestrs` (
  `part_id` INTEGER NOT NULL,
  `selrestr` VARCHAR(32) NOT NULL
);

CREATE INDEX `selrestrs_for` ON `selrestrs`(`part_id`);