Working with reference data

Getting bibliographic references into and out of the database is a key feature of any bibliographic software. Sure enough refdb-mode has commands to add, update, and retrieve bibliographic data. In addition there are a few commands to convert bibliographic data from and to formats that RefDB does not support natively.

Adding and updating references

To add data from an external source, either load the source file or yank the data into an appropriate empty buffer. If set up correctly, Emacs will use an appropriate major mode to display and edit the data. You can now go ahead and make any changes to the data. refdb-mode commands work on the buffer data, not on the source file. That is, you can edit to your heart's content without having to change the original source files.

When you are ready to commit the data, you'll have to watch out for the following:

  • refdb-mode will accept risx data only if nxml-mode declares the buffer valid (if you use a different mode to edit XML data, no check is available). You cannot add a subset of a buffer as RefDB requires you to send a complete, valid XML document.

  • When working with RIS data, the commands to add or update references either work on a region or on the whole buffer if no region is selected. It is highly recommended to use transient-mark-mode with RIS data. If there is a region, it will be highlighted. To deactivate the mark and use the whole buffer instead, press C-g.

To add the contents of the buffer or of the selected region to the database, use the Add References menu command. If you have retrieved the data from the database and want to commit your changes, use the Update References menu command instead.

Retrieving references

refdb-mode provides a convenient interface to run simple queries. Simple queries are queries which select references by a single field only, e.g. by author or by keyword. In addition there is a command to type in complex queries which uses the same syntax as the getref command of RefDB.

You have to tell refdb-mode where to search for these values. The command names indicate the field to search in. Simple queries come in three flavors:

  • You are prompted to type in the value to search for, which has to match exactly. These commands are in the Get References submenu. Minibuffer completion and history are available to enter or reuse query strings.

  • You are prompted to type in the value, which is a regular expression. These commands are also in the Get References submenu, and completion as well as history are also available. Please be aware that you may have to escape some characters in order to generate valid query strings. The type of regular expression (Unix vs. SQL) depends on the database engine used by RefDB.

  • You select a region with the keyboard or with your mouse and use that as a regular expression. These commands are in the Get References on Region submenu. This type of query comes in handy to look up words or phrases that you write in your document and see whether there are any references that contain these strings as keywords or in the title. It is also useful to display references that you have cited somewhere in your text: just mark the citation key and run a query on this region.

If your query is successful, the *refdb-output* buffer will contain the matching references in the format that you've selected. The *refdb-messages* buffer will indicate the number of retrieved references. If the data are either in RIS or in risx format, you can edit the data right away and update the database.

Converting reference data

Reference data in several formats that RefDB does not understand natively can be converted to RIS. Load the data into a buffer and run the appropriate "From" command in the Convert References submenu.

Going the other way round, RIS data can be exported to formats that RefDB cannot readily create. Use the appropriate "To" command in the Convert References submenu to export the data to EndNote or to MODS.