about summary refs log tree commit diff stats
path: root/schema.sql
blob: 62dd7802d08107009f0be1100ab51466e9c66730 (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
DROP TABLE IF EXISTS `verbs`;
CREATE TABLE `verbs` (
  `verb_id` INTEGER PRIMARY KEY,
  `infinitive` VARCHAR(32) NOT NULL,
  `past_tense` VARCHAR(32) NOT NULL,
  `past_participle` VARCHAR(32) NOT NULL,
  `ing_form` VARCHAR(32) NOT NULL,
  `s_form` VARCHAR(32) NOT NULL
);

DROP TABLE IF EXISTS `groups`;
CREATE TABLE `groups` (
  `group_id` INTEGER PRIMARY KEY,
  `parent_id` INTEGER,
  FOREIGN KEY (`parent_id`) REFERENCES `groups`(`group_id`)
);

DROP TABLE IF EXISTS `frames`;
CREATE TABLE `frames` (
  `frame_id` INTEGER PRIMARY KEY,
  `group_id` INTEGER NOT NULL,
  `data` BLOB NOT NULL,
  FOREIGN KEY (`group_id`) REFERENCES `groups`(`group_id`)
);

DROP TABLE IF EXISTS `verb_groups`;
CREATE TABLE `verb_groups` (
  `verb_id` INTEGER NOT NULL,
  `group_id` INTEGER NOT NULL,
  FOREIGN KEY (`verb_id`) REFERENCES `verbs`(`verb_id`),
  FOREIGN KEY (`group_id`) REFERENCES `groups`(`group_id`)
);

DROP TABLE IF EXISTS `adjectives`;
CREATE TABLE `adjectives` (
  `adjective_id` INTEGER PRIMARY KEY,
  `form` VARCHAR(32) NOT NULL,
  `position` CHAR(1)
);

DROP TABLE IF EXISTS `adverbs`;
CREATE TABLE `adverbs` (
  `adverb_id` INTEGER PRIMARY KEY,
  `form` VARCHAR(32) NOT NULL
);

DROP TABLE IF EXISTS `nouns`;
CREATE TABLE `nouns` (
  `noun_id` INTEGER PRIMARY KEY,
  `form` VARCHAR(32) NOT NULL
);

DROP TABLE IF EXISTS `hypernymy`;
CREATE TABLE `hypernymy` (
  `hypernym_id` INTEGER NOT NULL,
  `hyponym_id` INTEGER NOT NULL,
  FOREIGN KEY (`hypernym_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`hyponym_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `instantiation`;
CREATE TABLE `instantiation` (
  `class_id` INTEGER NOT NULL,
  `instance_id` INTEGER NOT NULL,
  FOREIGN KEY (`class_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`instance_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `member_meronymy`;
CREATE TABLE `member_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  FOREIGN KEY (`meronym_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`holonym_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `part_meronymy`;
CREATE TABLE `part_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  FOREIGN KEY (`meronym_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`holonym_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `substance_meronymy`;
CREATE TABLE `substance_meronymy` (
  `meronym_id` INTEGER NOT NULL,
  `holonym_id` INTEGER NOT NULL,
  FOREIGN KEY (`meronym_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`holonym_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `variation`;
CREATE TABLE `variation` (
  `noun_id` INTEGER NOT NULL,
  `adjective_id` INTEGER NOT NULL,
  FOREIGN KEY (`noun_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`adjective_id`) REFERENCES `adjectives`(`adjective_id`)
);

DROP TABLE IF EXISTS `noun_antonymy`;
CREATE TABLE `noun_antonymy` (
  `noun_1_id` INTEGER NOT NULL,
  `noun_2_id` INTEGER NOT NULL,
  FOREIGN KEY (`noun_1_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`noun_2_id`) REFERENCES `nouns`(`noun_id`)
);

DROP TABLE IF EXISTS `adjective_antonymy`;
CREATE TABLE `adjective_antonymy` (
  `adjective_1_id` INTEGER NOT NULL,
  `adjective_2_id` INTEGER NOT NULL,
  FOREIGN KEY (`adjective_1_id`) REFERENCES `adjectives`(`adjective_id`),
  FOREIGN KEY (`adjective_2_id`) REFERENCES `adjectives`(`adjective_id`)
);

DROP TABLE IF EXISTS `adverb_antonymy`;
CREATE TABLE `adverb_antonymy` (
  `adverb_1_id` INTEGER NOT NULL,
  `adverb_2_id` INTEGER NOT NULL,
  FOREIGN KEY (`adverb_1_id`) REFERENCES `adverbs`(`adverb_id`),
  FOREIGN KEY (`adverb_2_id`) REFERENCES `adverbs`(`adverb_id`)
);

DROP TABLE IF EXISTS `specification`;
CREATE TABLE `specification` (
  `general_id` INTEGER NOT NULL,
  `specific_id` INTEGER NOT NULL,
  FOREIGN KEY (`general_id`) REFERENCES `adjectives`(`adjective_id`),
  FOREIGN KEY (`specific_id`) REFERENCES `adjectives`(`adjective_id`)
);

DROP TABLE IF EXISTS `pertainymy`;
CREATE TABLE `pertainymy` (
  `noun_id` INTEGER NOT NULL,
  `pertainym_id` INTEGER NOT NULL,
  FOREIGN KEY (`noun_id`) REFERENCES `nouns`(`noun_id`),
  FOREIGN KEY (`pertainym_id`) REFERENCES `adjectives`(`adjective_id`)
);

DROP TABLE IF EXISTS `mannernymy`;
CREATE TABLE `mannernymy` (
  `adjective_id` INTEGER NOT NULL,
  `mannernym_id` INTEGER NOT NULL,
  FOREIGN KEY (`adjective_id`) REFERENCES `adjectives`(`adjective_id`),
  FOREIGN KEY (`mannernym_id`) REFERENCES `adverbs`(`adverb_id`)
);

DROP TABLE IF EXISTS `synonymy`;
CREATE TABLE `synonymy` (
  `adjective_1_id` INTEGER NOT NULL,
  `adjective_2_id` INTEGER NOT NULL,
  FOREIGN KEY (`adjective_1_id`) REFERENCES `adjectives`(`adjective_id`),
  FOREIGN KEY (`adjective_2_id`) REFERENCES `adjectives`(`adjective_id`)
);