1YAZ-CLIENT(1)                      Commands                      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[1]/SRU[2] client (origin) with a simple command
16       line interface that allows you to test behavior and performance of
17       Z39.50 targets and SRU servers.
18
19       From YAZ version 4.1.0 yaz-client may also operate as a Solr[3] Web
20       Service client.
21
22       If the server-addr is specified, the client creates a connection to the
23       Z39.50/SRU target at the address given.
24
25       When yaz-client is started it tries to read commands from one of the
26       following files:
27
28       •   Command file if it is given by option -f.
29
30       •   .yazclientrc in current working directory.
31
32       •   .yazclientrc in the user's home directory. The value of the $HOME
33           environment variable is used to determine the home directory.
34           Normally, $HOME is only set on POSIX systems such as Linux,
35           FreeBSD, Solaris.
36
37

OPTIONS

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

COMMANDS

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

EXAMPLE

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

FILES

446       yaz-<version>/client/client.c
447
448       $HOME/.yazclientrc
449
450       $HOME/.yazclient.history
451

SEE ALSO

453       yaz(7) bib1-attr(7)
454

AUTHORS

456       Index Data
457

NOTES

459        1. Z39.50
460           https://www.loc.gov/z3950/agency/
461
462        2. SRU
463           https://www.loc.gov/standards/sru/
464
465        3. Solr
466           https://lucene.apache.org/solr/
467
468        4. Z39.50 standard on set bounds
469           http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6
470
471        5. Z39.50 Record Syntax Identifiers
472           http://www.loc.gov/z3950/agency/defns/oids.html#5
473
474
475
476YAZ 5.32.0                        05/30/2022                     YAZ-CLIENT(1)
Impressum