.\" Title: yaz\-client .\" Author: .\" Generator: DocBook XSL Stylesheets v1.70.1 .\" Date: 09/04/2006 .\" Manual: .\" Source: YAZ 2.1.28 .\" .TH "YAZ\-CLIENT" "1" "09/04/2006" "YAZ 2.1.28" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" yaz\-client \- Z39.50/SRU client for implementors .SH "SYNOPSIS" .HP 11 \fByaz\-client\fR [\fB\-a\ \fR\fB\fIfilename\fR\fR] [\fB\-b\ \fR\fB\fIfilename\fR\fR] [\fB\-c\ \fR\fB\fIfilename\fR\fR] [\fB\-d\ \fR\fB\fIdump\fR\fR] [\fB\-k\ \fR\fB\fIsize\fR\fR] [\fB\-m\ \fR\fB\fIfilename\fR\fR] [\fB\-p\ \fR\fB\fIaddr\fR\fR] [\fB\-q\ \fR\fB\fIfilename\fR\fR] [\fB\-u\ \fR\fB\fIauth\fR\fR] [\fB\-xV\fR] [addr] .SH "DESCRIPTION" .PP \fByaz\-client\fR is a Z39.50/SRU client (origin) with a simple command line interface that allows you to test behavior and performance of Z39.50 targets and SRU servers. .PP If the \fIaddr\fR is specified, the client creates a connection to the Z39.50/SRU target at the address given. .PP When \fByaz\-client\fR is invoked it attemps to read the following files: $HOME/.yazclientrc (home directory, Unix only) and .yazclientrc (current directory \- any platform) For those files that are readable, the YAZ client executes commands in those files. See COMMANDS section for description of commands. .SH "OPTIONS" .TP 3n \-a \fIfilename\fR If specified, logging of protocol packages will be appended file given. If \fIfilename\fR is specified as \-, the output is written to stdout. .TP 3n \-b \fIfilename\fR If specified, YAZ will dump BER data in readable notation to the file specified. If \fIfilename\fR is specified as \- the output is written to stdout. .TP 3n \-c \fIfilename\fR If specified, CCL configuration will be read from the file given. .TP 3n \-d \fIdump\fR If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named \fIdump\fR.DDD.raw, where DDD is 001, 002, 003, .. .TP 3n \-k \fIsize\fR Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 1024 (1 MB). .TP 3n \-m \fIfilename\fR If specified, retrieved records will be appended to the file given. .TP 3n \-p \fIaddr\fR If specified, the client will use the proxy at the address given. .TP 3n \-q \fIfilename\fR If specified, CQL configuration will be read from the file given. .TP 3n \-u \fIauth\fR If specified, the \fIauth\fR string will be used for authentication. .TP 3n \-V Prints YAZ version. .TP 3n \-x Makes the YAZ client print hex dumps of packages sent and received on standard output. .SH "COMMANDS" .PP The YAZ client accepts the following commands. .TP 3n open \fIzurl\fR Opens a connection to a server. The syntax for \fIzurl\fR is the same as described above for connecting from the command line. .sp Syntax: .sp [(tcp|ssl|unix|http)':']\fIhost\fR [:\fIport\fR][/\fIbase\fR] .TP 3n quit Quits YAZ client .TP 3n find \fIquery\fR Sends a Search Request using the \fIquery\fR given. By default the query is assumed to be PQF. See command querytype. .TP 3n delete \fIsetname\fR Deletes result set with name \fIsetname\fR on the server. .TP 3n base \fIbase1\fR \fIbase2\fR ... Sets the name(s) of the database(s) to search. One or more databases may be specified separated by blanks. This commands overrides the database given in \fIzurl\fR. .TP 3n show [\fIstart\fR[+\fInumber\fR]] Fetches records by sending a Present Request from the start position given by \fIstart\fR a number of records given by \fInumber\fR. If \fIstart\fR is not given, then the client will fetch from position of the last retrieved record plus 1. If \fInumber\fR is not given, then one record will be fetched at a time. .TP 3n scan \fIterm\fR Scans database index for a term. The syntax resembles the syntax for find. If you want to scan for the word water you could write .sp .RS 3n .nf scan water .fi .RE but if you want to scan only in, say the title field, you would write .sp .RS 3n .nf scan @attr 1=4 water .fi .RE .TP 3n scanpos \fIpos\fR Sets preferred position for scan. This value is used in next scan. By default position is 1. .TP 3n scansize \fIsize\fR Sets number of entries to be returned by scan. Default number of entries is 20. .TP 3n scanstep \fIstep\fR Set step\-size for scan. This value is used in next scan sent to the target. By default step\-size is 0. .TP 3n sort \fIsortspecs\fR Sorts a result set. The sort command takes a sequence of space\-separated sort specifications, with each sort specification consisting of two space\-separated words (so that the whole specification list is made up of an even number of words). The first word of each specification holds a field (sort criterion) and the second holds flags. If the sort criterion includes = it is assumed that the SortKey is of type sortAttributes using Bib\-1: in this case the integer before = is the attribute type and the integer following = is the attribute value. If no = is in the criterion it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of s for case sensitive or i for case insensitive, and < for ascending order or > for descending order. .TP 3n sort+ Same as sort but stores the sorted result set in a new result set. .TP 3n authentication \fIopenauth\fR Sets up a authentication string if a server requires authentication (v2 OpenStyle). The authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent, so this command must be used before open in order to be effective. A common convention for the \fIauthopen\fR string is that the username \- and password is separated by a slash, e.g. myusername/mysecret. .TP 3n sru \fImethod\fR Selects SRU method. Must be one of POST, GET, SOAP (default). .TP 3n list_all This command displays status and values for many settings. .TP 3n lslb \fIn\fR Sets the limit for when no records should be returned together with the search result. See the [1]\&\fI Z39.50 standard \fR for more details. .TP 3n ssub \fIn\fR Sets the limit for when all records should be returned with the search result. See the [1]\&\fI Z39.50 standard \fR for more details. .TP 3n mspn \fIn\fR Sets the number of records should be returned if the number of records in the result set is between the values of lslb and ssub. See the [1]\&\fI Z39.50 standard \fR for more details. .TP 3n status Displays the values of lslb, ssub and mspn. .TP 3n setname Switches named result sets on and off. Default is on. .TP 3n cancel Sends a Trigger Resource Control Request to the target. .TP 3n format \fIoid\fR Sets the preferred transfer syntax for retrieved records. yaz\-client supports all the record syntaxes that currently are registered. See [2]\&\fI Z39.50 Standard \fR for more details. Commonly used records syntaxes include usmarc, sutrs, grs1 and xml. .TP 3n elements \fIe\fR Sets the element set name for the records. Many targets support element sets are B (for brief) and F (for full). .TP 3n close Sends a Z39.50 Close APDU and closes connection with the peer .TP 3n querytype \fItype\fR Sets the query type as used by command find. The following is supported: prefix for Prefix Query Notation (Type\-1 Query); ccl for CCL search (Type\-2 Query), cql for CQL (Type\-104 search with CQL OID), ccl2rpn for CCL to RPN conversion (Type\-1 Query). cql2rpn for CQL to RPN conversion (Type\-1 Query). .TP 3n attributeset \fIset\fR Sets attribute set OID for prefix queries (RPN, Type\-1). .TP 3n refid \fIid\fR Sets reference ID for Z39.50 Request(s). .TP 3n itemorder \fItype\fR \fIno\fR Sends an Item Order Request using the ILL External. \fItype\fR is either 1 or 2 which corresponds to ILL\-Profile 1 and 2 respectively. The \fIno\fR is the Result Set position of the record to be ordered. .TP 3n update \fIaction\fR \fIrecid\fR \fIdoc\fR Sends Item Update Request. The \fIaction\fR argument must be the action type: one of insert, replace, delete and update. The second argument, \fIrecid\fR, is the record identifier (any string). Third argument which is optional is the record document for the request. If doc is a quoted string (double quotes) the string content is used verbatim. If doc is not a quoted string, it is assumed to be a filename which is read, then sent as the docuemnt content. If doc is omitted, the last received record (as parf of present response or piggybacked search response) is used for the update. .TP 3n . \fIfilename\fR Executes list of commands from file \fIfilename\fR, just like source on most UNIX shells. .TP 3n ! \fIargs\fR Executes command \fIargs\fR in subshell using the system call. .TP 3n push_command \fIcommand\fR The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed. This command only works if you have GNU readline/history enabled. .TP 3n set_apdufile \fIfilename\fR Sets that APDU should be logged to file \fIfilename\fR. Another way to achieve APDU log is by using command\-line option \-a. .TP 3n set_auto_reconnect \fIflag\fR Specifies whether YAZ client automatically reconnect if target closes connection (Z39.50 only). .sp \fIflag\fR must be either on or off. .TP 3n set_auto_wait \fIflag\fR Specifies whether YAZ client should wait for response protocol packages after a request. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued. If off is used, YAZ client does not attempt to receive packages automatically. These will have to be manually received when command wait_response is used. .sp \fIflag\fR must be either on or off. .TP 3n set_marcdump \fIfilename\fR Specifies that all retrieved records should be appended to file \fIfilename\fR. This command does the thing as option \-m. .TP 3n schema \fIschemaid\fR Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI. .TP 3n charset \fInegotiationcharset\fR [\fIdisplaycharset\fR] [[\fImarccharset\fR]] Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal). .sp \fInegotiationcharset\fR is the name of the character set to be negotiated by the server. The special name \- for \fInegotiationcharset\fR specifies \fIno\fR character set to be negotiated. .sp If \fIdisplaycharset\fR is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). To disable conversion of characters to the output encoding, the special name \- (dash) can be used. If the special name auto is given, YAZ client will convert strings to the encoding of the terminal as returned by \fBnl_langinfo\fR call. .sp If \fImarcharset\fR is given, it specifies name of the character set of retrieved MARC records from server. See also marcharset command. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br \fBNote\fR Since character set negotation takes effect in the Z39.50 Initialize Request you should issue this command before command open is used. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br \fBNote\fR MARC records are not covered by Z39.50 character set negotiation, so that's why there is a separate character that must be known in order to do meaningful converson(s). .TP 3n negcharset \fIcharset\fR Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command charset. .TP 3n displaycharset \fIcharset\fR Specifies character set for output (display). The argument is the same as second argument for command charset. .TP 3n marccharset \fIcharset\fR Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See charset command. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO\-8859\-1 for all other MARC variants. The charset argument is the same as third argument for command charset. .TP 3n set_cclfile \fIfilename\fR Specifies that CCL fields should be read from file file \fIfilename\fR. This command does the thing as option \-c. .TP 3n set_cqlfile \fIfilename\fR Specifies that CQL fields should be read from file file \fIfilename\fR. This command does the thing as option \-q. .TP 3n register_oid \fIname\fR \fIclass\fR \fIOID\fR This command allows you to register your own object identifier \- so that instead of entering a long dot\-notation you can use a short name instead. The \fIname\fR is your name for the OID, \fIclass\fR is the class, and \fIOID\fR is the raw OID in dot notation. Class is one appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general. If you're in doubt use the general class. .TP 3n register_tab \fIcommand\fR \fIstring\fR This command registers a TAB completion string for the command given. .TP 3n sleep \fIseconds\fR This command makes YAZ client sleep (be idle) for the number of seconds given. .TP 3n wait_response [ \fInumber\fR] This command makes YAZ client wait for a number of response packages from target. If \fInumber\fR is omitted, 1 is assumed. .sp This command is rarely used and is only useful if command set_auto_wait is set to off. .TP 3n xmles \fIOID\fR \fIdoc\fR Sends XML Extended Services request using the OID and doc given. .TP 3n zversion \fIver\fR This command sets Z39.50 version for negotiation. Should be used before open. By default 3 (version 3) is used. .TP 3n options \fIop1 op2..\fR This command sets Z39.50 options for negotiation. Should be used before open. .sp The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema. .SH "FILES" .PP \fIyaz\-/client/client.c\fR .PP \fI.yazclientrc\fR .PP \fI$HOME/.yazclientrc\fR .SH "SEE ALSO" .PP \fByaz\fR(7) .PP Section "The YAZ Client" in the YAZ manual. .PP Section "Prefix Query Format" in the YAZ manual. .PP Section "Common Command Language" in the YAZ manual. .PP Section "Common Query Language" in the YAZ manual. .SH "REFERENCES" .TP 3 1.\ Z39.50 standard \%http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6 .TP 3 2.\ Z39.50 Standard \%http://www.loc.gov/z3950/agency/defns/oids.html#5