Tutorial on setting up Zebra: A Z39.50 Server ARD Prasad DRTC Indian Statistical Institute Bangalore
Open Source Software Can be downloaded from – Written in ANSI C Can be compiled with gcc Runs on any flavor of Unix including Linux
Features of Zebra Server Can handle large files across many disks Records can be deleted or updated on the fly Can handle many input formats like SGML, XML, ISO-2709 Search supports Boolean, truncation, regular expressions, approximate matching
Features …
Extra Utilities Yaz: makes Zebra z39.50/SRW compliant Iconv: converts MARC data into various character encoding systems including UNICODE Expat: An XML parser useful for indexing records in XML format Perl Modules: for Zebra Perl filter facility Tcl: Record filters for Zebra
Two ways of Installation Using ‘rpm’ or 'deb' files Using tar.gz files ‘rpm’ / 'deb' installation is easier, but OS and version dependent tar.gz installation is complex but safer
RPM Installation Download rpm file from indexdata Issue the following command as root user –rpm –ivh idzebraxxx.rpm –Where xxx is version number
Debian Installation deb xxx main deb-src xx main NOTE: replace xxxxx by the version of debian e.g. etch lenny etc. Add the above lines in /etc/apt/sources.list
Getting the Key wget sudo apt-key add indexdata.asc
Ubuntu installation deb xxx main deb-src xxx main NOTE: replace xxx by Ubuntu version and add the above lines in /etc/apt/sources.list
Getting the Key wget sudo apt-key add indexdata.asc
tar.gz file installation Download idzebra-xxx.tar.gz file Unzip and untar –tar zxvf idzebra-xxx.tar.gz cd idzebra-xxx./configure –help./configure Make Make install
Files will be located in … /usr/bin /usr/include /usr/share/idzebra /usr/share/man
Optionally… If you are not the system administrator, you can run zebra server from you home directory. Run the following commands –tar zxvf idzebra-xxx.tar.gz –cd idzebra-xxx –./configure –prefix=$HOME –make –make install
Directory structure $HOME/bin –Will have zebraidx and zebrasrv $HOME/include –Include files $HOME/share –Manual pages
Testing with MARC21 cd idzebra-xxx/test/usmarc You should see… –zebra.cfg (configuration file) –records (directory ) Records directory will be having a file called ‘sample-marc’ ‘sample-marc’ contains MARC21 records in ISO format
Generating the index Run the following command –zebraidx update records Index files are created with the extension ‘.mf’ This is essential for search Now you can start the z39.50 server
Starting Z39.50 Server Run the following command –zebrasrv You will see the following message 09:35:09-09/12 [log] zebra_start zebra.cfg :35:09-09/12 [server] Adding dynamic listener on id=0 09:35:09-09/12 [server] Starting server zebrasrv pid= st Line: version number of the zebra server 2 nd Line: zebra server is running on port rd Line: Process id of program is 8856
Testing with MARCXML cd test/marcxml You will see marcxml files –m1.xml, m2.xml, m3.xml Create a directory called ‘records’ and copy xml files into it –cd records –cp *.xml records Note: here each record is placed in a separate file, unlike the iso-2709 files where all the records are placed in one file
Generating Index and Running the server It is similar to the earlier approach Run the following commands –zebraidx update records –zebrasrv
Main commands Zebrasrv: Server and Search Engine Zebraidx: indexing tool Normally stored in /usr/bin If you are not super user and installed from your home directory, these files will be in $HOME/bin
Z39.50 server for your data Get your MARC21 records either in ISO format or MARCXML Place them in a directory Run zebraidx and zebrasrv NOTE: In case of ISO-2709 format, all the records are in one file. Where as in case of MARCXML each record is in a separate XML file
zebraidx syntax zebraidx [ -options ] command [ file... ] Command: –update directory (update the register with the files in directory. Ex: update records means reads iso or xml files in the directory called ‘records’) –delete directory (remove the records corresponding to the files in directory)
zebraidx cont… Commands create database (Ex: ‘create drtc’. Creates a database called ‘drtc’, which can be accessed by that name using a z39.50 client. If no database name is given, the database will be called ‘default’ Drop database
zebrasrv options
iconv
Yaz-marcdump