User Tools

Site Tools


en:user_advanced:z3950

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:user_advanced:z3950 [2014/04/13 23:52] – external edit 127.0.0.1en:user_advanced:z3950 [2023/03/13 01:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +
 +
 +
 ====== Z39.50====== ====== Z39.50======
 **[[http://www.loc.gov/z3950/agency/|Z39.50]]** is an international client/server protocol for searching bibliographic data. It can use the Internet Protocol (TCP/IP), which makes the databases on a server available from almost anywhere around the globe. It is widely used, for example, in on-line library catalogues. It allows a user to search one or more databases and retrieve the results of the query. **[[http://www.loc.gov/z3950/agency/|Z39.50]]** is an international client/server protocol for searching bibliographic data. It can use the Internet Protocol (TCP/IP), which makes the databases on a server available from almost anywhere around the globe. It is widely used, for example, in on-line library catalogues. It allows a user to search one or more databases and retrieve the results of the query.
  
-Greenstone has support for Z39.50, both as a client and a server. GLI can download MARC records using Z39.50 and MARCXML records using SRU. These records can then be included in a collection. This support is enabled by default.+Greenstone has support for Z39.50, both as a client and a server. GLI (in Greenstone 2 and 3) can download MARC records using Z39.50 and MARCXML records using SRU. These records can then be included in a collection. This support is enabled by default.
  
-The Greenstone run-time can also act as a client to multiple Z39.50 servers, and a Z39.50 server program is also available.  This support is not enabled by default, and recompilation is needed to enable it. To do this, you need the source code. If you don't already have the source, download the version of the source code component that matches the distribution you are using.+The Greenstone run-time can act as a client to multiple Z39.50 servers, and a Z39.50 server program is also available.  This support is not enabled by default, and recompilation is needed to enable it. To do this, you need the source code. If you don't already have the source, download the version of the source code component that matches the distribution you are using.
  
-Z39.50 support in Greenstone is based around the YAZ toolkit, written by [[http://www.indexdata.dk/|IndexData]]. We are currently using YAZ version 2.1.4. This is included in the Greenstone distribution without modification. Greenstone links against the ''libyaz.a'' library. We have also written ''yaz_zclient.h/cpp'', which is based on the sample ''client.h/cpp''. This is found in //greenstone/runtime-src/src/z3950//.+Z39.50 support in Greenstone is based around the YAZ toolkit, written by [[http://www.indexdata.dk/|IndexData]]. We are currently using YAZ version 2.1.4. This is included in the Greenstone distribution without modification. Greenstone links against the ''libyaz.a'' library. We have also written ''yaz_zclient.h/cpp'', which is based on the sample ''client.h/cpp''. This is found in //greenstone/runtime-src/src/z3950//.
  
 ===== Download through Z39.50 ===== ===== Download through Z39.50 =====
 See the [[en:user:download|download]] page for general information on downloading records through Greenstone.  See the [[en:user:download|download]] page for general information on downloading records through Greenstone. 
  
-Greenstone can download records from a specified Z39.50 server from the GLI (from the Download panel) or the command line (using the ''downloadfrom.pl'' script). Either way, you are presented with five options: +Greenstone (2 and 3) can download records from a specified Z39.50 server from the GLI (from the Download panel) or the command line (using the ''downloadfrom.pl'' script). Either way, you are presented with five options: 
  
 ^Argument^Description^ ^Argument^Description^
-|Host (''-host'')|(REQUIRED) name of the Z39.50 server, for example //z3950.loc.gov//+|Host (''-host'')|(REQUIRED) name of the Z39.50 server, for example // lx2.loc.gov//
-|Port (''-port'')|(REQUIRED) port number of the server, for example //7090//| +|Port (''-port'')|(REQUIRED) port number of the server, for example //210//| 
-|Database (''-database'')|(REQUIRED) name of the database to which the query will be sent| +|Database (''-database'')|(REQUIRED) name of the database to which the query will be sent, for example // LCDB_MARC8//
-|Find (''-find'')| (REQUIRED) query (//[[#querying in YAZ|see below]]//)|+|Find (''-find'')| (REQUIRED) query, for example //mozart// (//[[#querying in YAZ|see below]]//)|
 |Max records (''-max_records'')|Select to limit the size of result set; Default: 500| |Max records (''-max_records'')|Select to limit the size of result set; Default: 500|
  
Line 24: Line 27:
  
 If downloading via the command line, a folder containing the files will be downloaded into the directory from which you run the script (unless the ''-cache_dir <full-path-to-folder>'' option is set). If downloading via the command line, a folder containing the files will be downloaded into the directory from which you run the script (unless the ''-cache_dir <full-path-to-folder>'' option is set).
 +
 +To see the script options, run
 +<code>
 +downloadfrom.pl -h   (shows the general downloading options)
 +downloadfrom.pl -download_mode Z3950 -h  (shows the specific options for Z3950 mode)
 +</code>
 +
 +A sample command might be
 +<code>
 +downloadfrom.pl -download_mode Z3950 -host lx2.loc.gov -port 210 -database LCDB_MARC8 -find "snails" -max_records 10
 +</code>
 +
 +This will make a folder called lx2.loc.gov in the folder that you ran the command from, containing a MARC file with your result records.
  
 As the files downloaded via Z39.50 are in MARC format, they can be processed by [[en:plugin:MARCPlugin|MARCPlugin]], which must be included in the collection plugin list.  As the files downloaded via Z39.50 are in MARC format, they can be processed by [[en:plugin:MARCPlugin|MARCPlugin]], which must be included in the collection plugin list. 
 +
 +[[https://www.loc.gov/z3950/lcserver.html#addr]] shows a list of the Library of Congress Z39.50 catalogs.
 +
  
 ==== Querying in YAZ ==== ==== Querying in YAZ ====
Line 38: Line 57:
 Greenstone also supports downloading from a Z39.50 server through SRU. If using the GLI, select SRU on the Download panel. The options for SRU are the same as for Z39.50 download, but different //host// and //port// values should be used here. For example, to connect to the Library of Congress Z39.50 server through SRU, the following host and port should be specified: Greenstone also supports downloading from a Z39.50 server through SRU. If using the GLI, select SRU on the Download panel. The options for SRU are the same as for Z39.50 download, but different //host// and //port// values should be used here. For example, to connect to the Library of Congress Z39.50 server through SRU, the following host and port should be specified:
 <code> <code>
- host: http://z3950.loc.gov + host: http://lx2.loc.gov 
- port: 7090/voyager?+ port: 210/LCDB?
 </code> </code>
  
Line 50: Line 69:
 To build a collection using the downloaded XML files, [[en:plugin:MARCXMLPlugin|MARCXMLPlugin]] must be added to the collection plugin list.  To build a collection using the downloaded XML files, [[en:plugin:MARCXMLPlugin|MARCXMLPlugin]] must be added to the collection plugin list. 
  
-===== Compiling Greenstone with Z39.50 support =====+===== Compiling Greenstone with Z39.50 support =====
  
   * Linux/MacOS: in the top level greenstone directory, run   * Linux/MacOS: in the top level greenstone directory, run
Line 70: Line 89:
     * To enable iconv or xml2, edit greenstone\runtime-src\win32.mak, and remove HAVE_ICONV=0 and/or HAVE_LIBXML2=0 from the make command for Yaz. You'll need to install these libraries.     * To enable iconv or xml2, edit greenstone\runtime-src\win32.mak, and remove HAVE_ICONV=0 and/or HAVE_LIBXML2=0 from the make command for Yaz. You'll need to install these libraries.
  
-===== Using the Z39.50 client =====+===== Using the Greenstone 2 Z39.50 client =====
  
-Once Greenstone has Z39.50 support compiled in, it can act as a client to multiple z39.50 servers. The file +Once Greenstone has Z39.50 support compiled in, it can act as a client to multiple z39.50 servers. The file ''Greenstone/etc/packages/z3950/z3950.cfg'' specifies a list of servers to connect to. By default, no servers are set up, although the config file comes with one (commented out) example Z39.50 server, for the United States' Library of Congress.
-<TABAREA tabs="Greenstone3,Greenstone2"> +
-<TAB>''Greenstone/gs2build/etc/packages/z3950/z3950.cfg''</TAB> +
-<TAB>''Greenstone/etc/packages/z3950/z3950.cfg''</TAB> +
-</TABAREA> +
- +
- specifies a list of servers to connect to. By default, no servers are set up, although the config file comes with one (commented out) example Z39.50 server, for the United States' Library of Congress.+
  
 Each entry consists of: Each entry consists of:
Line 95: Line 108:
 Greenstone will display a new "collection" for each server listed. Greenstone will display a new "collection" for each server listed.
  
-===== Using the z3950 server =====+===== Using the Greenstone 2 z3950 server =====
  
   * The z3950server program is installed into ''bin/linux'' (or ''bin/darwin'', ''bin/windows'', depending on the operating system). It can be run from there, or copied to somewhere else.   * The z3950server program is installed into ''bin/linux'' (or ''bin/darwin'', ''bin/windows'', depending on the operating system). It can be run from there, or copied to somewhere else.
   * The ''gsdlsite.cfg'' file needs to be copied from the cgi-bin directory to the directory you are running z3950server from. Check that the 'gsdlhome' entry is valid. The other entries don't matter.   * The ''gsdlsite.cfg'' file needs to be copied from the cgi-bin directory to the directory you are running z3950server from. Check that the 'gsdlhome' entry is valid. The other entries don't matter.
   * Before running the server, set up your Greenstone environment in the terminal by running the following in your top level Greenstone directory:   * Before running the server, set up your Greenstone environment in the terminal by running the following in your top level Greenstone directory:
-<TABAREA tabs="Greenstone3,Greenstone2"> +Linux/Mac
-<TAB>Linux/Mac +
-<code> +
-source gs3-setup.bash +
-</code> +
-Windows +
-<code> +
-gs3-setup.bat +
-</code></TAB> +
-<TAB>Linux/Mac+
 <code> <code>
 source setup.bash source setup.bash
Line 116: Line 120:
 <code> <code>
 setup.bat setup.bat
-</code></TAB+</code> 
-</TABAREA>+
   * By default, the server listens on localhost:9999. To change the port or address, run   * By default, the server listens on localhost:9999. To change the port or address, run
 <code> z3950server tcp:server-name:port-num</code> <code> z3950server tcp:server-name:port-num</code>
Line 144: Line 148:
   * **The Z39.50 client will not work when fast-cgi is used**. Currently, the use of the fast-cgi package (off by default) will disable the use of the Z39.50 client code for Greenstone.   * **The Z39.50 client will not work when fast-cgi is used**. Currently, the use of the fast-cgi package (off by default) will disable the use of the Z39.50 client code for Greenstone.
   * When viewing a Z39.50 "collection" in Greenstone, sometimes the browser may insert a large amount of space between the collection title and the navigation bar. Reload or Shift Reload should fix this problem.   * When viewing a Z39.50 "collection" in Greenstone, sometimes the browser may insert a large amount of space between the collection title and the navigation bar. Reload or Shift Reload should fix this problem.
 +
 +===== About z39.50 =====
 +
 +Sometimes, the best explanation is the simplest one. Z39.50 is a network protocol that provides 
 +access to information systems.
 +
 +Z39.50 was originally developed to meet the needs of libraries to integrate their online catalog 
 +systems. It has since been adopted by various other domains, and it remains arguably the most 
 +flexible, versatile and efficient information retrieval around. It is also open; the specification 
 +can be downloaded freely from the net.
 +
 +It has been considered complex by some, but its flexibility is mostly derived from the fact that it 
 +is a fairly complete model of the task if information retrieval -- and from that follows a certain 
 +measure of complexity.
 +
 +We still consider Z39.50 to be an important building block in the construction of information 
 +architectures, and much of our work in the past has been about maximising the usefulness and 
 +minimising the complexity of Z39.50 by providing well-designed toolkits for programmers wishing to 
 +implement the protocol. You'll find much more information about our tools under the software page.
 +
 +===== About YAZ =====
 +
 +YAZ stands for Yet Another Z39.50 toolkit.
 +
 +YAZ is a compact toolkit that provides access to the Z39.50 and SRW/SRU protocols, as well as a 
 +set of higher-level tools for implementing the server and client roles, respectively. The documentation 
 +can be used on its own, or as a reference when looking at the example applications provided with 
 +the package.
 +
 +=== How to make apps using YAZ on UNIX ===
 +
 +http://www.indexdata.dk/yaz/doc/installation.unix.tkl#id2528482
 +
 +This section describes how to compile - and link your own applications using the YAZ toolkit. 
 +If you're used to Makefiles this shouldn't be hard. As for other libraries you have used before, 
 +you have to set a proper include path for your C/C++ compiler and specify the location of YAZ 
 +libraries. You can do it by hand, but generally we suggest you use the yaz-config that is generated 
 +by configure. This is especially important if you're using the threaded version of YAZ which requires 
 +you to pass more options to your linker/compiler.
 +
 +The yaz-config script accepts command line options that makes the yaz-config script print options that 
 +you should use in your make process. The most important ones are: --cflags, --libs which prints C compiler 
 +flags, and linker flags respectively.
 +
 +A small and complete Makefile for a C application consisting of one source file, myprog.c, may look 
 +like this:
 +
 + YAZCONFIG=/usr/local/bin/yaz-config
 + CFLAGS=`$(YAZCONFIG) --cflags`
 + LIBS=`$(YAZCONFIG) --libs`
 + myprog: myprog.o
 + $ (CC) $(CFLAGS) -o myprog myprog.o $(LIBS)
 +
 +The CFLAGS variable consists of a C compiler directive that will set the include path to the parent 
 +directory of yaz. That is, if YAZ header files were installed in /usr/local/include/yaz, then include 
 +path is set to /usr/local/include. Therefore, in your applications you should use 
 + # include <yaz/proto.h>
 + and not
 + # include <proto.h>
 +
 +For Libtool users, the yaz-config script provides a different variant of option --libs, called 
 +--lalibs that returns the name of the Libtool acrhive(s) for YAZ rather than the ordinary ones.
 +
 +For applications using the threaded version of YAZ, specify threads after the other options. When 
 +threads is given, more flags and linker flags will be printed by yaz-config. If our previous example 
 +was using threads, you'd have to modify the lines that set CFLAGS and LIBS as follows:
 + CFLAGS=`$(YAZCONFIG) --cflags threads`
 + LIBS=`$(YAZCONFIG) --libs threads`
 +
 +There is no need specify POSIX thread libraries in your Makefile. The LIBS variable includes that 
 +as well.
en/user_advanced/z3950.1397433132.txt.gz · Last modified: 2018/03/26 01:29 (external edit)