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