# Reference database design

This section gives an overview over the design of the reference database with MySQL as the database server. The same design is used with the other database engines, although the details may differ somewhat. This will be mentioned where appropriate.

The requirements of the database necessitate some tables which hold the data proper and some tables which cross-reference these tables.

## The table t_meta

The t_meta table contains the following meta-information about the database:

meta_app

  This string contains the name of the application that created the database.

meta_version

  This string contains the version number of the application that created the database.

meta_type

  This string describes the type of the database. Currently only the type "risx" is supported.

meta_create_date

  This timestamp is set by refdbd when the database is created.

meta_modify_date

  This timestamp is updated by refdbd whenever the database is changed.

## The table t_refdb

This table is the main table of the database and holds all fields which are unique to one reference entry and not different between users.

This table contains the following columns:

refdb_id

  This unique identifier for entries in t_refdb is automatically generated by refdb and is stored as a BIGINT value (INTEGER for SQLite).

refdb_citekey

  This is a user-supplied unique identifier for entries in t_refdb. If not supplied by the user, RefDB will create a unique identifier when the entry is added.

refdb_type

  This indicates the type of the document. This six-character string must be one of the following:

  - ABST (abstract reference)

  - ADVS (audiovisual material)

  - ART (art work)

  - BILL (bill/resolution)

  - BOOK (whole book reference)

  - CASE (case)

  - CHAP (book chapter reference)

  - COMP (computer program)

  - CONF (conference proceeding)

  - CTLG (catalog)

  - DATA (data file)

  - ELEC (electronic citation)

  - GEN (generic)

  - ICOMM (internet communication)

  - INPR (in press reference)

  - JFULL (journal - full)

  - JOUR (journal reference)

  - MAP (map)

  - MGZN (magazine article)

  - MPCT (motion picture)

  - MUSIC (music score)

  - NEWS (newspaper)

  - PAMP (pamphlet)

  - PAT (patent)

  - PCOMM (personal communication)

  - RPRT (report)

  - SER (serial - book, monograph)

  - SLIDE (slide)

  - SOUND (sound recording)

  - STAT (statute)

  - THES (thesis/dissertation)

  - UNBILL (unenacted bill/resolution)

  - UNPB (unpublished work reference)

  - VIDEO (video recording)

refdb_pubyear

  This numerical value (SMALLINT) indicates the publication year.

refdb_secyear

  This numerical value (SMALLINT) indicates the secondary year information.

refdb_startpage

  This alphanumeric string (up to 255 characters) contains the start page information.

refdb_endpage

  This alphanumeric string (up to 255 characters) contains the end page information.

refdb_abstract

  This variable-length string contains the abstract or table of contents of the entry.

refdb_title

  This alphanumeric field of variable length contains the title of the entry.

refdb_volume

  This alphanumeric field (up to 255 characters) contains the volume number or identifier of the periodical.

refdb_issue

  This alphanumeric field (up to 255 characters) contains the issue number or specifier.

refdb_booktitle

  This alphanumeric field of variable length contains the book title (book chapter or whole book reference).

refdb_city

  This alphanumeric field (up to 255 characters) contains the city where the periodical or book was published.

refdb_publisher

  This alphanumeric field (up to 255 characters) contains the name of the publisher.

refdb_title_series

  This alphanumerical field of variable length contains the title of a series of books or publications.

refdb_address

  This alphanumeric field of variable length holds the address of the corresponding author and other contact information.

refdb_url

  This alphanumeric field (up to 255 characters) holds a URL related to the entry, e.g. the homepage of an author or a link to an electronic reprint.

refdb_issn

  This alphanumeric field with a maximum of 255 characters stores the ISSN or ISBN number of the publication.

refdb_pyother_info

  This alphanumeric field with a maximum of 255 characters stores the additional information of a PY field after the publication year. The format is /MM/DD/otherinfo, with MM being the month and DD being the day of the publication. If either of these is missing, the corresponding slash / still has to be entered. The other information is free alphanumeric information.

refdb_secother_info

  This alphanumeric field with a maximum of 255 characters provides the same additional information for the refdb_secyear field as the refdb_pyother_info field for refdb_pubyear.

refdb_periodical_id

  This BIGINT (INTEGER for SQLite) variable points to the periodical_id in t_periodical which corresponds to the periodical the given article appeared in.

refdb_user1 through refdb_user5

  These alphanumeric fields with a maximum of 255 characters provide space for user-defined information.

refdb_typeofwork

  This alphanumeric field with a maximum of 255 characters stores tye type of work of some reference types.

refdb_area

  This alphanumeric field with a maximum of 255 characters stores the area information of MAP entries.

refdb_ostype

  This alphanumeric field with a maximum of 255 characters stores the type of the operating system of a computer program.

refdb_degree

  This alphanumeric field with a maximum of 255 characters stores the type of the degree of a THES reference..

refdb_runningtime

  This alphanumeric field with a maximum of 255 characters stores the running time of several multimedia reference types.

refdb_classcodeintl

  This alphanumeric field with a maximum of 255 characters stores the international class code of PAT references.

refdb_classcodeus

  This alphanumeric field with a maximum of 255 characters stores the US class code of PAT references.

refdb_senderemail

  This alphanumeric field with a maximum of 255 characters stores the email address of the sender of an ICOMM reference.

refdb_recipientemail

  This alphanumeric field with a maximum of 255 characters stores the email address of the recipient of an ICOMM reference.

refdb_mediatype

  This alphanumeric field with a maximum of 255 characters stores the type of the medium of a reference.

refdb_numvolumes

  This alphanumeric field with a maximum of 255 characters stores the total number of volumes of a monographic item which is part of a limited series.

refdb_edition

  This alphanumeric field with a maximum of 255 characters stores the edition of a monographic item.

refdb_computer

  This alphanumeric field with a maximum of 255 characters stores the type of computer of a COMP reference.

refdb_conferencelocation

  This alphanumeric field with a maximum of 255 characters stores the location of a conference of a CONF entry.

refdb_registrynum

  This alphanumeric field with a maximum of 255 characters stores the registry number of JFULL entries.

refdb_classification

  This alphanumeric field with a maximum of 255 characters stores the classification of multimedia entries.

refdb_section

  This alphanumeric field with a maximum of 255 characters stores the section of a NEWS entry.

refdb_pamphletnum

  This alphanumeric field with a maximum of 255 characters stores the number of the pamphlet of a PAMP entry.

refdb_chapternum

  This alphanumeric field with a maximum of 255 characters stores the number of the chapter of a CHAP entry.

## The table t_author

This table is a list of all authors, editors, and series editors.

author_id

  The unique identifier of each author is stored as a BIGINT value (INTEGER for SQLite).

author_name

  The name of the author is stored in a alphanumerical field (maximum lenght 255 characters). The name has the format Lastname[,(F.|First)[(M.|Middle)[,Suffix]]].

## The table t_keyword

This table is a list of all keywords.

keyword_id

  The unique identifier of each keyword is stored as a BIGINT value (INTEGER for SQLite).

keyword_name

  This field holds the keyword (key phrase may be a better word as a keyword may consist of any alphanumeric string, including spaces). The maximum size is 255 characters.

## The table t_periodical

This table is a list of all periodicals.

periodical_id

  This is the unique identifier of each periodical and is stored as a BIGINT value (INTEGER for SQLite).

periodical_name

  This is the full, unabbreviated name of the periodical. This is an alphanumeric field with a limit of 255 characters.

  Examples: Trends in Biochemical Sciences; Proceedings of the National Academy of Sciences of the United States of America

periodical_abbrev

  This is the official abbreviation of the periodical as seen in the Index Medicus. Abbreviated words have a trailing period. All words are separated by a space. This is also an alphanumeric field with a maximum of 255 characters.

  Examples: Trends Biochem. Sci.; Proc. Natl. Acad. Sci. USA

periodical_custabbrev1

  This is a custom abbreviation, often shorter and more popular than the official abbreviation. This is again an alphanumeric field with a limit of 255 characters.

  Examples: TIBS; PNAS

periodical_custabbrev2

  This is another custom abbreviation, often shorter and more popular than the official abbreviation. This is again an alphanumeric field with a limit of 255 characters.

## The table t_note

This table contains the extended notes.

note_id

  This unique identifier for entries in t_note is automatically generated by RefDB and is stored as a BIGINT value (INTEGER for SQLite).

note_key

  This is a user-supplied unique identifier for entries in t_note. If not supplied by the user, RefDB will create a unique identifier when the entry is added.

note_title

  This alphanumeric field (up to 255 characters) contains the title of the entry.

note_content

  This alphanumeric field of unlimited length contains the text of the note.

note_content_type

  This alphanumeric field (up to 255 characters) contains the type of the data in the note_content field.

note_content_xmllang

  This alphanumeric field (up to 255 characters) contains an identifier of the language of the data in the note_content field.

note_user_id

  This BIGINT (INTEGER for SQLite) variable points to the user_id in t_user which corresponds to the user who created the note.

note_date

  This DATETIME field stores the date the note was added, or any other user-supplied date.

note_share

  This short integer field stores whether the note may be shared with others (value != zero) or not (value = zero).

## The table t_user

This table contains the information about the users accessing the database. This information is used to track the person who added a specific article and the persons who are interested in a particular article.

user_id

  The unique ID of each user is stored as a BIGINT value (INTEGER for SQLite).

user_name

  This alphanumeric field holds the mySQL login name of the user (maximum length is 16 characters). The length limit is imposed by MySQL.

## The table t_link

This table contains URLs.

link_id

  The unique ID of each user is stored as a BIGINT value (INTEGER for SQLite).

link_url

  This alphanumeric field of unlimited length contains the URL.

## The table t_xauthor

This table cross-references the tables t_author and t_refdb.

xauthor_id

  This is the unique ID of a t_xauthor entry, stored as a BIGINT value (INTEGER for SQLite).

author_id

  This is the ID of the author in the t_author table, stored as a BIGINT value (INTEGER for SQLite).

refdb_id

  This is the ID of the reference in the t_refdb table, stored as a BIGINT value (INTEGER for SQLite).

xauthor_type

  This ENUM field has the three possible values primary, secondary, and tertiary which denote that the person is a regular author, an editor, or a series editor in the given reference, respectively. PostgreSQL implements this as a SMALLINT value, SQLite uses a TEXT field.

xauthor_position

  This INT field stores the original position of the author in the paper. The sequence of authors is taken from the sequence they appear in the RIS file.

## The table t_xkeyword

This table cross-references the tables t_keyword and t_refdb.

xkeyword_id

  The unique ID of an t_xkeyword entry is stored as a BIGINT value (INTEGER for SQLite).

keyword_id

  This BIGINT value (INTEGER for SQLite) points to the ID of the keyword in the table t_keyword.

refdb_id

  This is the ID of the reference in the t_refdb table, stored as a BIGINT value (INTEGER for SQLite).

## The table t_xuser

This table cross-references the tables t_user and t_refdb.

xuser_id

  The unique ID of an t_xuser entry is stored as a BIGINT value (INTEGER for SQLite).

user_id

  This BIGINT value (INTEGER for SQLite) points to the ID of the user in the table t_user.

refdb_id

  This is the ID of the reference in the t_refdb table, stored as a BIGINT value (INTEGER for SQLite).

xuser_reprint

  This alphanumeric string must contain one of the following:

  - NOT IN FILE (this is the default if nothing is specified)

  - ON REQUEST

  - IN FILE

xuser_date

  This DATE field holds the date when a reprint was requested. If xuser_reprint contains something else than ON REQUEST, this field is not relevant.

xuser_avail

  This alphanumeric field with a maximum of 255 characters contains the information where a physical copy of the article is stored. This may be a room number, a contact person, a binder or folder name or anything else that helps to track that copy down. This field is irrelevant if the reprint status is not IN FILE.

xuser_notes

  This alphanumeric field of variable length contains notes or comments added by the user.

## The table t_xnote

This table cross-references the tables t_note and t_refdb.

xnote_id

  The unique ID of an t_xnote entry is stored as a BIGINT value (INTEGER for SQLite).

note_id

  This BIGINT value (INTEGER for SQLite) points to the ID of the extended note in the table t_note.

xref_id

  This is the ID of the database item that the note is linked to, stored as a BIGINT value (INTEGER for SQLite).

xnote_type

  This field stores which type of database item (reference, keyword, author, periodical) the note is attached to.

## The table t_xlink

This table cross-references the tables t_link and t_refdb.

xlink_id

  The unique ID of an t_xlink entry is stored as a BIGINT value (INTEGER for SQLite).

link_id

  This BIGINT value (INTEGER for SQLite) points to the ID of the link in the table t_link.

xref_id

  This is the ID of the database item that the note is linked to, stored as a BIGINT value (INTEGER for SQLite).

xlink_type

  This field stores the type of the link (URL, PDF, fulltext, related, or image).

xlink_source

  This field stores whether the link is used in a reference or in a note.