1YAZ-CLIENT(1) YAZ-CLIENT(1)
2
3
4
6 yaz-client - Z39.50/SRU client for implementors
7
9 yaz-client [-a filename] [-b filename] [-c filename] [-d dump]
10 [-k size] [-m filename] [-p addr] [-q filename] [-u auth]
11 [-xV] [addr]
12
14 yaz-client is a Z39.50/SRU client (origin) with a simple command line
15 interface that allows you to test behavior and performance of Z39.50
16 targets and SRU servers.
17
18 If the addr is specified, the client creates a connection to the
19 Z39.50/SRU target at the address given.
20
21 When yaz-client is invoked it attemps to read the following files:
22 $HOME/.yazclientrc (home directory, Unix only) and (current directory -
23 any platform) For those files that are readable, the YAZ client
24 executes commands in those files. See COMMANDS section for description
25 of commands.
26
28 -a filename
29 If specified, logging of protocol packages will be appended file
30 given. If filename is specified as -, the output is written to
31 stdout.
32
33 -b filename
34 If specified, YAZ will dump BER data in readable notation to the
35 file specified. If filename is specified as - the output is written
36 to stdout.
37
38 -c filename
39 If specified, CCL configuration will be read from the file given.
40
41 -d dump
42 If specified, YAZ will dump BER data for all PDUs sent and received
43 to individual files, named dump.DDD.raw, where DDD is 001, 002, 003,
44 ..
45
46 -k size
47 Sets preferred messages and maximum record size for Initialize
48 Request in kilobytes. Default value is 1024 (1 MB).
49
50 -m filename
51 If specified, retrieved records will be appended to the file given.
52
53 -p addr
54 If specified, the client will use the proxy at the address given.
55
56 -q filename
57 If specified, CQL configuration will be read from the file given.
58
59 -u auth
60 If specified, the auth string will be used for authentication.
61
62 -V
63 Prints YAZ version.
64
65 -x
66 Makes the YAZ client print hex dumps of packages sent and received
67 on standard output.
68
70 The YAZ client accepts the following commands.
71
72 open zurl
73 Opens a connection to a server. The syntax for zurl is the same as
74 described above for connecting from the command line.
75
76 Syntax:
77
78 [(tcp|ssl|unix|http)':']host [:port][/base]
79
80 quit
81 Quits YAZ client
82
83 find query
84 Sends a Search Request using the query given. By default the query
85 is assumed to be PQF. See command querytype.
86
87 delete setname
88 Deletes result set with name setname on the server.
89
90 base base1 base2 ...
91 Sets the name(s) of the database(s) to search. One or more databases
92 may be specified separated by blanks. This commands overrides the
93 database given in zurl.
94
95 show [start[+number]]
96 Fetches records by sending a Present Request from the start position
97 given by start a number of records given by number. If start is not
98 given, then the client will fetch from position of the last
99 retrieved record plus 1. If number is not given, then one record
100 will be fetched at a time.
101
102 scan term
103 Scans database index for a term. The syntax resembles the syntax for
104 find. If you want to scan for the word water you could write
105
106 scan water
107
108 but if you want to scan only in, say the title field, you would
109 write
110
111 scan @attr 1=4 water
112
113
114 scanpos pos
115 Sets preferred position for scan. This value is used in next scan.
116 By default position is 1.
117
118 scansize size
119 Sets number of entries to be returned by scan. Default number of
120 entries is 20.
121
122 scanstep step
123 Set step-size for scan. This value is used in next scan sent to the
124 target. By default step-size is 0.
125
126 sort sortspecs
127 Sorts a result set. The sort command takes a sequence of
128 space-separated sort specifications, with each sort specification
129 consisting of two space-separated words (so that the whole
130 specification list is made up of an even number of words). The first
131 word of each specification holds a field (sort criterion) and the
132 second holds flags. If the sort criterion includes = it is assumed
133 that the SortKey is of type sortAttributes using Bib-1: in this case
134 the integer before = is the attribute type and the integer following
135 = is the attribute value. If no = is in the criterion it is treated
136 as a sortfield of type InternationalString. The flags word of each
137 sort specification must consist of s for case sensitive or i for
138 case insensitive, and < for ascending order or > for descending
139 order.
140
141 sort+
142 Same as sort but stores the sorted result set in a new result set.
143
144 authentication openauth
145 Sets up a authentication string if a server requires authentication
146 (v2 OpenStyle). The authentication string is first sent to the
147 server when the open command is issued and the Z39.50 Initialize
148 Request is sent, so this command must be used before open in order
149 to be effective. A common convention for the authopen string is that
150 the username - and password is separated by a slash, e.g.
151 myusername/mysecret.
152
153 sru method
154 Selects SRU method. Must be one of POST, GET, SOAP (default).
155
156 list_all
157 This command displays status and values for many settings.
158
159 lslb n
160 Sets the limit for when no records should be returned together with
161 the search result. See the [1] Z39.50 standard for more details.
162
163 ssub n
164 Sets the limit for when all records should be returned with the
165 search result. See the [1] Z39.50 standard for more details.
166
167 mspn n
168 Sets the number of records should be returned if the number of
169 records in the result set is between the values of lslb and ssub.
170 See the [1] Z39.50 standard for more details.
171
172 status
173 Displays the values of lslb, ssub and mspn.
174
175 setname
176 Switches named result sets on and off. Default is on.
177
178 cancel
179 Sends a Trigger Resource Control Request to the target.
180
181 format oid
182 Sets the preferred transfer syntax for retrieved records. yaz-client
183 supports all the record syntaxes that currently are registered. See
184 [2] Z39.50 Standard for more details. Commonly used records syntaxes
185 include usmarc, sutrs, grs1 and xml.
186
187 elements e
188 Sets the element set name for the records. Many targets support
189 element sets are B (for brief) and F (for full).
190
191 close
192 Sends a Z39.50 Close APDU and closes connection with the peer
193
194 querytype type
195 Sets the query type as used by command find. The following is
196 supported: prefix for Prefix Query Notation (Type-1 Query); ccl for
197 CCL search (Type-2 Query), cql for CQL (Type-104 search with CQL
198 OID), ccl2rpn for CCL to RPN conversion (Type-1 Query). cql2rpn for
199 CQL to RPN conversion (Type-1 Query).
200
201 attributeset set
202 Sets attribute set OID for prefix queries (RPN, Type-1).
203
204 refid id
205 Sets reference ID for Z39.50 Request(s).
206
207 itemorder type no
208 Sends an Item Order Request using the ILL External. type is either
209 1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The no
210 is the Result Set position of the record to be ordered.
211
212 update action recid doc
213 Sends Item Update Request. The action argument must be the action
214 type: one of insert, replace, delete and update. The second
215 argument, recid, is the record identifier (any string). Third
216 argument which is optional is the record document for the request.
217 If doc is a quoted string (double quotes) the string content is used
218 verbatim. If doc is not a quoted string, it is assumed to be a
219 filename which is read, then sent as the docuemnt content. If doc is
220 omitted, the last received record (as parf of present response or
221 piggybacked search response) is used for the update.
222
223 source filename
224 Executes list of commands from file filename, just like source on
225 most UNIX shells. A single dot (.) can be used as an alternative.
226
227 ! args
228 Executes command args in subshell using the system call.
229
230 push_command command
231 The push_command takes another command as its argument. That command
232 is then added to the history information (so you can retrieve it
233 later). The command itself is not executed. This command only works
234 if you have GNU readline/history enabled.
235
236 set_apdufile filename
237 Sets that APDU should be logged to file filename. Another way to
238 achieve APDU log is by using command-line option -a.
239
240 set_auto_reconnect flag
241 Specifies whether YAZ client automatically reconnect if target
242 closes connection (Z39.50 only).
243
244
245 flag must be either on or off.
246
247 set_auto_wait flag
248 Specifies whether YAZ client should wait for response protocol
249 packages after a request. By default YAZ client waits (on) for
250 response packages immediately after a command (find, show) has been
251 issued. If off is used, YAZ client does not attempt to receive
252 packages automatically. These will have to be manually received when
253 command wait_response is used.
254
255
256 flag must be either on or off.
257
258 set_marcdump filename
259 Specifies that all retrieved records should be appended to file
260 filename. This command does the thing as option -m.
261
262 schema schemaid
263 Specifies schema for retrieval. Schema may be specified as an OID
264 for Z39.50. For SRU, schema is a simple string URI.
265
266 charset negotiationcharset [displaycharset] [[marccharset]]
267 Specifies character set (encoding) for Z39.50 negotiation / SRU
268 encoding and/or character set for output (terminal).
269
270
271 negotiationcharset is the name of the character set to be negotiated
272 by the server. The special name - for negotiationcharset specifies
273 no character set to be negotiated.
274
275 If displaycharset is given, it specifies name of the character set
276 of the output (on the terminal on which YAZ client is running). To
277 disable conversion of characters to the output encoding, the special
278 name - (dash) can be used. If the special name auto is given, YAZ
279 client will convert strings to the encoding of the terminal as
280 returned by nl_langinfo call.
281
282 If marcharset is given, it specifies name of the character set of
283 retrieved MARC records from server. See also marcharset command.
284
285 Note
286 Since character set negotation takes effect in the Z39.50 Initialize
287 Request you should issue this command before command open is used.
288
289 Note
290 MARC records are not covered by Z39.50 character set negotiation, so
291 that's why there is a separate character that must be known in order
292 to do meaningful converson(s).
293
294 negcharset charset
295 Specifies character set for negotiation (Z39.50). The argument is
296 the same as second argument for command charset.
297
298 displaycharset charset
299 Specifies character set for output (display). The argument is the
300 same as second argument for command charset.
301
302 marccharset charset
303 Specifies character set for retrieved MARC records so that YAZ
304 client can display them in a character suitable for your display.
305 See charset command. If auto is given, YAZ will assume that
306 MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC
307 variants. The charset argument is the same as third argument for
308 command charset.
309
310 set_cclfile filename
311 Specifies that CCL fields should be read from file file filename.
312 This command does the thing as option -c.
313
314 set_cqlfile filename
315 Specifies that CQL fields should be read from file file filename.
316 This command does the thing as option -q.
317
318 register_oid name class OID
319 This command allows you to register your own object identifier - so
320 that instead of entering a long dot-notation you can use a short
321 name instead. The name is your name for the OID, class is the class,
322 and OID is the raw OID in dot notation. Class is one appctx, absyn,
323 attet, transyn, diagset, recsyn, resform, accform, extserv,
324 userinfo, elemspec, varset, schema, tagset, general. If you're in
325 doubt use the general class.
326
327 register_tab command string
328 This command registers a TAB completion string for the command
329 given.
330
331 sleep seconds
332 This command makes YAZ client sleep (be idle) for the number of
333 seconds given.
334
335 wait_response [ number]
336 This command makes YAZ client wait for a number of response packages
337 from target. If number is omitted, 1 is assumed.
338
339 This command is rarely used and is only useful if command
340 set_auto_wait is set to off.
341
342 xmles OID doc
343 Sends XML Extended Services request using the OID and doc given.
344
345 zversion ver
346 This command sets Z39.50 version for negotiation. Should be used
347 before open. By default 3 (version 3) is used.
348
349 options op1 op2..
350 This command sets Z39.50 options for negotiation. Should be used
351 before open.
352
353 The following options are supported: search, present, delSet,
354 resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan,
355 sort, extendedServices, level_1Segmentation, level_2Segmentation,
356 concurrentOperations, namedResultSets, encapsulation, resultCount,
357 negotiationModel, duplicationDetection, queryType104,
358 pQESCorrection, stringSchema.
359
361 yaz-<version>/client/client.c
362
363 $HOME/.yazclientrc
364
365 $HOME/.yazclient.history
366
368 yaz(7)
369
370 Section "The YAZ Client" in the YAZ manual.
371
372 Section "Prefix Query Format" in the YAZ manual.
373
374 Section "Common Command Language" in the YAZ manual.
375
376 Section "Common Query Language" in the YAZ manual.
377
379 1. Z39.50 standard
380 http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6
381
382 2. Z39.50 Standard
383 http://www.loc.gov/z3950/agency/defns/oids.html#5
384
385
386
387YAZ 2.1.54 03/16/2007 YAZ-CLIENT(1)