Skip to content

LexDbInternals

BenjaminWaldron edited this page May 17, 2005 · 17 revisions

The LexDB uses a PostgreSQL database to provide a source of lexical items for client applications such as the LKB.

The ''rev'' table

The rev table stores revisions of lexical items. It has the following structure. The first 4 fields, which hard-coded into every LexDB, have the following definitions:

name TEXT NOT NULL,
userid TEXT DEFAULT user NOT NULL,
modstamp TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
dead BOOLEAN DEFAULT 'f' NOT NULL

Following these are the user-defined fields specific to a particular LexDB. These are obtained from the .fld file provided to the script install-lexdb. They are also stored in the public.fld table of the LexDB for later reference. The following are the user-defined fields used by the ERG LexDB:

 type TEXT
 orthography TEXT
 keyrel TEXT
 altkey TEXT
 alt2key TEXT
 keytag TEXT
 altkeytag TEXT
 compkey TEXT
 ocompkey TEXT
 pronunciation TEXT
 complete TEXT
 semclasses TEXT
 preferences TEXT
 classifier TEXT
 selectrest TEXT
 jlink TEXT
 comments TEXT
 exemplars TEXT
 usages TEXT
 lang TEXT
 country TEXT
 dialect TEXT
 domains TEXT
 genres TEXT
 register TEXT
 confidence real DEFAULT 1
 source TEXT

The fields (name,userid,modstamp) provide the primary key. The field dead is used to marks dead revisions.

The ''rev_key'' table

This table provides keys for the lookup of lexical items by component words. Eg. a revision with orthography 'a few' will be keyed on both 'a' and 'few'. Keys are in normalized (lower case) form as provided by the clinet application. (We do not use the PostgreSQL lower() function as it may differ to the equivalent function used in the client application.)

name TEXT NOT NULL,
userid TEXT DEFAULT user NOT NULL,
modstamp TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
key text NOT NULL

The ''dfn'' table

The dfn table stores the mapping used to construct TDL lexical entries from fields of a revision in rev (the entry can then be processed by the client application in the same manner as entries obtained from a textual TDL lexicon file). See LexDbFieldMappings.

mode TEXT NOT NULL,
slot TEXT NOT NULL,
field TEXT NOT NULL,
path TEXT,
type TEXT

... TO DO

Clone this wiki locally