1YAZ-CLIENT(1)                   [FIXME: manual]                  YAZ-CLIENT(1)
2
3
4

NAME

6       yaz-client - Z39.50/SRU client for implementors
7

SYNOPSIS

9       yaz-client [-a apdulog] [-b berdump] [-c cclfile] [-d dump]
10                  [-f cmdfile] [-k size] [-m marclog] [-p proxy-addr]
11                  [-q cqlfile] [-t dispcharset] [-u auth] [-v loglevel] [-V]
12                  [-x] [server-addr]
13

DESCRIPTION

15       yaz-client is a Z39.50/SRU client (origin) with a simple command line
16       interface that allows you to test behavior and performance of Z39.50
17       targets and SRU servers.
18
19       If the server-addr is specified, the client creates a connection to the
20       Z39.50/SRU target at the address given.
21
22       When yaz-client is started it tries to read commands from one of the
23       following files:
24
25       ·   Command file if it is given by option -f.
26
27       ·    .yazclientrc in current working directory.
28
29       ·    .yazclientrc in the user´s home directory. The value of the HOME
30           is used to determine the home directory. Normally, HOME is only set
31           on POSIX systems such as Linux, FreeBSD, Solaris.
32
33

OPTIONS

35       -a filename
36           If specified, logging of protocol packages will be appended file
37           given. If filename is specified as -, the output is written to
38           stdout.
39
40       -b filename
41           If specified, YAZ will dump BER data in readable notation to the
42           file specified. If filename is specified as - the output is written
43           to stdout.
44
45       -c filename
46           If specified, CCL configuration will be read from the file given.
47
48       -d dump
49           If specified, YAZ will dump BER data for all PDUs sent and received
50           to individual files, named dump.DDD.raw, where DDD is 001, 002,
51           003, ..
52
53       -f cmdfile
54           Reads commands from cmdfile. When this option is used, YAZ client
55           does not read .yazclientrc from current directory or home
56           directory.
57
58       -k size
59           Sets preferred messages and maximum record size for Initialize
60           Request in kilobytes. Default value is 1024 (1 MB).
61
62       -m filename
63           If specified, retrieved records will be appended to the file given.
64
65       -p proxy-addr
66           If specified, the client will use the proxy at the address given.
67           YAZ client will connect to a proxy on the address and port given.
68           The actual target will be specified as part of the InitRequest to
69           inform the proxy about actual target.
70
71       -q filename
72           If specified, CQL configuration will be read from the file given.
73
74       -t displaycharset
75           If displaycharset is given, it specifies name of the character set
76           of the output (on the terminal on which YAZ client is running).
77
78       -u auth
79           If specified, the auth string will be used for authentication.
80
81       -v level
82           Sets the LOG level to level. Level is a sequence of tokens
83           separated by comma. Each token is a integer or a named LOG item -
84           one of fatal, debug, warn, log, malloc, all, none.
85
86       -V
87           Prints YAZ version.
88
89       -x
90           Makes the YAZ client print hex dumps of packages sent and received
91           on standard output.
92

COMMANDS

94       The YAZ client accepts the following commands.
95
96       open zurl
97           Opens a connection to a server. The syntax for zurl is the same as
98           described above for connecting from the command line.
99
100           Syntax:
101
102           [(tcp|ssl|unix|http)´:´]host [:port][/base]
103
104       quit
105           Quits YAZ client
106
107       find query
108           Sends a Search Request using the query given. By default the query
109           is assumed to be PQF. See command querytype for more information.
110
111       delete setname
112           Deletes result set with name setname on the server.
113
114       base base1 base2 ...
115           Sets the name(s) of the database(s) to search. One or more
116           databases may be specified separated by blanks. This commands
117           overrides the database given in zurl.
118
119       show [start[+number]]
120           Fetches records by sending a Present Request from the start
121           position given by start a number of records given by number. If
122           start is not given, then the client will fetch from position of the
123           last retrieved record plus 1. If number is not given, then one
124           record will be fetched at a time.
125
126       scan term
127           Scans database index for a term. The syntax resembles the syntax
128           for find. If you want to scan for the word water you could write
129
130                   scan water
131
132
133           but if you want to scan only in, say the title field, you would
134           write
135
136                   scan @attr 1=4 water
137
138
139       setscan set term
140           Scans database index for a term within a result set. This is
141           similar to the scan command but has a result set as its first
142           argument.
143
144       scanpos pos
145           Sets preferred position for scan. This value is used in next scan.
146           By default position is 1.
147
148       scansize size
149           Sets number of entries to be returned by scan. Default number of
150           entries is 20.
151
152       scanstep step
153           Set step-size for scan. This value is used in next scan sent to the
154           target. By default step-size is 0.
155
156       sort sortspecs
157           Sorts a result set. The sort command takes a sequence of
158           space-separated sort specifications, with each sort specification
159           consisting of two space-separated words (so that the whole
160           specification list is made up of an even number of words). The
161           first word of each specification holds a field (sort criterion) and
162           the second holds flags. If the sort criterion includes = it is
163           assumed that the SortKey is of type sortAttributes using Bib-1: in
164           this case the integer before = is the attribute type and the
165           integer following = is the attribute value. If no = is in the
166           criterion it is treated as a sortfield of type InternationalString.
167           The flags word of each sort specification must consist of s for
168           case sensitive or i for case insensitive, and < for ascending order
169           or > for descending order.
170
171       sort+
172           Same as sort but stores the sorted result set in a new result set.
173
174       authentication openauth
175           Sets up a authentication string if a server requires authentication
176           (v2 OpenStyle). The authentication string is first sent to the
177           server when the open command is issued and the Z39.50 Initialize
178           Request is sent, so this command must be used before open in order
179           to be effective. A common convention for the authopen string is
180           that the username - and password is separated by a slash, e.g.
181           myusername/mysecret.
182
183       sru method version
184           Selects SRU method and version. Must be one of POST, GET, SOAP
185           (default). Version should be either 1.1 or 1.2. Other versions are
186           allowed - for testing purposes (version negotiation with SRU
187           server).
188
189       list_all
190           This command displays status and values for many settings.
191
192       lslb n
193           Sets the limit for when no records should be returned together with
194           the search result. See the
195            Z39.50 standard [1] for more details.
196
197       ssub n
198           Sets the limit for when all records should be returned with the
199           search result. See the
200            Z39.50 standard [1] for more details.
201
202       mspn n
203           Sets the number of records should be returned if the number of
204           records in the result set is between the values of lslb and ssub.
205           See the
206            Z39.50 standard [1] for more details.
207
208       status
209           Displays the values of lslb, ssub and mspn.
210
211       setname
212           Switches named result sets on and off. Default is on.
213
214       cancel
215           Sends a Trigger Resource Control Request to the target.
216
217       format oid
218           Sets the preferred transfer syntax for retrieved records.
219           yaz-client supports all the record syntaxes that currently are
220           registered. See
221            Z39.50 Standard [2] for more details. Commonly used records
222           syntaxes include usmarc, sutrs, grs1 and xml.
223
224       elements e
225           Sets the element set name for the records. Many targets support
226           element sets are B (for brief) and F (for full).
227
228       close
229           Sends a Z39.50 Close APDU and closes connection with the peer
230
231       querytype type
232           Sets the query type as used by command find. The following is
233           supported: prefix for Prefix Query Notation (Type-1 Query); ccl for
234           CCL search (Type-2 Query), cql for CQL (Type-104 search with CQL
235           OID), ccl2rpn for CCL to RPN conversion (Type-1 Query).  cql2rpn
236           for CQL to RPN conversion (Type-1 Query).
237
238       attributeset set
239           Sets attribute set OID for prefix queries (RPN, Type-1).
240
241       refid id
242           Sets reference ID for Z39.50 Request(s).
243
244       itemorder type no
245           Sends an Item Order Request using the ILL External.  type is either
246           1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The
247           no is the Result Set position of the record to be ordered.
248
249       update action recid doc
250           Sends Item Update Request. The action argument must be the action
251           type: one of insert, replace, delete and update. The second
252           argument, recid, is the record identifier (any string). Third
253           argument which is optional is the record document for the request.
254           If doc is preceded with "<", then the following characters are
255           treated as a filename with the records to be updated. Otherwise doc
256           is treated as a document itself. The doc may also be quited in
257           double quotes. If doc is omitted, the last received record (as part
258           of present response or piggybacked search response) is used for the
259           update.
260
261       source filename
262           Executes list of commands from file filename, just like source on
263           most UNIX shells. A single dot (.) can be used as an alternative.
264
265       ! args
266           Executes command args in subshell using the system call.
267
268       push_command command
269           The push_command takes another command as its argument. That
270           command is then added to the history information (so you can
271           retrieve it later). The command itself is not executed. This
272           command only works if you have GNU readline/history enabled.
273
274       set_apdufile filename
275           Sets that APDU should be logged to file filename. Another way to
276           achieve APDU log is by using command-line option -a.
277
278       set_auto_reconnect flag
279           Specifies whether YAZ client automatically reconnect if target
280           closes connection (Z39.50 only).
281
282
283           flag must be either on or off.
284
285       set_auto_wait flag
286           Specifies whether YAZ client should wait for response protocol
287           packages after a request. By default YAZ client waits (on) for
288           response packages immediately after a command (find, show) has been
289           issued. If off is used, YAZ client does not attempt to receive
290           packages automatically. These will have to be manually received
291           when command wait_response is used.
292
293
294           flag must be either on or off.
295
296       set_marcdump filename
297           Specifies that all retrieved records should be appended to file
298           filename. This command does the thing as option -m.
299
300       schema schemaid
301           Specifies schema for retrieval. Schema may be specified as an OID
302           for Z39.50. For SRU, schema is a simple string URI.
303
304       charset negotiationcharset [displaycharset] [[marccharset]]
305           Specifies character set (encoding) for Z39.50 negotiation / SRU
306           encoding and/or character set for output (terminal).
307
308
309           negotiationcharset is the name of the character set to be
310           negotiated by the server. The special name - for negotiationcharset
311           specifies no character set to be negotiated.
312
313           If displaycharset is given, it specifies name of the character set
314           of the output (on the terminal on which YAZ client is running). To
315           disable conversion of characters to the output encoding, the
316           special name - (dash) can be used. If the special name auto is
317           given, YAZ client will convert strings to the encoding of the
318           terminal as returned by nl_langinfo call.
319
320           If marcharset is given, it specifies name of the character set of
321           retrieved MARC records from server. See also marcharset command.
322
323               Note
324               Since character set negotation takes effect in the Z39.50
325               Initialize Request you should issue this command before command
326               open is used.
327
328               Note
329               MARC records are not covered by Z39.50 character set
330               negotiation, so that´s why there is a separate character that
331               must be known in order to do meaningful conversion(s).
332
333       negcharset charset
334           Specifies character set for negotiation (Z39.50). The argument is
335           the same as second argument for command charset.
336
337       displaycharset charset
338           Specifies character set for output (display). The argument is the
339           same as second argument for command charset.
340
341       marccharset charset
342           Specifies character set for retrieved MARC records so that YAZ
343           client can display them in a character suitable for your display.
344           See charset command. If auto is given, YAZ will assume that
345           MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC
346           variants. The charset argument is the same as third argument for
347           command charset.
348
349       querycharset charset
350           Specifies character set for query terms for Z39.50 RPN queries and
351           Z39.50 Scan Requests (termListAndStartPoint). This is a pure
352           client-side conversion which converts from displayCharset to
353           queryCharset.
354
355       set_cclfile filename
356           Specifies that CCL fields should be read from file file filename.
357           This command does the thing as option -c.
358
359       set_cqlfile filename
360           Specifies that CQL fields should be read from file file filename.
361           This command does the thing as option -q.
362
363       register_oid name class OID
364           This command allows you to register your own object identifier - so
365           that instead of entering a long dot-notation you can use a short
366           name instead. The name is your name for the OID, class is the
367           class, and OID is the raw OID in dot notation. Class is one appctx,
368           absyn, attet, transyn, diagset, recsyn, resform, accform, extserv,
369           userinfo, elemspec, varset, schema, tagset, general. If you´re in
370           doubt use the general class.
371
372       register_tab command string
373           This command registers a TAB completion string for the command
374           given.
375
376       sleep seconds
377           This command makes YAZ client sleep (be idle) for the number of
378           seconds given.
379
380       wait_response [ number]
381           This command makes YAZ client wait for a number of response
382           packages from target. If number is omitted, 1 is assumed.
383
384           This command is rarely used and is only useful if command
385           set_auto_wait is set to off.
386
387       xmles OID doc
388           Sends XML Extended Services request using the OID and doc given.
389
390       zversion ver
391           This command sets Z39.50 version for negotiation. Should be used
392           before open. By default 3 (version 3) is used.
393
394       options op1 op2..
395           This command sets Z39.50 options for negotiation. Should be used
396           before open.
397
398           The following options are supported: search, present, delSet,
399           resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl,
400           scan, sort, extendedServices, level_1Segmentation,
401           level_2Segmentation, concurrentOperations, namedResultSets,
402           encapsulation, resultCount, negotiationModel, duplicationDetection,
403           queryType104, pQESCorrection, stringSchema.
404

EXAMPLE

406       The simplest example of a Prefix Query would be something like
407
408               f knuth
409
410
411       or
412
413               f "donald knuth"
414
415
416       In those queries no attributes was specified. This leaves it up to the
417       server what fields to search but most servers will search in all
418       fields. Some servers does not support this feature though, and require
419       that some attributes are defined. To add one attribute you could do:
420
421               f @attr 1=4 computer
422
423
424       where we search in the title field, since the use(1) is title(4). If we
425       want to search in the author field and in the title field, and in the
426       title field using right truncation it could look something like this:
427
428               f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
429
430
431       Finally using a mix of Bib-1 and GILS attributes could look something
432       like this:
433
434               f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
435
436
437

FILES

439       yaz-<version>/client/client.c
440
441       $HOME/.yazclientrc
442
443       $HOME/.yazclient.history
444

SEE ALSO

446       yaz(7) bib1-attr(7)
447

NOTES

449        1. Z39.50 standard
450           http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6
451
452        2. Z39.50 Standard
453           http://www.loc.gov/z3950/agency/defns/oids.html#5
454
455
456
457YAZ 4.0.2                         03/09/2010                     YAZ-CLIENT(1)
Impressum