-
Notifications
You must be signed in to change notification settings - Fork 1
/
jmdict_db_schema.txt
168 lines (146 loc) · 2.58 KB
/
jmdict_db_schema.txt
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
Entry
- ent_seq
* k_ele
- keb
* ke_inf
* ke_pri
+ r_ele
- reb
? re_nokanji
* re_restr
* re_inf
* re_pri
? info
* links
- link_tag
- link_desc
- link_uri
* bibl
? bib_tag
? bib_txt
* etym (UNUSED)
* audit
- upd_date
- upd_detl
+ sense
* stagk
* stagr
* pos
* xref* # not sure why it's (#PCDATA)*...
* ant* # not sure why it's (#PCDATA)*...
* field
* misc
* s_inf
* lsource
* dial
* gloss
* pri (UNUSED)
* example
entry:
auto_inc (?)
ent_seq (also unique int)... good enough?
entry < k_ele - keb
< ke_inf
< ke_pri
# SIMPLE translation from XML to SQL:
# Unique key for each table,
# plus indexed foreign key (except top-level element)
entity: id, ent_seq
k_ele: id, fk, blob (<keb>)
k_ele_inf: id, fk, entity
k_ele_pri: id, fk, value
r_ele: id, fk, blob, nokanji(flag)
r_ele_restr: id, fk, value
r_ele_inf: id, fk, entity
r_ele_pri: id, fk, value
...etc, for all tables.
sense: id, fk
Other tables: pretty much as we planned, but add the fk in, and make
the primary key an auto-increment. Will leave us with fewer tables
and may reduce size slightly.
---------------
Old notes below
---------------
entry # Keep around just as a full listing...
id # ent_seq good enough...?
entry_k_ele
k_ele_inf
k_ele_pri
entry_r_ele
r_ele_restr
r_ele_inf
r_ele_pri
entry_links #unused
entry_bibl #unused
entry_etym #unused
entry_audit
entry_sense
sense_stagk
sense_stagr
sense_pos
sense_xref
sense_ant
sense_field
sense_misc
sense_s_inf
sense_dial
sense_example
sense_lsource
sense_gloss
gloss_pri #unused
(id_parent
seq)
id_child
k_ele # k_ele (id, keb => id, value)
ke_inf
ke_pri
re_restr
re_inf
re_pri
stagk
stagr
pos
xref
ant
field
misc
s_inf
dial
example
pri: UNUSED
id
value
r_ele
id
value # reb
nokanji # re_nokanji (boolean)
audit
id
update_date
update_details
lsource
id
lang (default eng)
ls_type ("full" or "part"... full implied, part if spec'd... meaning???)
ls_wasei (t/f flag, "y" if true, not spec'd otherwise)
gloss
id
lang (eng def)
g_gend (can be null) (unused)
value
pri? (t/f: if true, use pri table)
links # UNUSED
id
tag
desc
uri
bibl # UNUSED
id
tag
txt
etym # UNUSED
SUPPORT TABLES:
entities:
id # surrogate in case entity is ever changed
entity
value