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