Getting intimate with the YAZ client

Posted on May 31st, 2012 by Paul Stainthorp

Screenshot of the YAZ client

As part of our discovery and reading list projects, I’ve had to get even more familiar with Z39.50* as a method of retrieving MARC records from our Horizon catalogue.

(*I can hear the groans even now.)

I had been using the Library of Congress’s Z39.50 test search form along with (Basedow Information Systems’) Mercury client software to test our Z setup, but I was beginning to find that we needed more flexibility. Enter YAZ, a “programmers’ toolkit supporting the development of Z39.50/SRW/SRU clients and servers”.

YAZ comes with a(n initially scary but actually very useful) command-line client for dialling up databases over Z39.50, querying them, and displaying the results retrieved. Here are my notes on how to use it with our own catalogue.

open tcp:www.library.lincoln.ac.uk:210/lincoln

format 1.2.840.10003.5.102

find @attr 1=1016 “<search_phrase>

  • Searches the catalogue for <search_phrase> using attribute code number 1016 (“Any”), which is paired with our HiP keyword index .GW (General Keyword). Here’s a list of some Z39.50 attribute codes, and the University of Lincoln HiP indexes which which they correspond (N.B. we can tweak these using HiP admin):
    • 4 (Title) = .TW (Title Keyword)
    • 7 (ISBN) = ISBNEX (ISBN/ISSN Exact Match)
    • 8 (ISSN) = ISBNEX (ISBN/ISSN Exact Match)
    • 12 (Local number) = .BI (Bib#)
    • 27 (LC subject heading) = .SW (Subject Keyword)
    • 1003 (Author) = .AW (Author Keyword)
    • 1016 (Any) = .GW (General Keyword)

Boolean searches can be constructed by using @and, @or, etc. For example:

find @and @attr 1=4 “newspapers” @attr 1=1003 “Keeble”

~~~~~~~~~~

show

  • This displays the first record matching the most recent ‘find’ command. Repeating ‘show’ returns each subsequent record in turn.

close

  • Closes the connection to the Z server.

Couple of final links:

Tags: , , , , , , , , , ,

Leave a Reply