-
Notifications
You must be signed in to change notification settings - Fork 542
/
schema_mysqlcluster.sql
52 lines (46 loc) · 1.29 KB
/
schema_mysqlcluster.sql
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
DROP TABLE IF EXISTS articles CASCADE;
CREATE TABLE articles(
article_id bigint PRIMARY KEY,
text text
) engine=ndb;
DROP TABLE IF EXISTS sentences CASCADE;
CREATE TABLE sentences(
document_id bigint,
sentence text,
words TEXT,
lemma TEXT,
pos_tags TEXT,
dependencies TEXT,
ner_tags TEXT,
sentence_offset bigint,
sentence_id varchar(255) -- unique identifier for sentences
, PRIMARY KEY (sentence_id)
) engine=ndb PARTITION BY KEY(sentence_id)
;
DROP TABLE IF EXISTS people_mentions CASCADE;
CREATE TABLE people_mentions(
sentence_id varchar(255),
start_position int,
length int,
text varchar(255),
mention_id varchar(255), -- unique identifier for people_mentions
PRIMARY KEY(mention_id)
) engine=ndb
;
DROP TABLE IF EXISTS has_spouse CASCADE;
CREATE TABLE has_spouse(
person1_id varchar(255),
person2_id varchar(255),
sentence_id varchar(255),
description text,
is_true boolean,
relation_id varchar(255), -- unique identifier for has_spouse
id bigint -- NOT NULL AUTO_INCREMENT, -- reserved for DeepDive
, PRIMARY KEY (person1_id, person2_id) -- this works for ndb
) engine=ndb PARTITION BY KEY (person1_id)
;
DROP TABLE IF EXISTS has_spouse_features CASCADE;
CREATE TABLE has_spouse_features(
relation_id varchar(255),
feature text
) engine=ndb;