Initial commit
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / doc / yaz-client.1
1 .\"     Title: yaz\-client
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
4 .\"      Date: 09/04/2006
5 .\"    Manual: 
6 .\"    Source: YAZ 2.1.28
7 .\"
8 .TH "YAZ\-CLIENT" "1" "09/04/2006" "YAZ 2.1.28" ""
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 yaz\-client \- Z39.50/SRU client for implementors
15 .SH "SYNOPSIS"
16 .HP 11
17 \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]
18 .SH "DESCRIPTION"
19 .PP
20
21 \fByaz\-client\fR
22 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.
23 .PP
24 If the
25 \fIaddr\fR
26 is specified, the client creates a connection to the Z39.50/SRU target at the address given.
27 .PP
28 When
29 \fByaz\-client\fR
30 is invoked it attemps to read the following files:
31 $HOME/.yazclientrc
32 (home directory, Unix only) and
33 .yazclientrc
34 (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.
35 .SH "OPTIONS"
36 .TP 3n
37 \-a \fIfilename\fR
38 If specified, logging of protocol packages will be appended file given. If
39 \fIfilename\fR
40 is specified as
41 \-, the output is written to
42 stdout.
43 .TP 3n
44 \-b \fIfilename\fR
45 If specified, YAZ will dump BER data in readable notation to the file specified. If
46 \fIfilename\fR
47 is specified as
48 \-
49 the output is written to
50 stdout.
51 .TP 3n
52 \-c \fIfilename\fR
53 If specified, CCL configuration will be read from the file given.
54 .TP 3n
55 \-d \fIdump\fR
56 If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named
57 \fIdump\fR.DDD.raw, where DDD is 001, 002, 003, ..
58 .TP 3n
59 \-k \fIsize\fR
60 Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 1024 (1 MB).
61 .TP 3n
62 \-m \fIfilename\fR
63 If specified, retrieved records will be appended to the file given.
64 .TP 3n
65 \-p \fIaddr\fR
66 If specified, the client will use the proxy at the address given.
67 .TP 3n
68 \-q \fIfilename\fR
69 If specified, CQL configuration will be read from the file given.
70 .TP 3n
71 \-u \fIauth\fR
72 If specified, the
73 \fIauth\fR
74 string will be used for authentication.
75 .TP 3n
76 \-V
77 Prints YAZ version.
78 .TP 3n
79 \-x
80 Makes the YAZ client print hex dumps of packages sent and received on standard output.
81 .SH "COMMANDS"
82 .PP
83 The YAZ client accepts the following commands.
84 .TP 3n
85 open \fIzurl\fR
86 Opens a connection to a server. The syntax for
87 \fIzurl\fR
88 is the same as described above for connecting from the command line.
89 .sp
90 Syntax:
91 .sp
92 [(tcp|ssl|unix|http)':']\fIhost\fR
93 [:\fIport\fR][/\fIbase\fR]
94 .TP 3n
95 quit
96 Quits YAZ client
97 .TP 3n
98 find \fIquery\fR
99 Sends a Search Request using the
100 \fIquery\fR
101 given. By default the query is assumed to be PQF. See command
102 querytype.
103 .TP 3n
104 delete \fIsetname\fR
105 Deletes result set with name
106 \fIsetname\fR
107 on the server.
108 .TP 3n
109 base \fIbase1\fR \fIbase2\fR ...
110 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
111 \fIzurl\fR.
112 .TP 3n
113 show [\fIstart\fR[+\fInumber\fR]]
114 Fetches records by sending a Present Request from the start position given by
115 \fIstart\fR
116 a number of records given by
117 \fInumber\fR. If
118 \fIstart\fR
119 is not given, then the client will fetch from position of the last retrieved record plus 1. If
120 \fInumber\fR
121 is not given, then one record will be fetched at a time.
122 .TP 3n
123 scan \fIterm\fR
124 Scans database index for a term. The syntax resembles the syntax for
125 find. If you want to scan for the word
126 water
127 you could write
128 .sp
129 .RS 3n
130 .nf
131     scan water
132    
133 .fi
134 .RE
135 but if you want to scan only in, say the title field, you would write
136 .sp
137 .RS 3n
138 .nf
139     scan @attr 1=4 water
140    
141 .fi
142 .RE
143 .TP 3n
144 scanpos \fIpos\fR
145 Sets preferred position for scan. This value is used in next scan. By default position is 1.
146 .TP 3n
147 scansize \fIsize\fR
148 Sets number of entries to be returned by scan. Default number of entries is 20.
149 .TP 3n
150 scanstep \fIstep\fR
151 Set step\-size for scan. This value is used in next scan sent to the target. By default step\-size is 0.
152 .TP 3n
153 sort \fIsortspecs\fR
154 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
155 =
156 it is assumed that the
157 SortKey
158 is of type
159 sortAttributes
160 using Bib\-1: in this case the integer before
161 =
162 is the attribute type and the integer following
163 =
164 is the attribute value. If no
165 =
166 is in the criterion it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of
167 s
168 for case sensitive or
169 i
170 for case insensitive, and
171 <
172 for ascending order or
173 >
174 for descending order.
175 .TP 3n
176 sort+
177 Same as
178 sort
179 but stores the sorted result set in a new result set.
180 .TP 3n
181 authentication \fIopenauth\fR
182 Sets up a authentication string if a server requires authentication (v2 OpenStyle). The authentication string is first sent to the server when the
183 open
184 command is issued and the Z39.50 Initialize Request is sent, so this command must be used before
185 open
186 in order to be effective. A common convention for the
187 \fIauthopen\fR
188 string is that the username \- and password is separated by a slash, e.g.
189 myusername/mysecret.
190 .TP 3n
191 sru \fImethod\fR
192 Selects SRU method. Must be one of
193 POST,
194 GET,
195 SOAP
196 (default).
197 .TP 3n
198 list_all
199 This command displays status and values for many settings.
200 .TP 3n
201 lslb \fIn\fR
202 Sets the limit for when no records should be returned together with the search result. See the
203 [1]\&\fI Z39.50 standard \fR
204 for more details.
205 .TP 3n
206 ssub \fIn\fR
207 Sets the limit for when all records should be returned with the search result. See the
208 [1]\&\fI Z39.50 standard \fR
209 for more details.
210 .TP 3n
211 mspn \fIn\fR
212 Sets the number of records should be returned if the number of records in the result set is between the values of
213 lslb
214 and
215 ssub. See the
216 [1]\&\fI Z39.50 standard \fR
217 for more details.
218 .TP 3n
219 status
220 Displays the values of
221 lslb,
222 ssub
223 and
224 mspn.
225 .TP 3n
226 setname
227 Switches named result sets on and off. Default is on.
228 .TP 3n
229 cancel
230 Sends a Trigger Resource Control Request to the target.
231 .TP 3n
232 format \fIoid\fR
233 Sets the preferred transfer syntax for retrieved records. yaz\-client supports all the record syntaxes that currently are registered. See
234 [2]\&\fI Z39.50 Standard \fR
235 for more details. Commonly used records syntaxes include usmarc, sutrs, grs1 and xml.
236 .TP 3n
237 elements \fIe\fR
238 Sets the element set name for the records. Many targets support element sets are B (for brief) and F (for full).
239 .TP 3n
240 close
241 Sends a Z39.50 Close APDU and closes connection with the peer
242 .TP 3n
243 querytype \fItype\fR
244 Sets the query type as used by command
245 find. The following is supported:
246 prefix
247 for
248 Prefix Query Notation
249 (Type\-1 Query);
250 ccl
251 for CCL search (Type\-2 Query),
252 cql
253 for CQL (Type\-104 search with CQL OID),
254 ccl2rpn
255 for
256 CCL
257 to RPN conversion (Type\-1 Query).
258 cql2rpn
259 for CQL to RPN conversion (Type\-1 Query).
260 .TP 3n
261 attributeset \fIset\fR
262 Sets attribute set OID for prefix queries (RPN, Type\-1).
263 .TP 3n
264 refid \fIid\fR
265 Sets reference ID for Z39.50 Request(s).
266 .TP 3n
267 itemorder \fItype\fR \fIno\fR
268 Sends an Item Order Request using the ILL External.
269 \fItype\fR
270 is either 1 or 2 which corresponds to ILL\-Profile 1 and 2 respectively. The
271 \fIno\fR
272 is the Result Set position of the record to be ordered.
273 .TP 3n
274 update \fIaction\fR \fIrecid\fR \fIdoc\fR
275 Sends Item Update Request. The
276 \fIaction\fR
277 argument must be the action type: one of
278 insert,
279 replace,
280 delete
281 and
282 update. The second argument,
283 \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.
284 .TP 3n
285 . \fIfilename\fR
286 Executes list of commands from file
287 \fIfilename\fR, just like source on most UNIX shells.
288 .TP 3n
289 ! \fIargs\fR
290 Executes command
291 \fIargs\fR
292 in subshell using the
293 system
294 call.
295 .TP 3n
296 push_command \fIcommand\fR
297 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.
298 .TP 3n
299 set_apdufile \fIfilename\fR
300 Sets that APDU should be logged to file
301 \fIfilename\fR. Another way to achieve APDU log is by using command\-line option
302 \-a.
303 .TP 3n
304 set_auto_reconnect \fIflag\fR
305 Specifies whether YAZ client automatically reconnect if target closes connection (Z39.50 only).
306 .sp
307
308 \fIflag\fR
309 must be either
310 on
311 or
312 off.
313 .TP 3n
314 set_auto_wait \fIflag\fR
315 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
316 off
317 is used, YAZ client does not attempt to receive packages automatically. These will have to be manually received when command
318 wait_response
319 is used.
320 .sp
321
322 \fIflag\fR
323 must be either
324 on
325 or
326 off.
327 .TP 3n
328 set_marcdump \fIfilename\fR
329 Specifies that all retrieved records should be appended to file
330 \fIfilename\fR. This command does the thing as option
331 \-m.
332 .TP 3n
333 schema \fIschemaid\fR
334 Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI.
335 .TP 3n
336 charset \fInegotiationcharset\fR [\fIdisplaycharset\fR] [[\fImarccharset\fR]]
337 Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal).
338 .sp
339
340 \fInegotiationcharset\fR
341 is the name of the character set to be negotiated by the server. The special name
342 \-
343 for
344 \fInegotiationcharset\fR
345 specifies
346 \fIno\fR
347 character set to be negotiated.
348 .sp
349 If
350 \fIdisplaycharset\fR
351 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
352 \-
353 (dash) can be used. If the special name
354 auto
355 is given, YAZ client will convert strings to the encoding of the terminal as returned by
356 \fBnl_langinfo\fR
357 call.
358 .sp
359 If
360 \fImarcharset\fR
361 is given, it specifies name of the character set of retrieved MARC records from server. See also
362 marcharset
363 command.
364 .sp
365 .it 1 an-trap
366 .nr an-no-space-flag 1
367 .nr an-break-flag 1
368 .br
369 \fBNote\fR
370 Since character set negotation takes effect in the Z39.50 Initialize Request you should issue this command before command
371 open
372 is used.
373 .sp
374 .it 1 an-trap
375 .nr an-no-space-flag 1
376 .nr an-break-flag 1
377 .br
378 \fBNote\fR
379 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).
380 .TP 3n
381 negcharset \fIcharset\fR
382 Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command
383 charset.
384 .TP 3n
385 displaycharset \fIcharset\fR
386 Specifies character set for output (display). The argument is the same as second argument for command
387 charset.
388 .TP 3n
389 marccharset \fIcharset\fR
390 Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See
391 charset
392 command. If
393 auto
394 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
395 charset.
396 .TP 3n
397 set_cclfile \fIfilename\fR
398 Specifies that CCL fields should be read from file file
399 \fIfilename\fR. This command does the thing as option
400 \-c.
401 .TP 3n
402 set_cqlfile \fIfilename\fR
403 Specifies that CQL fields should be read from file file
404 \fIfilename\fR. This command does the thing as option
405 \-q.
406 .TP 3n
407 register_oid \fIname\fR \fIclass\fR \fIOID\fR
408 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
409 \fIname\fR
410 is your name for the OID,
411 \fIclass\fR
412 is the class, and
413 \fIOID\fR
414 is the raw OID in dot notation. Class is one
415 appctx,
416 absyn,
417 attet,
418 transyn,
419 diagset,
420 recsyn,
421 resform,
422 accform,
423 extserv,
424 userinfo,
425 elemspec,
426 varset,
427 schema,
428 tagset,
429 general. If you're in doubt use the
430 general
431 class.
432 .TP 3n
433 register_tab \fIcommand\fR \fIstring\fR
434 This command registers a TAB completion string for the command given.
435 .TP 3n
436 sleep \fIseconds\fR
437 This command makes YAZ client sleep (be idle) for the number of seconds given.
438 .TP 3n
439 wait_response [ \fInumber\fR]
440 This command makes YAZ client wait for a number of response packages from target. If
441 \fInumber\fR
442 is omitted, 1 is assumed.
443 .sp
444 This command is rarely used and is only useful if command
445 set_auto_wait
446 is set to off.
447 .TP 3n
448 xmles \fIOID\fR \fIdoc\fR
449 Sends XML Extended Services request using the OID and doc given.
450 .TP 3n
451 zversion \fIver\fR
452 This command sets Z39.50 version for negotiation. Should be used before
453 open. By default 3 (version 3) is used.
454 .TP 3n
455 options \fIop1 op2..\fR
456 This command sets Z39.50 options for negotiation. Should be used before
457 open.
458 .sp
459 The following options are supported:
460 search,
461 present,
462 delSet,
463 resourceReport,
464 triggerResourceCtrl,
465 resourceCtrl,
466 accessCtrl,
467 scan,
468 sort,
469 extendedServices,
470 level_1Segmentation,
471 level_2Segmentation,
472 concurrentOperations,
473 namedResultSets,
474 encapsulation,
475 resultCount,
476 negotiationModel,
477 duplicationDetection,
478 queryType104,
479 pQESCorrection,
480 stringSchema.
481 .SH "FILES"
482 .PP
483
484 \fIyaz\-<version>/client/client.c\fR
485 .PP
486
487 \fI.yazclientrc\fR
488 .PP
489
490 \fI$HOME/.yazclientrc\fR
491 .SH "SEE ALSO"
492 .PP
493
494 \fByaz\fR(7)
495 .PP
496 Section "The YAZ Client" in the YAZ manual.
497 .PP
498 Section "Prefix Query Format" in the YAZ manual.
499 .PP
500 Section "Common Command Language" in the YAZ manual.
501 .PP
502 Section "Common Query Language" in the YAZ manual.
503 .SH "REFERENCES"
504 .TP 3
505 1.\ Z39.50 standard
506 \%http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6
507 .TP 3
508 2.\ Z39.50 Standard
509 \%http://www.loc.gov/z3950/agency/defns/oids.html#5