]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/002.schema.config.sql
moving xml2 requirement out of the way
[Evergreen.git] / Open-ILS / src / sql / Pg / 002.schema.config.sql
1
2 DROP SCHEMA stats CASCADE;
3 DROP SCHEMA config CASCADE;
4
5 BEGIN;
6 CREATE SCHEMA stats;
7
8 CREATE SCHEMA config;
9 COMMENT ON SCHEMA config IS $$
10 /*
11  * Copyright (C) 2005  Georgia Public Library Service 
12  * Mike Rylander <mrylander@gmail.com>
13  *
14  * The config schema holds static configuration data for the
15  * Open-ILS installation.
16  *
17  * ****
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  */
29 $$;
30
31
32 CREATE TABLE config.bib_source (
33         id              SERIAL  PRIMARY KEY,
34         quality         INT     CHECK ( quality BETWEEN 0 AND 100 ),
35         source          TEXT    NOT NULL UNIQUE,
36         transcendant    BOOL    NOT NULL DEFAULT FALSE
37 );
38 COMMENT ON TABLE config.bib_source IS $$
39 /*
40  * Copyright (C) 2005  Georgia Public Library Service 
41  * Mike Rylander <mrylander@gmail.com>
42  *
43  * Valid sources of MARC records
44  *
45  * This is table is used to set up the relative "quality" of each
46  * MARC source, such as OCLC.
47  *
48  * ****
49  *
50  * This program is free software; you can redistribute it and/or
51  * modify it under the terms of the GNU General Public License
52  * as published by the Free Software Foundation; either version 2
53  * of the License, or (at your option) any later version.
54  *
55  * This program is distributed in the hope that it will be useful,
56  * but WITHOUT ANY WARRANTY; without even the implied warranty of
57  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
58  * GNU General Public License for more details.
59  */
60 $$;
61
62
63 INSERT INTO config.bib_source (quality, source) VALUES (90, 'oclc');
64 INSERT INTO config.bib_source (quality, source) VALUES (10, 'System Local');
65 INSERT INTO config.bib_source (quality, source, transcendant) VALUES (1, 'Project Gutenberg', TRUE);
66
67 CREATE TABLE config.standing (
68         id              SERIAL  PRIMARY KEY,
69         value           TEXT    NOT NULL UNIQUE
70 );
71 COMMENT ON TABLE config.standing IS $$
72 /*
73  * Copyright (C) 2005  Georgia Public Library Service 
74  * Mike Rylander <mrylander@gmail.com>
75  *
76  * Patron Standings
77  *
78  * This table contains the values that can be applied to a patron
79  * by a staff member.  These values should not be changed, other
80  * that for translation, as the ID column is currently a "magic
81  * number" in the source. :(
82  *
83  * ****
84  *
85  * This program is free software; you can redistribute it and/or
86  * modify it under the terms of the GNU General Public License
87  * as published by the Free Software Foundation; either version 2
88  * of the License, or (at your option) any later version.
89  *
90  * This program is distributed in the hope that it will be useful,
91  * but WITHOUT ANY WARRANTY; without even the implied warranty of
92  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93  * GNU General Public License for more details.
94  */
95 $$;
96
97 INSERT INTO config.standing (value) VALUES ('Good');
98 INSERT INTO config.standing (value) VALUES ('Barred');
99
100
101 CREATE TABLE config.xml_transform (
102         name            TEXT    PRIMARY KEY,
103         namespace_uri   TEXT    NOT NULL UNIQUE,
104         prefix          TEXT    NOT NULL,
105         xslt            TEXT    NOT NULL
106 );
107 INSERT INTO config.xml_transform VALUES ( 'marcxml', 'http://www.loc.gov/MARC21/slim', 'marc', '---' );
108 INSERT INTO config.xml_transform VALUES ( 'mods', 'http://www.loc.gov/mods/', 'mods', '/home/miker/MARC21slim2MODS.xsl' );
109
110 CREATE TABLE config.metabib_field (
111         id              SERIAL  PRIMARY KEY,
112         field_class     TEXT    NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
113         name            TEXT    NOT NULL,
114         xpath           TEXT    NOT NULL,
115         weight          INT     NOT NULL DEFAULT 1,
116         format          TEXT    NOT NULL DEFAULT 'mods',
117         search_field    BOOL    NOT NULL DEFAULT TRUE,
118         facet_field     BOOL    NOT NULL DEFAULT FALSE
119 );
120 COMMENT ON TABLE config.metabib_field IS $$
121 /*
122  * Copyright (C) 2005  Georgia Public Library Service 
123  * Mike Rylander <mrylander@gmail.com>
124  *
125  * XPath used for WoRMing
126  *
127  * This table contains the XPath used to chop up MODS into it's
128  * indexable parts.  Each XPath entry is named and assigned to
129  * a "class" of either title, subject, author, keyword or series.
130  * 
131  *
132  * ****
133  *
134  * This program is free software; you can redistribute it and/or
135  * modify it under the terms of the GNU General Public License
136  * as published by the Free Software Foundation; either version 2
137  * of the License, or (at your option) any later version.
138  *
139  * This program is distributed in the hope that it will be useful,
140  * but WITHOUT ANY WARRANTY; without even the implied warranty of
141  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142  * GNU General Public License for more details.
143  */
144 $$;
145
146 CREATE UNIQUE INDEX config_metabib_field_class_name_idx ON config.metabib_field (field_class, name);
147
148
149 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
150 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
151 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
152 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
153 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ );
154 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'corporate', $$//mods:mods/mods:name[@type='corporate']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
155 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'personal', $$//mods:mods/mods:name[@type='personal']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
156 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'conference', $$//mods:mods/mods:name[@type='conference']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
157 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ );
158 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ );
159 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ );
160 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ );
161 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ );
162 -- INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ );
163 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */
164
165 CREATE TABLE config.non_cataloged_type (
166         id              SERIAL          PRIMARY KEY,
167         owning_lib      INT             NOT NULL, -- REFERENCES actor.org_unit (id),
168         name            TEXT            NOT NULL,
169         circ_duration   INTERVAL        NOT NULL DEFAULT '14 days'::INTERVAL,
170         in_house        BOOL            NOT NULL DEFAULT FALSE,
171         CONSTRAINT noncat_once_per_lib UNIQUE (owning_lib,name)
172 );
173 COMMENT ON TABLE config.non_cataloged_type IS $$
174 /*
175  * Copyright (C) 2005  Georgia Public Library Service 
176  * Mike Rylander <mrylander@gmail.com>
177  *
178  * Types of valid non-cataloged items.
179  *
180  *
181  * ****
182  *
183  * This program is free software; you can redistribute it and/or
184  * modify it under the terms of the GNU General Public License
185  * as published by the Free Software Foundation; either version 2
186  * of the License, or (at your option) any later version.
187  *
188  * This program is distributed in the hope that it will be useful,
189  * but WITHOUT ANY WARRANTY; without even the implied warranty of
190  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
191  * GNU General Public License for more details.
192  */
193 $$;
194
195
196 INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, 'Paperback Book' );
197
198 CREATE TABLE config.identification_type (
199         id              SERIAL  PRIMARY KEY,
200         name            TEXT    NOT NULL UNIQUE
201 );
202 COMMENT ON TABLE config.identification_type IS $$
203 /*
204  * Copyright (C) 2005  Georgia Public Library Service 
205  * Mike Rylander <mrylander@gmail.com>
206  *
207  * Types of valid patron identification.
208  *
209  * Each patron must display at least one valid form of identification
210  * in order to get a library card.  This table lists those forms.
211  * 
212  *
213  * ****
214  *
215  * This program is free software; you can redistribute it and/or
216  * modify it under the terms of the GNU General Public License
217  * as published by the Free Software Foundation; either version 2
218  * of the License, or (at your option) any later version.
219  *
220  * This program is distributed in the hope that it will be useful,
221  * but WITHOUT ANY WARRANTY; without even the implied warranty of
222  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
223  * GNU General Public License for more details.
224  */
225 $$;
226
227
228 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers License' );
229 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
230 INSERT INTO config.identification_type ( name ) VALUES ( 'Other' );
231
232 CREATE TABLE config.rule_circ_duration (
233         id              SERIAL          PRIMARY KEY,
234         name            TEXT            NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
235         extended        INTERVAL        NOT NULL,
236         normal          INTERVAL        NOT NULL,
237         shrt            INTERVAL        NOT NULL,
238         max_renewals    INT             NOT NULL
239 );
240 COMMENT ON TABLE config.rule_circ_duration IS $$
241 /*
242  * Copyright (C) 2005  Georgia Public Library Service 
243  * Mike Rylander <mrylander@gmail.com>
244  *
245  * Circulation Duration rules
246  *
247  * Each circulation is given a duration based on one of these rules.
248  * 
249  *
250  * ****
251  *
252  * This program is free software; you can redistribute it and/or
253  * modify it under the terms of the GNU General Public License
254  * as published by the Free Software Foundation; either version 2
255  * of the License, or (at your option) any later version.
256  *
257  * This program is distributed in the hope that it will be useful,
258  * but WITHOUT ANY WARRANTY; without even the implied warranty of
259  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
260  * GNU General Public License for more details.
261  */
262 $$;
263
264 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '7_days_0_renew', '7 days', '7 days', '7 days', 0);
265 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '28_days_2_renew', '28 days', '28 days', '28 days', 2);
266 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '3_months_0_renew', '3 mons', '3 mons', '3 mons', 0);
267 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '3_days_1_renew', '3 days', '3 days', '3 days', 1);
268 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2_months_2_renew', '2 mons', '2 mons', '2 mons', 2);
269 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '35_days_1_renew', '35 days', '35 days', '35 days', 1);
270 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '7_days_2_renew', '7 days', '7 days', '7 days', 2);
271 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '1_hour_2_renew', '1 hour', '1 hour', '1 hour', 2);
272 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '28_days_0_renew', '28 days', '28 days', '28 days', 0);
273 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '14_days_2_renew', '14 days', '14 days', '14 days', 2);
274
275
276 CREATE TABLE config.rule_max_fine (
277         id      SERIAL          PRIMARY KEY,
278         name    TEXT            NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
279         amount  NUMERIC(6,2)    NOT NULL
280 );
281 COMMENT ON TABLE config.rule_max_fine IS $$
282 /*
283  * Copyright (C) 2005  Georgia Public Library Service 
284  * Mike Rylander <mrylander@gmail.com>
285  *
286  * Circulation Max Fine rules
287  *
288  * Each circulation is given a maximum fine based on one of
289  * these rules.
290  * 
291  *
292  * ****
293  *
294  * This program is free software; you can redistribute it and/or
295  * modify it under the terms of the GNU General Public License
296  * as published by the Free Software Foundation; either version 2
297  * of the License, or (at your option) any later version.
298  *
299  * This program is distributed in the hope that it will be useful,
300  * but WITHOUT ANY WARRANTY; without even the implied warranty of
301  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
302  * GNU General Public License for more details.
303  */
304 $$;
305
306 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_min', 5.00);
307 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_mid', 10.00);
308 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_max', 100.00);
309 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_equip_min', 25.00);
310 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_equip_mid', 25.00);
311 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'overdue_equip_max', 100.00);
312
313
314 CREATE TABLE config.rule_recuring_fine (
315         id                      SERIAL          PRIMARY KEY,
316         name                    TEXT            NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
317         high                    NUMERIC(6,2)    NOT NULL,
318         normal                  NUMERIC(6,2)    NOT NULL,
319         low                     NUMERIC(6,2)    NOT NULL,
320         recurance_interval      INTERVAL        NOT NULL DEFAULT '1 day'::INTERVAL
321 );
322 COMMENT ON TABLE config.rule_recuring_fine IS $$
323 /*
324  * Copyright (C) 2005  Georgia Public Library Service 
325  * Mike Rylander <mrylander@gmail.com>
326  *
327  * Circulation Recuring Fine rules
328  *
329  * Each circulation is given a recuring fine amount based on one of
330  * these rules.  The recurance_interval should not be any shorter
331  * than the interval between runs of the fine_processor.pl script
332  * (which is run from CRON), or you could miss fines.
333  * 
334  *
335  * ****
336  *
337  * This program is free software; you can redistribute it and/or
338  * modify it under the terms of the GNU General Public License
339  * as published by the Free Software Foundation; either version 2
340  * of the License, or (at your option) any later version.
341  *
342  * This program is distributed in the hope that it will be useful,
343  * but WITHOUT ANY WARRANTY; without even the implied warranty of
344  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
345  * GNU General Public License for more details.
346  */
347 $$;
348
349 INSERT INTO config.rule_recuring_fine VALUES (DEFAULT, '10_cent_per_day', 0.50, 0.10, 0.10, '1 day');
350 INSERT INTO config.rule_recuring_fine VALUES (DEFAULT, '50_cent_per_day', 0.50, 0.50, 0.50, '1 day');
351
352
353 CREATE TABLE config.rule_age_hold_protect (
354         id      SERIAL          PRIMARY KEY,
355         name    TEXT            NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
356         age     INTERVAL        NOT NULL,
357         prox    INT             NOT NULL
358 );
359 COMMENT ON TABLE config.rule_age_hold_protect IS $$
360 /*
361  * Copyright (C) 2005  Georgia Public Library Service 
362  * Mike Rylander <mrylander@gmail.com>
363  *
364  * Hold Item Age Protection rules
365  *
366  * A hold request can only capture new(ish) items when they are
367  * within a particular proximity of the home_ou of the requesting
368  * user.  The proximity ('prox' column) is calculated by counting
369  * the number of tree edges beween the user's home_ou and the owning_lib
370  * of the copy that could fulfill the hold.
371  * 
372  *
373  * ****
374  *
375  * This program is free software; you can redistribute it and/or
376  * modify it under the terms of the GNU General Public License
377  * as published by the Free Software Foundation; either version 2
378  * of the License, or (at your option) any later version.
379  *
380  * This program is distributed in the hope that it will be useful,
381  * but WITHOUT ANY WARRANTY; without even the implied warranty of
382  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
383  * GNU General Public License for more details.
384  */
385 $$;
386
387 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
388 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
389
390
391 CREATE TABLE config.copy_status (
392         id              SERIAL  PRIMARY KEY,
393         name            TEXT    NOT NULL UNIQUE,
394         holdable        BOOL    NOT NULL DEFAULT FALSE
395 );
396 COMMENT ON TABLE config.copy_status IS $$
397 /*
398  * Copyright (C) 2005  Georgia Public Library Service 
399  * Mike Rylander <mrylander@gmail.com>
400  *
401  * Copy Statuses
402  *
403  * The available copy statuses, and whether a copy in that
404  * status is available for hold request capture.  0 (zero) is
405  * the only special number in this set, meaning that the item
406  * is available for imediate checkout, and is counted as available
407  * in the OPAC.
408  *
409  * Statuses with an ID below 100 are not removable, and have special
410  * meaning in the code.  Do not change them except to translate the
411  * textual name.
412  *
413  * You may add and remove statuses above 100, and these can be used
414  * to remove items from normal circulation without affecting the rest
415  * of the copy's values or it's location.
416  *
417  * ****
418  *
419  * This program is free software; you can redistribute it and/or
420  * modify it under the terms of the GNU General Public License
421  * as published by the Free Software Foundation; either version 2
422  * of the License, or (at your option) any later version.
423  *
424  * This program is distributed in the hope that it will be useful,
425  * but WITHOUT ANY WARRANTY; without even the implied warranty of
426  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
427  * GNU General Public License for more details.
428  */
429 $$;
430
431 INSERT INTO config.copy_status (id,name,holdable)       VALUES (0,'Available','t');
432 INSERT INTO config.copy_status (name,holdable)          VALUES ('Checked out','t');
433 INSERT INTO config.copy_status (name)                   VALUES ('Bindery');
434 INSERT INTO config.copy_status (name)                   VALUES ('Lost');
435 INSERT INTO config.copy_status (name)                   VALUES ('Missing');
436 INSERT INTO config.copy_status (name,holdable)          VALUES ('In process','t');
437 INSERT INTO config.copy_status (name,holdable)          VALUES ('In transit','t');
438 INSERT INTO config.copy_status (name,holdable)          VALUES ('Reshelving','t');
439 INSERT INTO config.copy_status (name,holdable)          VALUES ('On holds shelf','t');
440 INSERT INTO config.copy_status (name,holdable)          VALUES ('On order','t');
441 INSERT INTO config.copy_status (name)                   VALUES ('ILL');
442 INSERT INTO config.copy_status (name)                   VALUES ('Cataloging');
443 INSERT INTO config.copy_status (name)                   VALUES ('Reserves');
444 INSERT INTO config.copy_status (name)                   VALUES ('Discard/Weed');
445 INSERT INTO config.copy_status (name)                   VALUES ('Damaged');
446
447 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
448
449
450 CREATE TABLE config.net_access_level (
451         id      SERIAL          PRIMARY KEY,
452         name    TEXT            NOT NULL UNIQUE
453 );
454 COMMENT ON TABLE config.net_access_level IS $$
455 /*
456  * Copyright (C) 2005  Georgia Public Library Service 
457  * Mike Rylander <mrylander@gmail.com>
458  *
459  * Patron Network Access level
460  *
461  * This will be used to inform the in-library firewall of how much
462  * internet access the using patron should be allowed.
463  *
464  * ****
465  *
466  * This program is free software; you can redistribute it and/or
467  * modify it under the terms of the GNU General Public License
468  * as published by the Free Software Foundation; either version 2
469  * of the License, or (at your option) any later version.
470  *
471  * This program is distributed in the hope that it will be useful,
472  * but WITHOUT ANY WARRANTY; without even the implied warranty of
473  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
474  * GNU General Public License for more details.
475  */
476 $$;
477
478 INSERT INTO config.net_access_level (name) VALUES ('Filtered');
479 INSERT INTO config.net_access_level (name) VALUES ('Unfiltered');
480 INSERT INTO config.net_access_level (name) VALUES ('No Access');
481
482 CREATE TABLE config.audience_map (
483         code            TEXT    PRIMARY KEY,
484         value           TEXT    NOT NULL,
485         description     TEXT
486 );
487
488 COPY config.audience_map FROM STDIN;
489         Unknown or unspecified  The target audience for the item not known or not specified.
490 a       Preschool       The item is intended for children, approximate ages 0-5 years.
491 b       Primary The item is intended for children, approximate ages 6-8 years.
492 c       Pre-adolescent  The item is intended for young people, approximate ages 9-13 years.
493 d       Adolescent      The item is intended for young people, approximate ages 14-17 years.
494 e       Adult   The item is intended for adults.
495 f       Specialized     The item is aimed at a particular audience and the nature of the presentation makes the item of little interest to another audience.
496 g       General The item is of general interest and not aimed at an audience of a particular intellectual level.
497 j       Juvenile        The item is intended for children and young people, approximate ages 0-15 years.
498 \.
499
500
501 CREATE TABLE config.lit_form_map (
502         code            TEXT    PRIMARY KEY,
503         value           TEXT    NOT NULL,
504         description     TEXT
505 );
506
507 COPY config.lit_form_map FROM STDIN;
508 0       Not fiction (not further specified)     The item is not a work of fiction and no further identification of the literary form is desired
509 1       Fiction (not further specified) The item is a work of fiction and no further identification of the literary form is desired
510 c       Comic strips    \N
511 d       Dramas  \N
512 e       Essays  \N
513 f       Novels  \N
514 h       Humor, satires, etc.    The item is a humorous work, satire or of similar literary form.
515 i       Letters The item is a single letter or collection of correspondence.
516 j       Short stories   The item is a short story or collection of short stories.
517 m       Mixed forms     The item is a variety of literary forms (e.g., poetry and short stories).
518 p       Poetry  The item is a poem or collection of poems.
519 s       Speeches        The item is a speech or collection of speeches.
520 u       Unknown The literary form of the item is unknown.
521 \.
522
523 CREATE TABLE config.language_map (
524         code    TEXT    PRIMARY KEY,
525         value   TEXT    NOT NULL
526 );
527
528 COPY config.language_map FROM STDIN;
529 aar     Afar
530 abk     Abkhaz
531 ace     Achinese
532 ach     Acoli
533 ada     Adangme
534 ady     Adygei
535 afa     Afroasiatic (Other)
536 afh     Afrihili (Artificial language)
537 afr     Afrikaans
538 -ajm    Aljamía
539 aka     Akan
540 akk     Akkadian
541 alb     Albanian
542 ale     Aleut
543 alg     Algonquian (Other)
544 amh     Amharic
545 ang     English, Old (ca. 450-1100)
546 apa     Apache languages
547 ara     Arabic
548 arc     Aramaic
549 arg     Aragonese Spanish
550 arm     Armenian
551 arn     Mapuche
552 arp     Arapaho
553 art     Artificial (Other)
554 arw     Arawak
555 asm     Assamese
556 ast     Bable
557 ath     Athapascan (Other)
558 aus     Australian languages
559 ava     Avaric
560 ave     Avestan
561 awa     Awadhi
562 aym     Aymara
563 aze     Azerbaijani
564 bad     Banda
565 bai     Bamileke languages
566 bak     Bashkir
567 bal     Baluchi
568 bam     Bambara
569 ban     Balinese
570 baq     Basque
571 bas     Basa
572 bat     Baltic (Other)
573 bej     Beja
574 bel     Belarusian
575 bem     Bemba
576 ben     Bengali
577 ber     Berber (Other)
578 bho     Bhojpuri
579 bih     Bihari
580 bik     Bikol
581 bin     Edo
582 bis     Bislama
583 bla     Siksika
584 bnt     Bantu (Other)
585 bos     Bosnian
586 bra     Braj
587 bre     Breton
588 btk     Batak
589 bua     Buriat
590 bug     Bugis
591 bul     Bulgarian
592 bur     Burmese
593 cad     Caddo
594 cai     Central American Indian (Other)
595 -cam    Khmer
596 car     Carib
597 cat     Catalan
598 cau     Caucasian (Other)
599 ceb     Cebuano
600 cel     Celtic (Other)
601 cha     Chamorro
602 chb     Chibcha
603 che     Chechen
604 chg     Chagatai
605 chi     Chinese
606 chk     Truk
607 chm     Mari
608 chn     Chinook jargon
609 cho     Choctaw
610 chp     Chipewyan
611 chr     Cherokee
612 chu     Church Slavic
613 chv     Chuvash
614 chy     Cheyenne
615 cmc     Chamic languages
616 cop     Coptic
617 cor     Cornish
618 cos     Corsican
619 cpe     Creoles and Pidgins, English-based (Other)
620 cpf     Creoles and Pidgins, French-based (Other)
621 cpp     Creoles and Pidgins, Portuguese-based (Other)
622 cre     Cree
623 crh     Crimean Tatar
624 crp     Creoles and Pidgins (Other)
625 cus     Cushitic (Other)
626 cze     Czech
627 dak     Dakota
628 dan     Danish
629 dar     Dargwa
630 day     Dayak
631 del     Delaware
632 den     Slave
633 dgr     Dogrib
634 din     Dinka
635 div     Divehi
636 doi     Dogri
637 dra     Dravidian (Other)
638 dua     Duala
639 dum     Dutch, Middle (ca. 1050-1350)
640 dut     Dutch
641 dyu     Dyula
642 dzo     Dzongkha
643 efi     Efik
644 egy     Egyptian
645 eka     Ekajuk
646 elx     Elamite
647 eng     English
648 enm     English, Middle (1100-1500)
649 epo     Esperanto
650 -esk    Eskimo languages
651 -esp    Esperanto
652 est     Estonian
653 -eth    Ethiopic
654 ewe     Ewe
655 ewo     Ewondo
656 fan     Fang
657 fao     Faroese
658 -far    Faroese
659 fat     Fanti
660 fij     Fijian
661 fin     Finnish
662 fiu     Finno-Ugrian (Other)
663 fon     Fon
664 fre     French
665 -fri    Frisian
666 frm     French, Middle (ca. 1400-1600)
667 fro     French, Old (ca. 842-1400)
668 fry     Frisian
669 ful     Fula
670 fur     Friulian
671 gaa     Gã
672 -gae    Scottish Gaelic
673 -gag    Galician
674 -gal    Oromo
675 gay     Gayo
676 gba     Gbaya
677 gem     Germanic (Other)
678 geo     Georgian
679 ger     German
680 gez     Ethiopic
681 gil     Gilbertese
682 gla     Scottish Gaelic
683 gle     Irish
684 glg     Galician
685 glv     Manx
686 gmh     German, Middle High (ca. 1050-1500)
687 goh     German, Old High (ca. 750-1050)
688 gon     Gondi
689 gor     Gorontalo
690 got     Gothic
691 grb     Grebo
692 grc     Greek, Ancient (to 1453)
693 gre     Greek, Modern (1453- )
694 grn     Guarani
695 -gua    Guarani
696 guj     Gujarati
697 gwi     Gwich'in
698 hai     Haida
699 hat     Haitian French Creole
700 hau     Hausa
701 haw     Hawaiian
702 heb     Hebrew
703 her     Herero
704 hil     Hiligaynon
705 him     Himachali
706 hin     Hindi
707 hit     Hittite
708 hmn     Hmong
709 hmo     Hiri Motu
710 hun     Hungarian
711 hup     Hupa
712 iba     Iban
713 ibo     Igbo
714 ice     Icelandic
715 ido     Ido
716 iii     Sichuan Yi
717 ijo     Ijo
718 iku     Inuktitut
719 ile     Interlingue
720 ilo     Iloko
721 ina     Interlingua (International Auxiliary Language Association)
722 inc     Indic (Other)
723 ind     Indonesian
724 ine     Indo-European (Other)
725 inh     Ingush
726 -int    Interlingua (International Auxiliary Language Association)
727 ipk     Inupiaq
728 ira     Iranian (Other)
729 -iri    Irish
730 iro     Iroquoian (Other)
731 ita     Italian
732 jav     Javanese
733 jpn     Japanese
734 jpr     Judeo-Persian
735 jrb     Judeo-Arabic
736 kaa     Kara-Kalpak
737 kab     Kabyle
738 kac     Kachin
739 kal     Kalâtdlisut
740 kam     Kamba
741 kan     Kannada
742 kar     Karen
743 kas     Kashmiri
744 kau     Kanuri
745 kaw     Kawi
746 kaz     Kazakh
747 kbd     Kabardian
748 kha     Khasi
749 khi     Khoisan (Other)
750 khm     Khmer
751 kho     Khotanese
752 kik     Kikuyu
753 kin     Kinyarwanda
754 kir     Kyrgyz
755 kmb     Kimbundu
756 kok     Konkani
757 kom     Komi
758 kon     Kongo
759 kor     Korean
760 kos     Kusaie
761 kpe     Kpelle
762 kro     Kru
763 kru     Kurukh
764 kua     Kuanyama
765 kum     Kumyk
766 kur     Kurdish
767 -kus    Kusaie
768 kut     Kutenai
769 lad     Ladino
770 lah     Lahnda
771 lam     Lamba
772 -lan    Occitan (post-1500)
773 lao     Lao
774 -lap    Sami
775 lat     Latin
776 lav     Latvian
777 lez     Lezgian
778 lim     Limburgish
779 lin     Lingala
780 lit     Lithuanian
781 lol     Mongo-Nkundu
782 loz     Lozi
783 ltz     Letzeburgesch
784 lua     Luba-Lulua
785 lub     Luba-Katanga
786 lug     Ganda
787 lui     Luiseño
788 lun     Lunda
789 luo     Luo (Kenya and Tanzania)
790 lus     Lushai
791 mac     Macedonian
792 mad     Madurese
793 mag     Magahi
794 mah     Marshallese
795 mai     Maithili
796 mak     Makasar
797 mal     Malayalam
798 man     Mandingo
799 mao     Maori
800 map     Austronesian (Other)
801 mar     Marathi
802 mas     Masai
803 -max    Manx
804 may     Malay
805 mdr     Mandar
806 men     Mende
807 mga     Irish, Middle (ca. 1100-1550)
808 mic     Micmac
809 min     Minangkabau
810 mis     Miscellaneous languages
811 mkh     Mon-Khmer (Other)
812 -mla    Malagasy
813 mlg     Malagasy
814 mlt     Maltese
815 mnc     Manchu
816 mni     Manipuri
817 mno     Manobo languages
818 moh     Mohawk
819 mol     Moldavian
820 mon     Mongolian
821 mos     Mooré
822 mul     Multiple languages
823 mun     Munda (Other)
824 mus     Creek
825 mwr     Marwari
826 myn     Mayan languages
827 nah     Nahuatl
828 nai     North American Indian (Other)
829 nap     Neapolitan Italian
830 nau     Nauru
831 nav     Navajo
832 nbl     Ndebele (South Africa)
833 nde     Ndebele (Zimbabwe)  
834 ndo     Ndonga
835 nds     Low German
836 nep     Nepali
837 new     Newari
838 nia     Nias
839 nic     Niger-Kordofanian (Other)
840 niu     Niuean
841 nno     Norwegian (Nynorsk)
842 nob     Norwegian (Bokmål)
843 nog     Nogai
844 non     Old Norse
845 nor     Norwegian
846 nso     Northern Sotho
847 nub     Nubian languages
848 nya     Nyanja
849 nym     Nyamwezi
850 nyn     Nyankole
851 nyo     Nyoro
852 nzi     Nzima
853 oci     Occitan (post-1500)
854 oji     Ojibwa
855 ori     Oriya
856 orm     Oromo
857 osa     Osage
858 oss     Ossetic
859 ota     Turkish, Ottoman
860 oto     Otomian languages
861 paa     Papuan (Other)
862 pag     Pangasinan
863 pal     Pahlavi
864 pam     Pampanga
865 pan     Panjabi
866 pap     Papiamento
867 pau     Palauan
868 peo     Old Persian (ca. 600-400 B.C.)
869 per     Persian
870 phi     Philippine (Other)
871 phn     Phoenician
872 pli     Pali
873 pol     Polish
874 pon     Ponape
875 por     Portuguese
876 pra     Prakrit languages
877 pro     Provençal (to 1500)
878 pus     Pushto
879 que     Quechua
880 raj     Rajasthani
881 rap     Rapanui
882 rar     Rarotongan
883 roa     Romance (Other)
884 roh     Raeto-Romance
885 rom     Romani
886 rum     Romanian
887 run     Rundi
888 rus     Russian
889 sad     Sandawe
890 sag     Sango (Ubangi Creole)
891 sah     Yakut
892 sai     South American Indian (Other)
893 sal     Salishan languages
894 sam     Samaritan Aramaic
895 san     Sanskrit
896 -sao    Samoan
897 sas     Sasak
898 sat     Santali
899 scc     Serbian
900 sco     Scots
901 scr     Croatian
902 sel     Selkup
903 sem     Semitic (Other)
904 sga     Irish, Old (to 1100)
905 sgn     Sign languages
906 shn     Shan
907 -sho    Shona
908 sid     Sidamo
909 sin     Sinhalese
910 sio     Siouan (Other)
911 sit     Sino-Tibetan (Other)
912 sla     Slavic (Other)
913 slo     Slovak
914 slv     Slovenian
915 sma     Southern Sami
916 sme     Northern Sami
917 smi     Sami
918 smj     Lule Sami
919 smn     Inari Sami
920 smo     Samoan
921 sms     Skolt Sami
922 sna     Shona
923 snd     Sindhi
924 -snh    Sinhalese
925 snk     Soninke
926 sog     Sogdian
927 som     Somali
928 son     Songhai
929 sot     Sotho
930 spa     Spanish
931 srd     Sardinian
932 srr     Serer
933 ssa     Nilo-Saharan (Other)
934 -sso    Sotho
935 ssw     Swazi
936 suk     Sukuma
937 sun     Sundanese
938 sus     Susu
939 sux     Sumerian
940 swa     Swahili
941 swe     Swedish
942 -swz    Swazi
943 syr     Syriac
944 -tag    Tagalog
945 tah     Tahitian
946 tai     Tai (Other)
947 -taj    Tajik
948 tam     Tamil
949 -tar    Tatar
950 tat     Tatar
951 tel     Telugu
952 tem     Temne
953 ter     Terena
954 tet     Tetum
955 tgk     Tajik
956 tgl     Tagalog
957 tha     Thai
958 tib     Tibetan
959 tig     Tigré
960 tir     Tigrinya
961 tiv     Tiv
962 tkl     Tokelauan
963 tli     Tlingit
964 tmh     Tamashek
965 tog     Tonga (Nyasa)
966 ton     Tongan
967 tpi     Tok Pisin
968 -tru    Truk
969 tsi     Tsimshian
970 tsn     Tswana
971 tso     Tsonga
972 -tsw    Tswana
973 tuk     Turkmen
974 tum     Tumbuka
975 tup     Tupi languages
976 tur     Turkish
977 tut     Altaic (Other)
978 tvl     Tuvaluan
979 twi     Twi
980 tyv     Tuvinian
981 udm     Udmurt
982 uga     Ugaritic
983 uig     Uighur
984 ukr     Ukrainian
985 umb     Umbundu
986 und     Undetermined
987 urd     Urdu
988 uzb     Uzbek
989 vai     Vai
990 ven     Venda
991 vie     Vietnamese
992 vol     Volapük
993 vot     Votic
994 wak     Wakashan languages
995 wal     Walamo
996 war     Waray
997 was     Washo
998 wel     Welsh
999 wen     Sorbian languages
1000 wln     Walloon
1001 wol     Wolof
1002 xal     Kalmyk
1003 xho     Xhosa
1004 yao     Yao (Africa)
1005 yap     Yapese
1006 yid     Yiddish
1007 yor     Yoruba
1008 ypk     Yupik languages
1009 zap     Zapotec
1010 zen     Zenaga
1011 zha     Zhuang
1012 znd     Zande
1013 zul     Zulu
1014 zun     Zuni
1015 \.
1016
1017 CREATE TABLE config.item_form_map (
1018         code    TEXT    PRIMARY KEY,
1019         value   TEXT    NOT NULL
1020 );
1021
1022 COPY config.item_form_map FROM STDIN;
1023 a       Microfilm
1024 b       Microfiche
1025 c       Microopaque
1026 d       Large print
1027 f       Braille
1028 r       Regular print reproduction
1029 s       Electronic
1030 \.
1031
1032 CREATE TABLE config.item_type_map (
1033         code    TEXT    PRIMARY KEY,
1034         value   TEXT    NOT NULL
1035 );
1036
1037 COPY config.item_type_map FROM STDIN;
1038 a       Language material
1039 t       Manuscript language material
1040 g       Projected medium
1041 k       Two-dimensional nonprojectable graphic
1042 r       Three-dimensional artifact or naturally occurring object
1043 o       Kit
1044 p       Mixed materials
1045 e       Cartographic material
1046 f       Manuscript cartographic material
1047 c       Notated music
1048 d       Manuscript notated music
1049 i       Nonmusical sound recording
1050 j       Musical sound recording
1051 m       Computer file
1052 \.
1053
1054 COMMIT;
1055