EPrints 2.2 Documentation - import_subjects command



NAME

import_subjects - rebuild an EPrint archive subjects list from the contents of a file


SYNOPSIS

import_subjects archiveid [options] [subjectfile]


DESCRIPTION

Import a set of subjects into an EPrints archive. The subjects are the heirarchical tree of options for ``subject'' type metadata fields in an eprint archive.

Use the staff admin subject editor for little tweaks. Use this command for the initial setup or bulk editing subjects. Use the exporter to dump the current subjects if you (an administrator) have edited them online.

This script should also be run after create_tables.


ARGUMENTS

archiveid
The ID of the EPrint archive to use.

subjectfile
This is the file to import the subjects from. If you do not specify it then the system will use ``subjects'' from the given archives cfg directory (or ``subjects.xml'' if you used --xml).


OPTIONS

--help
Print a brief help message and exit.

--man
Print the full manual page and then exit.

--quiet
Be vewwy vewwy quiet. This option will supress all output unless an error occurs.

--verbose
Explain in detail what is going on. May be repeated for greater effect.

--version
Output version information and exit.

--xml
Instead of using colon sepearted subject file, the input file is in the XML format which the exporter uses.

--nopurge
Do not purge the existing records from the subject table before importing this file. Rather than do this, it's probably easier to export the current subjects as XML, then combine in your new file and reimport it.


FILE FORMAT

There are two different file formats excepted, the default colon seperated file and XML in the eprints export format.

The colon seperated ASCII is easier to edit, but is more limited. It is not intended for UTF-8 encoded characters and can only specify subject names in the default language.

The XML format can contain any unicode characters and also allows multiple languages for the names of subjects. You may wish to dump the current subjects out of eprints as XML. Edit it. Then re-import it. The downside is that this format is far more verbose.

The ASCII Default Format

This is the default format.

Comments may be placed on lines begining with a hash (#)

Each (non-comment) line of the file should be in the following format:

subjectid:name:parents:depositable

eg.

blgc-bphy:Biophysics:blgc,phys:1

Please see the main documentation for the meaning of these fields.

subjectid
An ASCII string which is a unique ID for this subject.

name
The name of this subject, in the default language of the archive.

parents
A comma seperated list of the parents of this subject. Be careful not to cause loops. The top level subject id is ROOT and should not be imported as it always exists.

depositable
A boolean value ( 1 or 0 ) which indicates if this subject may have eprints associated with it.

The XML File Format

This is the standard eprints export format. It looks like this:

  <eprintsdata>
    <record>
      <field name="subjectid">phys</field>
      <field name="name"><lang id="en">Physical Sciences &amp; Mathematics</lang></field>
      <field name="parents">subjects</field>
      <field name="depositable">FALSE</field>
    </record>
    .
    .
    .
  </eprintsdata>

The fields have the same meaning as described for the ASCII format, with the following variations. The name field can (and should) have a name for each language supported by the archive. Multiple parents are indicated by multiple <ltfield name=``parents<gt>> elements. Depositable should be either TRUE or FALSE.


AUTHOR

This is part of this EPrints 2 system. EPrints 2 is developed by Christopher Gutteridge.


VERSION

EPrints Version: 2.2.1


CONTACT

For more information goto http://www.eprints.org/ which give information on mailing lists and the like.

Chris Gutteridge may be contacted at support@eprints.org

Should you need a real world address for some reason, EPrints can be contacted in the real world at

 EPrints c/o Christopher Gutteridge
 Department of Electronics and Computer Science
 University of Southampton
 SO17 1BJ
 United Kingdom


COPYRIGHT

This file is part of EPrints 2.

Copyright (c) 2000,2001,2002 University of Southampton, UK. SO17 1BJ.

EPrints 2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

EPrints 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with EPrints 2; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

 EPrints 2.2 Documentation - import_subjects command