More appropriate version number.
[jblite.git] / kd2_db_schema.rst
blob185d53aff6aa47e7e22b3681d6f5d4f9110edce3
1 ===========================\r
2  KANJIDIC2 Database Schema\r
3 ===========================\r
4 \r
5 Original XML Schema\r
6 ===================\r
7 \r
8 ::\r
9 \r
10   kanjidic2\r
11   - header\r
12     - file_version\r
13     - database_version\r
14     - date_of_creation\r
15   * character   # what is meaning of * after list of child elements?  (a, b, c, ...)*\r
16     - literal\r
17     - codepoint\r
18       + cp_value\r
19     - radical\r
20       + rad_value\r
21     - misc\r
22       ? grade\r
23       + stroke_count\r
24       + variant\r
25       ? freq\r
26       * rad_name\r
27       ? jlpt\r
28     ? dic_number\r
29       + dic_ref\r
30     ? query_code\r
31       + q_code\r
32     ? reading_meaning\r
33       * rmgroup\r
34         * reading\r
35         * meaning\r
36       * nanori\r
38 SQLite3 Schema\r
39 ==============\r
41 CREATE TABLE header (file_version TEXT, database_version TEXT, date_of_creation TEXT);\r
43 character: -> CharacterTable\r
44   id INTEGER, literal TEXT, grade INTEGER, freq INTEGER, jlpt INTEGER\r
46 codepoint, radical, variant: -> TypeValueTable\r
47   id INTEGER, fk INTEGER, type TEXT, value TEXT\r
49 stroke_count: -> StrokeCountTable\r
50   id INTEGER, fk INTEGER, count INTEGER\r
52 rad_name, nanori: -> KeyValueTable\r
53   id INTEGER, fk INTEGER, value TEXT\r
55 dic_number:  (First revision)\r
56   id INTEGER, fk INTEGER, type TEXT, m_vol TEXT, m_page TEXT\r
57   - Might remove moro pieces and put in separate table to save space...\r
58   - Alternatively could merge m_vol/m_page into the moro code directly\r
60 query_code:\r
61   id INTEGER, fk INTEGER, type TEXT, skip_misclass TEXT, value TEXT\r
62   - Might move skip miscodes into a separate table...\r
63   - Might re-code SKIP values separately based upon integers... but\r
64     the same could be argued about all other codes...  probably\r
65     shouldn't waste time on this.\r
67 rmgroup:\r
68   id INTEGER, fk INTEGER\r
70 reading:\r
71   id INTEGER, fk INTEGER, type TEXT, on_type TEXT, r_status TEXT, value TEXT\r
73 meaning:\r
74   id INTEGER, fk INTEGER, lang TEXT, value TEXT\r
76 Notes\r
77 =====\r
79 - Initial tests show indices to be seemingly unnecessary for KANJIDIC2\r
80   reading/meaning/nanori searches.  I do not know if this is true on\r
81   slower systems, but for the time being the default "%xxx%" pattern\r
82   search is adequate.\r
84 - KANJIDIC2 uses special notation for kunyomi readings.\r
85   Specifically, - is used to note prefixes/suffixes, and . is used to\r
86   separate okurigana.\r
88   Likely it would be beneficial to make a special index table for\r
89   looking up kunyomi readings quickly.  The prefix/suffix marker\r
90   doesn't cause results to be dropped, but hte okurigana marker does,\r
91   and the user shouldn't need to supply (or know about) such details.\r