File: yaz-client.1

package info (click to toggle)
yaz 3.0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,404 kB
  • ctags: 12,108
  • sloc: xml: 116,075; ansic: 52,205; sh: 9,746; tcl: 2,043; makefile: 1,141; yacc: 347
file content (724 lines) | stat: -rw-r--r-- 17,663 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
.\"     Title: yaz-client
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\"      Date: 06/18/2008
.\"    Manual: 
.\"    Source: YAZ 3.0.34
.\"
.TH "YAZ\-CLIENT" "1" "06/18/2008" "YAZ 3.0.34" ""
.\" 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\-f\ \fR\fB\fIcmdfile\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\-v\ \fR\fB\fIlevel\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 started it tries to read commands from one of the following files:
.sp
.RS 4
\h'-04'\(bu\h'+03'Command file if it is given by option \-f\&.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+03'
\fI\&.yazclientrc\fR
in current working directory\&.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+03'
\fI\&.yazclientrc\fR
in the user\'s home directory\&. The value of the
HOME
is used to determine the home directory\&. Normally,
HOME
is only set on POSIX systems such as Linux, FreeBSD, Solaris\&.
.RE
.sp
.RE
.SH "OPTIONS"
.PP
\-a \fIfilename\fR
.RS 4
If specified, logging of protocol packages will be appended file given\&. If
\fIfilename\fR
is specified as
\-, the output is written to
stdout\&.
.RE
.PP
\-b \fIfilename\fR
.RS 4
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\&.
.RE
.PP
\-c \fIfilename\fR
.RS 4
If specified, CCL configuration will be read from the file given\&.
.RE
.PP
\-d \fIdump\fR
.RS 4
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, \&.\&.
.RE
.PP
\-f \fIcmdfile\fR
.RS 4
Reads commands from
\fIcmdfile\fR\&. When this option is used, YAZ client does not read \&.yazclientrc from current directory or home directory\&.
.RE
.PP
\-k \fIsize\fR
.RS 4
Sets preferred messages and maximum record size for Initialize Request in kilobytes\&. Default value is 1024 (1 MB)\&.
.RE
.PP
\-m \fIfilename\fR
.RS 4
If specified, retrieved records will be appended to the file given\&.
.RE
.PP
\-p \fIaddr\fR
.RS 4
If specified, the client will use the proxy at the address given\&. YAZ client will connect to a proxy on the address and port given\&. The actual target will be specified as part of the InitRequest to inform the proxy about actual target\&.
.RE
.PP
\-q \fIfilename\fR
.RS 4
If specified, CQL configuration will be read from the file given\&.
.RE
.PP
\-u \fIauth\fR
.RS 4
If specified, the
\fIauth\fR
string will be used for authentication\&.
.RE
.PP
\-v \fIlevel\fR
.RS 4
Sets the LOG level to
\fIlevel\fR\&. Level is a sequence of tokens separated by comma\&. Each token is a integer or a named LOG item \- one of
fatal,
debug,
warn,
log,
malloc,
all,
none\&.
.RE
.PP
\-V
.RS 4
Prints YAZ version\&.
.RE
.PP
\-x
.RS 4
Makes the YAZ client print hex dumps of packages sent and received on standard output\&.
.RE
.SH "COMMANDS"
.PP
The YAZ client accepts the following commands\&.
.PP
open \fIzurl\fR
.RS 4
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]
.RE
.PP
quit
.RS 4
Quits YAZ client
.RE
.PP
find \fIquery\fR
.RS 4
Sends a Search Request using the
\fIquery\fR
given\&. By default the query is assumed to be PQF\&. See command
querytype
for more information\&.
.RE
.PP
delete \fIsetname\fR
.RS 4
Deletes result set with name
\fIsetname\fR
on the server\&.
.RE
.PP
base \fIbase1\fR \fIbase2\fR \&.\&.\&.
.RS 4
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\&.
.RE
.PP
show [\fIstart\fR[+\fInumber\fR]]
.RS 4
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\&.
.RE
.PP
scan \fIterm\fR
.RS 4
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 4
.nf
    scan water
   
.fi
.RE
but if you want to scan only in, say the title field, you would write
.sp
.RS 4
.nf
    scan @attr 1=4 water
   
.fi
.RE
.RE
.PP
setscan \fIset\fR \fIterm\fR
.RS 4
Scans database index for a term within a result set\&. This is similar to the scan command but has a result set as its first argument\&.
.RE
.PP
scanpos \fIpos\fR
.RS 4
Sets preferred position for scan\&. This value is used in next scan\&. By default position is 1\&.
.RE
.PP
scansize \fIsize\fR
.RS 4
Sets number of entries to be returned by scan\&. Default number of entries is 20\&.
.RE
.PP
scanstep \fIstep\fR
.RS 4
Set step\-size for scan\&. This value is used in next scan sent to the target\&. By default step\-size is 0\&.
.RE
.PP
sort \fIsortspecs\fR
.RS 4
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\&.
.RE
.PP
sort+
.RS 4
Same as
sort
but stores the sorted result set in a new result set\&.
.RE
.PP
authentication \fIopenauth\fR
.RS 4
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\&.
.RE
.PP
sru \fImethod\fR \fIversion\fR
.RS 4
Selects SRU method and version\&. Must be one of
POST,
GET,
SOAP
(default)\&. Version should be either 1\&.1 or 1\&.2\&. Other versions are allowed \- for testing purposes (version negotiation with SRU server)\&.
.RE
.PP
list_all
.RS 4
This command displays status and values for many settings\&.
.RE
.PP
lslb \fIn\fR
.RS 4
Sets the limit for when no records should be returned together with the search result\&. See the
\fI Z39\&.50 standard \fR\&[1]
for more details\&.
.RE
.PP
ssub \fIn\fR
.RS 4
Sets the limit for when all records should be returned with the search result\&. See the
\fI Z39\&.50 standard \fR\&[1]
for more details\&.
.RE
.PP
mspn \fIn\fR
.RS 4
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
\fI Z39\&.50 standard \fR\&[1]
for more details\&.
.RE
.PP
status
.RS 4
Displays the values of
lslb,
ssub
and
mspn\&.
.RE
.PP
setname
.RS 4
Switches named result sets on and off\&. Default is on\&.
.RE
.PP
cancel
.RS 4
Sends a Trigger Resource Control Request to the target\&.
.RE
.PP
format \fIoid\fR
.RS 4
Sets the preferred transfer syntax for retrieved records\&. yaz\-client supports all the record syntaxes that currently are registered\&. See
\fI Z39\&.50 Standard \fR\&[2]
for more details\&. Commonly used records syntaxes include usmarc, sutrs, grs1 and xml\&.
.RE
.PP
elements \fIe\fR
.RS 4
Sets the element set name for the records\&. Many targets support element sets are B (for brief) and F (for full)\&.
.RE
.PP
close
.RS 4
Sends a Z39\&.50 Close APDU and closes connection with the peer
.RE
.PP
querytype \fItype\fR
.RS 4
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)\&.
.RE
.PP
attributeset \fIset\fR
.RS 4
Sets attribute set OID for prefix queries (RPN, Type\-1)\&.
.RE
.PP
refid \fIid\fR
.RS 4
Sets reference ID for Z39\&.50 Request(s)\&.
.RE
.PP
itemorder \fItype\fR \fIno\fR
.RS 4
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\&.
.RE
.PP
update \fIaction\fR \fIrecid\fR \fIdoc\fR
.RS 4
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\&.
.RE
.PP
source \fIfilename\fR
.RS 4
Executes list of commands from file
\fIfilename\fR, just like source on most UNIX shells\&. A single dot (\&.) can be used as an alternative\&.
.RE
.PP
! \fIargs\fR
.RS 4
Executes command
\fIargs\fR
in subshell using the
system
call\&.
.RE
.PP
push_command \fIcommand\fR
.RS 4
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\&.
.RE
.PP
set_apdufile \fIfilename\fR
.RS 4
Sets that APDU should be logged to file
\fIfilename\fR\&. Another way to achieve APDU log is by using command\-line option
\-a\&.
.RE
.PP
set_auto_reconnect \fIflag\fR
.RS 4
Specifies whether YAZ client automatically reconnect if target closes connection (Z39\&.50 only)\&.
.sp

\fIflag\fR
must be either
on
or
off\&.
.RE
.PP
set_auto_wait \fIflag\fR
.RS 4
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\&.
.RE
.PP
set_marcdump \fIfilename\fR
.RS 4
Specifies that all retrieved records should be appended to file
\fIfilename\fR\&. This command does the thing as option
\-m\&.
.RE
.PP
schema \fIschemaid\fR
.RS 4
Specifies schema for retrieval\&. Schema may be specified as an OID for Z39\&.50\&. For SRU, schema is a simple string URI\&.
.RE
.PP
charset \fInegotiationcharset\fR [\fIdisplaycharset\fR] [[\fImarccharset\fR]]
.RS 4
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
Note
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
Note
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)\&.
.RE
.PP
negcharset \fIcharset\fR
.RS 4
Specifies character set for negotiation (Z39\&.50)\&. The argument is the same as second argument for command
charset\&.
.RE
.PP
displaycharset \fIcharset\fR
.RS 4
Specifies character set for output (display)\&. The argument is the same as second argument for command
charset\&.
.RE
.PP
marccharset \fIcharset\fR
.RS 4
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\&.
.RE
.PP
querycharset \fIcharset\fR
.RS 4
Specifies character set for query terms for Z39\&.50 RPN queries and Z39\&.50 Scan Requests (termListAndStartPoint)\&. This is a pure client\-side conversion which converts from displayCharset to queryCharset\&.
.RE
.PP
set_cclfile \fIfilename\fR
.RS 4
Specifies that CCL fields should be read from file file
\fIfilename\fR\&. This command does the thing as option
\-c\&.
.RE
.PP
set_cqlfile \fIfilename\fR
.RS 4
Specifies that CQL fields should be read from file file
\fIfilename\fR\&. This command does the thing as option
\-q\&.
.RE
.PP
register_oid \fIname\fR \fIclass\fR \fIOID\fR
.RS 4
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\&.
.RE
.PP
register_tab \fIcommand\fR \fIstring\fR
.RS 4
This command registers a TAB completion string for the command given\&.
.RE
.PP
sleep \fIseconds\fR
.RS 4
This command makes YAZ client sleep (be idle) for the number of seconds given\&.
.RE
.PP
wait_response [ \fInumber\fR]
.RS 4
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\&.
.RE
.PP
xmles \fIOID\fR \fIdoc\fR
.RS 4
Sends XML Extended Services request using the OID and doc given\&.
.RE
.PP
zversion \fIver\fR
.RS 4
This command sets Z39\&.50 version for negotiation\&. Should be used before
open\&. By default 3 (version 3) is used\&.
.RE
.PP
options \fIop1 op2\&.\&.\fR
.RS 4
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\&.
.RE
.SH "EXAMPLE"
.PP
The simplest example of a Prefix Query would be something like
.sp
.RS 4
.nf
    f knuth
   
.fi
.RE
.sp
or
.sp
.RS 4
.nf
    f "donald knuth"
   
.fi
.RE
.sp
In those queries no attributes was specified\&. This leaves it up to the server what fields to search but most servers will search in all fields\&. Some servers does not support this feature though, and require that some attributes are defined\&. To add one attribute you could do:
.sp
.RS 4
.nf
    f @attr 1=4 computer
   
.fi
.RE
.sp
where we search in the title field, since the use(1) is title(4)\&. If we want to search in the author field
\fIand\fR
in the title field, and in the title field using right truncation it could look something like this:
.sp
.RS 4
.nf
    f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
   
.fi
.RE
.sp
Finally using a mix of Bib\-1 and GILS attributes could look something like this:
.sp
.RS 4
.nf
    f @attrset Bib\-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
   
.fi
.RE
.sp
.SH "FILES"
.PP

\fIyaz\-<version>/client/client\&.c\fR
.PP

\fI$HOME/\&.yazclientrc\fR
.PP

\fI$HOME/\&.yazclient\&.history\fR
.SH "SEE ALSO"
.PP

\fByaz\fR(7)
.SH "NOTES"
.IP " 1." 4
Z39.50 standard
.RS 4
\%http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6
.RE
.IP " 2." 4
Z39.50 Standard
.RS 4
\%http://www.loc.gov/z3950/agency/defns/oids.html#5
.RE