Thursday, October 7, 2010

Greenstone Z39.50 lookup to Library of Congress

In Greenstone 2.83 for Windows click the Download tab and select Z3950. Type in the following settings:

HOST: z3950.loc.gov
PORT: 7090
DATABASE: voyager
FIND: @attr 1=4 "SQL"

This sets up a connection to the Library of Congress Z39.50 server and does a search for books with SQL in the title.

Tick the max records checkbox and set the number to 5.
Click Download to start the retrieval

The search log indicates it completes successfully but no file of marc records is found in Application Data folder:

from Yaz log:

Opening connection to z3950.loc.gov:7090
Access database: "voyager"
Searching for keyword: "@attr 1=4 SQL "
<>
Yaz is Gathering records: 1 - 50
<>
Saving records to "\files3\Faculty$\users\gnickers\Application Data\Greenstone\GLI\cache\z3950.loc.gov\voyager_@attr 1=4 SQL _50.marc"
Closing connection...

The log file was written in:

U:\Application Data\Greenstone\GLI\log\download-Z3950994507293.log

but no .marc file. I tested with 500 records and 50 records and 5 records. I created z3950 folder manually and re-ran query. No joy. The Greenstone documentation notes:

"You can view the downloaded MARC files on the Gather panel. On the left-hand side of the panel, double click the Downloaded Files folder to expand its content. The subfolders are named by the Z39.50 server url. The MARC files are named as the combination of database name, query, and max_records if max_records is specified. These MARC files are physically stored in a temporary cache directory. "

This could be a Greenstone bug, further investigation reveals 3 PERL errors. The c:\program files\greenstone\perlib\downloaders\Z3950Download.pm file at:

Line 146
Line 156
Line 159

Next we replaced the voyager database label with
LCDB

Which i got from the loc page. In fact i replace the greenstone settings, which seem quite old with:

HOST: lx2.loc.gov
PORT: 210
DATABASE: LCDB
FIND: @attr1=4 "SQL"
MAX RECORDS: 5

which retrieved 5 records but none were saved. I changed the MODE setting from Librarian to Expert and re-ran the query. No joy. We then removed the max records setting and got 500 hits. Nothing saved.

I also tried the OAI harvester function, although this is not supposed to work on the local version, only on the server install.

Select Download, OAI and enter the following settings:

SOURCE URL: http://memory.loc.gov/cgi-bin/oai2_0
RESTRICT to SET: cwp
MAX RECORDS: 5

Click DOWNLOAD and see what happens. 0 of 5 files are retrieved and the log shows:

Parsing OAI identifiers.....
<>
Gathering OAI record with ID oai:lcoa1.loc.gov:loc.pnp/cph.3a00275.....
Unable to save oai metadata record: No such file or directory

Looks like it kind of worked except there was no place to save it or no file to save. An examination of the perl code might help.

I also tried the SRU function using the information supplied in the Greenstone documentation but we could not get a connection. The log shows:

Opening connection to http://z3950.loc.gov :7090
Cannot connect to http://z3950.loc.gov :7090

We tried the LOC SRW server at:
http://lx2.loc.gov:210/LCDB? 
But Greenstone gave error messages in trying to connect.
For details on the LOC server see: http://www.loc.gov/z3950/lcserver.html

Would be very interested in seeing an example or hearing from someone who has this working!

1 comment:

gnickers said...

OK - we got it working, see the updated post. It fails in the computer labs for unknown reasons...