String-values attributes are now handled correctly in rpn2perl(), and
[simpleserver-moved-to-github.git] / SimpleServer.pm
1 ##
2 ##  Copyright (c) 2000-2006, Index Data.
3 ##
4 ##  Permission to use, copy, modify, distribute, and sell this software and
5 ##  its documentation, in whole or in part, for any purpose, is hereby granted,
6 ##  provided that:
7 ##
8 ##  1. This copyright and permission notice appear in all copies of the
9 ##  software and its documentation. Notices of copyright or attribution
10 ##  which appear at the beginning of any file must remain unchanged.
11 ##
12 ##  2. The name of Index Data or the individual authors may not be used to
13 ##  endorse or promote products derived from this software without specific
14 ##  prior written permission.
15 ##
16 ##  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 ##  EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 ##  WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 ##  IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 ##  INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 ##  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 ##  NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 ##  LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 ##  OF THIS SOFTWARE.
25 ##
26 ##
27
28 ## $Id: SimpleServer.pm,v 1.35 2007-08-15 13:21:22 mike Exp $
29
30 package Net::Z3950::SimpleServer;
31
32 use strict;
33 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
34 use Carp;
35
36 require Exporter;
37 require DynaLoader;
38 require AutoLoader;
39
40 @ISA = qw(Exporter AutoLoader DynaLoader);
41 @EXPORT = qw( );
42 $VERSION = '1.06';
43
44 bootstrap Net::Z3950::SimpleServer $VERSION;
45
46 # Preloaded methods go here.
47
48 my $count = 0;
49
50 sub new {
51         my $class = shift;
52         my %args = @_;
53         my $self = \%args;
54
55         if ($count) {
56                 carp "SimpleServer.pm: WARNING: Multithreaded server unsupported";
57         }
58         $count = 1;
59
60         croak "SimpleServer.pm: ERROR: Unspecified search handler" unless defined($self->{SEARCH});
61         croak "SimpleServer.pm: ERROR: Unspecified fetch handler" unless defined($self->{FETCH});
62
63         bless $self, $class;
64         return $self;
65 }
66
67
68 sub launch_server {
69         my $self = shift;
70         my @args = @_;
71
72         ### This modal internal interface, in which we set a bunch of
73         #   globals and then call start_server(), is asking for
74         #   trouble.  Instead, we should just pass the $self object
75         #   as a parameter into start_server().
76         if (defined($self->{GHANDLE})) {
77                 set_ghandle($self->{GHANDLE});
78         }
79         if (defined($self->{INIT})) {
80                 set_init_handler($self->{INIT});
81         }
82         set_search_handler($self->{SEARCH});
83         set_fetch_handler($self->{FETCH});
84         if (defined($self->{CLOSE})) {
85                 set_close_handler($self->{CLOSE});
86         }
87         if (defined($self->{PRESENT})) {
88                 set_present_handler($self->{PRESENT});
89         }
90         if (defined($self->{SCAN})) {
91                 set_scan_handler($self->{SCAN});
92         }
93         if (defined($self->{SORT})) {
94                 set_sort_handler($self->{SORT});
95         }
96         if (defined($self->{EXPLAIN})) {
97                 set_explain_handler($self->{EXPLAIN});
98         }
99
100         start_server(@args);
101 }
102
103
104 # Register packages that we will use in translated RPNs
105 package Net::Z3950::APDU::Query;
106 package Net::Z3950::APDU::OID;
107 package Net::Z3950::RPN::And;
108 package Net::Z3950::RPN::Or;
109 package Net::Z3950::RPN::AndNot;
110 package Net::Z3950::RPN::Term;
111 package Net::Z3950::RPN::RSID;
112 package Net::Z3950::RPN::Attributes;
113 package Net::Z3950::RPN::Attribute;
114
115 # Must revert to original package for Autoloader's benefit
116 package Net::Z3950::SimpleServer;
117
118
119 # Autoload methods go after =cut, and are processed by the autosplit program.
120
121 1;
122 __END__
123 # Below is the stub of documentation for your module. You better edit it!
124
125 =head1 NAME
126
127 Net::Z3950::SimpleServer - Simple Perl API for building Z39.50 servers. 
128
129 =head1 SYNOPSIS
130
131   use Net::Z3950::SimpleServer;
132
133   sub my_search_handler {
134         my $args = shift;
135
136         my $set_id = $args->{SETNAME};
137         my @database_list = @{ $args->{DATABASES} };
138         my $query = $args->{QUERY};
139
140         ## Perform the query on the specified set of databases
141         ## and return the number of hits:
142
143         $args->{HITS} = $hits;
144   }
145
146   sub my_fetch_handler {        # Get a record for the user
147         my $args = shift;
148
149         my $set_id = $args->{SETNAME};
150
151         my $record = fetch_a_record($args->{OFFSET});
152
153         $args->{RECORD} = $record;
154         if (number_of_hits() == $args->{OFFSET}) {      ## Last record in set?
155                 $args->{LAST} = 1;
156         } else {
157                 $args->{LAST} = 0;
158         }
159   }
160
161   ## Register custom event handlers:
162   my $z = new Net::Z3950::SimpleServer(GHANDLE = $someObject,
163                                        INIT   =>  \&my_init_handler,
164                                        CLOSE  =>  \&my_close_handler,
165                                        SEARCH =>  \&my_search_handler,
166                                        FETCH  =>  \&my_fetch_handler);
167
168   ## Launch server:
169   $z->launch_server("ztest.pl", @ARGV);
170
171 =head1 DESCRIPTION
172
173 The SimpleServer module is a tool for constructing Z39.50 "Information
174 Retrieval" servers in Perl. The module is easy to use, but it
175 does help to have an understanding of the Z39.50 query
176 structure and the construction of structured retrieval records.
177
178 Z39.50 is a network protocol for searching remote databases and
179 retrieving the results in the form of structured "records". It is widely
180 used in libraries around the world, as well as in the US Federal Government.
181 In addition, it is generally useful whenever you wish to integrate a number
182 of different database systems around a shared, asbtract data model.
183
184 The model of the module is simple: It implements a "generic" Z39.50
185 server, which invokes callback functions supplied by you to search
186 for content in your database. You can use any tools available in
187 Perl to supply the content, including modules like DBI and
188 WWW::Search.
189
190 The server will take care of managing the network connections for
191 you, and it will spawn a new process (or thread, in some
192 environments) whenever a new connection is received.
193
194 The programmer can specify subroutines to take care of the following type
195 of events:
196
197   - Initialize request
198   - Search request
199   - Present request
200   - Fetching of records
201   - Scan request (browsing) 
202   - Closing down connection
203
204 Note that only the Search and Fetch handler functions are required.
205 The module can supply default responses to the other on its own.
206
207 After the launching of the server, all control is given away from
208 the Perl script to the server. The server calls the registered
209 subroutines to field incoming requests from Z39.50 clients.
210
211 A reference to an anonymous hash is passed to each handler. Some of
212 the entries of these hashes are to be considered input and others
213 output parameters.
214
215 The Perl programmer specifies the event handlers for the server by
216 means of the SimpleServer object constructor
217
218   my $z = new Net::Z3950::SimpleServer(
219                         INIT    =>      \&my_init_handler,
220                         CLOSE   =>      \&my_close_handler,
221                         SEARCH  =>      \&my_search_handler,
222                         PRESENT =>      \&my_present_handler,
223                         SCAN    =>      \&my_scan_handler,
224                         FETCH   =>      \&my_fetch_handler,
225                         EXPLAIN =>      \&my_explain_handler);
226
227 In addition, the arguments to the constructor may include GHANDLE, a
228 global handle which is made available to each invocation of every
229 callback function.  This is typically a reference to either a hash or
230 an object.
231
232 If you want your SimpleServer to start a thread (threaded mode) to
233 handle each incoming Z39.50 request instead of forking a process
234 (forking mode), you need to register the handlers by symbol rather
235 than by code reference. Thus, in threaded mode, you will need to
236 register your handlers this way:
237
238   my $z = new Net::Z3950::SimpleServer(
239                         INIT    =>      "my_package::my_init_handler",
240                         CLOSE   =>      "my_package::my_close_handler",
241                         ....
242                         ....          );
243
244 where my_package is the Perl package in which your handler is
245 located.
246
247 After the custom event handlers are declared, the server is launched
248 by means of the method
249
250   $z->launch_server("MyServer.pl", @ARGV);
251
252 Notice, the first argument should be the name of your server
253 script (for logging purposes), while the rest of the arguments
254 are documented in the YAZ toolkit manual: The section on
255 application invocation: <http://www.indexdata.dk/yaz/yaz-7.php>
256
257 In particular, you need to use the -T switch to start your SimpleServer
258 in threaded mode.
259
260 =head2 Init handler
261
262 The init handler is called whenever a Z39.50 client is attempting
263 to logon to the server. The exchange of parameters between the
264 server and the handler is carried out via an anonymous hash reached
265 by a reference, i.e.
266
267   $args = shift;
268
269 The argument hash passed to the init handler has the form
270
271   $args = {
272                                     ## Response parameters:
273
274              IMP_ID    =>  "",      ## Z39.50 Implementation ID
275              IMP_NAME  =>  "",      ## Z39.50 Implementation name
276              IMP_VER   =>  "",      ## Z39.50 Implementation version
277              ERR_CODE  =>  0,       ## Error code, cnf. Z39.50 manual
278              ERR_STR   =>  "",      ## Error string (additional info.)
279              USER      =>  "xxx"    ## If Z39.50 authentication is used,
280                                     ## this member contains user name
281              PASS      =>  "yyy"    ## Under same conditions, this member
282                                     ## contains the password in clear text
283              GHANDLE   =>  $obj     ## Global handler specified at creation
284              HANDLE    =>  undef    ## Handler of Perl data structure
285           };
286
287 The HANDLE member can be used to store any scalar value which will then
288 be provided as input to all subsequent calls (ie. for searching, record
289 retrieval, etc.). A common use of the handle is to store a reference to
290 a hash which may then be used to store session-specific parameters.
291 If you have any session-specific information (such as a list of
292 result sets or a handle to a back-end search engine of some sort),
293 it is always best to store them in a private session structure -
294 rather than leaving them in global variables in your script.
295
296 The Implementation ID, name and version are only really used by Z39.50
297 client developers to see what kind of server they're dealing with.
298 Filling these in is optional.
299
300 The ERR_CODE should be left at 0 (the default value) if you wish to
301 accept the connection. Any other value is interpreted as a failure
302 and the client will be shown the door, with the code and the
303 associated additional information, ERR_STR returned.
304
305 =head2 Search handler
306
307 Similarly, the search handler is called with a reference to an anony-
308 mous hash. The structure is the following:
309
310   $args = {
311                                     ## Request parameters:
312
313              GHANDLE   =>  $obj     ## Global handler specified at creation
314              HANDLE    =>  ref,     ## Your session reference.
315              SETNAME   =>  "id",    ## ID of the result set
316              REPL_SET  =>  0,       ## Replace set if already existing?
317              DATABASES =>  ["xxx"], ## Reference to a list of data-
318                                     ## bases to search
319              QUERY     =>  "query", ## The query expression
320              RPN       =>  $obj,    ## Reference to a Net::Z3950::APDU::Query
321
322                                     ## Response parameters:
323
324              ERR_CODE  =>  0,       ## Error code (0=Succesful search)
325              ERR_STR   =>  "",      ## Error string
326              HITS      =>  0        ## Number of matches
327           };
328
329 Note that a search which finds 0 hits is considered successful in
330 Z39.50 terms - you should only set the ERR_CODE to a non-zero value
331 if there was a problem processing the request. The Z39.50 standard
332 provides a comprehensive list of standard diagnostic codes, and you
333 should use these whenever possible.
334
335 The QUERY is a tree-structure of terms combined by operators, the
336 terms being qualified by lists of attributes. The query is presented
337 to the search function in the Prefix Query Format (PQF) which is
338 used in many applications based on the YAZ toolkit. The full grammar
339 is described in the YAZ manual.
340
341 The following are all examples of valid queries in the PQF. 
342
343         dylan
344
345         "bob dylan"
346
347         @or "dylan" "zimmerman"
348
349         @set Result-1
350
351         @or @and bob dylan @set Result-1
352
353         @and @attr 1=1 "bob dylan" @attr 1=4 "slow train coming"
354
355         @attrset @attr 4=1 @attr 1=4 "self portrait"
356
357 You will need to write a recursive function or something similar to
358 parse incoming query expressions, and this is usually where a lot of
359 the work in writing a database-backend happens. Fortunately, you don't
360 need to support anymore functionality than you want to. For instance,
361 it is perfectly legal to not accept boolean operators, but you SHOULD
362 try to return good error codes if you run into something you can't or
363 won't support.
364
365 A more convenient alternative to the QUERY member may be the RPN
366 member, which is a reference to a Net::Z3950::APDU::Query object
367 representing the RPN query tree.  The structure of that object is
368 supposed to be self-documenting, but here's a brief summary of what
369 you get:
370
371 =over 4
372
373 =item *
374
375 C<Net::Z3950::APDU::Query> is a hash with two fields:
376
377 Z<>
378
379 =over 4
380
381 =item C<attributeSet>
382
383 Optional.  If present, it is a reference to a
384 C<Net::Z3950::APDU::OID>.  This is a string of dot-separated integers
385 representing the OID of the query's top-level attribute set.
386
387 =item C<query>
388
389 Mandatory: a refererence to the RPN tree itself.
390
391 =back
392
393 =item *
394
395 Each node of the tree is an object of one of the following types:
396
397 Z<>
398
399 =over 4
400
401 =item C<Net::Z3950::RPN::And>
402
403 =item C<Net::Z3950::RPN::Or>
404
405 =item C<Net::Z3950::RPN::AndNot>
406
407 These three classes are all arrays of two elements, each of which is a
408 node of one of the above types.
409
410 =item C<Net::Z3950::RPN::Term>
411
412 See below for details.
413
414 =item C<Net::Z3950::RPN::RSID>
415
416 A reference to a result-set ID indicating a previous search.  The ID
417 of the result-set is in the C<id> element.
418
419 =back
420
421 (I guess I should make a superclass C<Net::Z3950::RPN::Node> and make
422 all of these subclasses of it.  Not done that yet, but will do one day.)
423
424 =back
425
426 =over 4
427
428 =item *
429
430 C<Net::Z3950::RPN::Term> is a hash with two fields:
431
432 Z<>
433
434 =over 4
435
436 =item C<term>
437
438 A string containing the search term itself.
439
440 =item C<attributes>
441
442 A reference to a C<Net::Z3950::RPN::Attributes> object.
443
444 =back
445
446 =item *
447
448 C<Net::Z3950::RPN::Attributes> is an array of references to
449 C<Net::Z3950::RPN::Attribute> objects.  (Note the plural/singular
450 distinction.)
451
452 =item *
453
454 C<Net::Z3950::RPN::Attribute> is a hash with three elements:
455
456 Z<>
457
458 =over 4
459
460 =item C<attributeSet>
461
462 Optional.  If present, it is dot-separated OID string, as above.
463
464 =item C<attributeType>
465
466 An integer indicating the type of the attribute - for example, under
467 the BIB-1 attribute set, type 1 indicates a ``use'' attribute, type 2
468 a ``relation'' attribute, etc.
469
470 =item C<attributeValue>
471
472 An integer indicating the value of the attribute - for example, under
473 BIB-1, if the attribute type is 1, then value 4 indictates a title
474 search and 7 indictates an ISBN search; but if the attribute type is
475 2, then value 4 indicates a ``greater than or equal'' search, and 102
476 indicates a relevance match.
477
478 =back
479
480 =back
481
482 Note that, at the moment, none of these classes have any methods at
483 all: the blessing into classes is largely just a documentation thing
484 so that, for example, if you do
485
486         { use Data::Dumper; print Dumper($args->{RPN}) }
487
488 you get something fairly human-readable.  But of course, the type
489 distinction between the three different kinds of boolean node is
490 important.
491
492 By adding your own methods to these classes (building what I call
493 ``augmented classes''), you can easily build code that walks the tree
494 of the incoming RPN.  Take a look at C<samples/render-search.pl> for a
495 sample implementation of such an augmented classes technique.
496
497
498 =head2 Present handler
499
500 The presence of a present handler in a SimpleServer front-end is optional.
501 Each time a client wishes to retrieve records, the present service is
502 called. The present service allows the origin to request a certain number
503 of records retrieved from a given result set.
504 When the present handler is called, the front-end server should prepare a
505 result set for fetching. In practice, this means to get access to the
506 data from the backend database and store the data in a temporary fashion
507 for fast and efficient fetching. The present handler does *not* fetch
508 anything. This task is taken care of by the fetch handler, which will be
509 called the correct number of times by the YAZ library. More about this
510 below.
511 If no present handler is implemented in the front-end, the YAZ toolkit
512 will take care of a minimum of preparations itself. This default present
513 handler is sufficient in many situations, where only a small amount of
514 records are expected to be retrieved. If on the other hand, large result
515 sets are likely to occur, the implementation of a reasonable present
516 handler can gain performance significantly.
517
518 The informations exchanged between client and present handle are:
519
520   $args = {
521                                     ## Client/server request:
522
523              GHANDLE   =>  $obj     ## Global handler specified at creation
524              HANDLE    =>  ref,     ## Reference to datastructure
525              SETNAME   =>  "id",    ## Result set ID
526              START     =>  xxx,     ## Start position
527              COMP      =>  "",      ## Desired record composition
528              NUMBER    =>  yyy,     ## Number of requested records
529
530
531                                     ## Respons parameters:
532
533              HITS      =>  zzz,     ## Number of returned records
534              ERR_CODE  =>  0,       ## Error code
535              ERR_STR   =>  ""       ## Error message
536           };
537
538
539 =head2 Fetch handler
540
541 The fetch handler is asked to retrieve a SINGLE record from a given
542 result set (the front-end server will automatically call the fetch
543 handler as many times as required).
544
545 The parameters exchanged between the server and the fetch handler are
546
547   $args = {
548                                     ## Client/server request:
549
550              GHANDLE   =>  $obj     ## Global handler specified at creation
551              HANDLE    =>  ref      ## Reference to data structure
552              SETNAME   =>  "id"     ## ID of the requested result set
553              OFFSET    =>  nnn      ## Record offset number
554              REQ_FORM  =>  "n.m.k.l"## Client requested format OID
555              COMP      =>  "xyz"    ## Formatting instructions
556              SCHEMA    =>  "abc"    ## Requested schema, if any
557
558                                     ## Handler response:
559
560              RECORD    =>  ""       ## Record string
561              BASENAME  =>  ""       ## Origin of returned record
562              LAST      =>  0        ## Last record in set?
563              ERR_CODE  =>  0        ## Error code
564              ERR_STR   =>  ""       ## Error string
565              SUR_FLAG  =>  0        ## Surrogate diagnostic flag
566              REP_FORM  =>  "n.m.k.l"## Provided format OID
567              SCHEMA    =>  "abc"    ## Provided schema, if any
568           };
569
570 The REP_FORM value has by default the REQ_FORM value but can be set to
571 something different if the handler desires. The BASENAME value should
572 contain the name of the database from where the returned record originates.
573 The ERR_CODE and ERR_STR works the same way they do in the search
574 handler. If there is an error condition, the SUR_FLAG is used to
575 indicate whether the error condition pertains to the record currently
576 being retrieved, or whether it pertains to the operation as a whole
577 (eg. the client has specified a result set which does not exist.)
578
579 If you need to return USMARC records, you might want to have a look at
580 the MARC module on CPAN, if you don't already have a way of generating
581 these.
582
583 NOTE: The record offset is 1-indexed - 1 is the offset of the first
584 record in the set.
585
586 =head2 Scan handler
587
588 A full featured Z39.50 server should support scan (or in some literature
589 browse). The client specifies a starting term of the scan, and the server
590 should return an ordered list of specified length consisting of terms
591 actually occurring in the data base. Each of these terms should be close
592 to or equal to the term originally specified. The quality of scan compared
593 to simple search is a guarantee of hits. It is simply like browsing through
594 an index of a book, you always find something! The parameters exchanged are
595
596   $args = {
597                                                 ## Client request
598
599                 GHANDLE         => $obj,        ## Global handler specified at creation
600                 HANDLE          => $ref,        ## Reference to data structure
601                 DATABASES       => ["xxx"],     ## Reference to a list of data-
602                                                 ## bases to search
603                 TERM            => 'start',     ## The start term
604                 NUMBER          => xx,          ## Number of requested terms
605                 POS             => yy,          ## Position of starting point
606                                                 ## within returned list
607                 STEP            => 0,           ## Step size
608
609                                                 ## Server response
610
611                 ERR_CODE        => 0,           ## Error code
612                 ERR_STR         => '',          ## Diagnostic message
613                 NUMBER          => zz,          ## Number of returned terms
614                 STATUS          => $status,     ## ScanSuccess/ScanFailure
615                 ENTRIES         => $entries     ## Referenced list of terms
616         };
617
618 where the term list is returned by reference in the scalar $entries, which
619 should point at a data structure of this kind,
620
621   my $entries = [
622                         {       TERM            => 'energy',
623                                 OCCURRENCE      => 5            },
624
625                         {       TERM            => 'energy density',
626                                 OCCURRENCE      => 6,           },
627
628                         {       TERM            => 'energy flow',
629                                 OCCURRENCE      => 3            },
630
631                                 ...
632
633                                 ...
634         ];
635
636 The $status flag is only meaningful after a successful scan, and
637 should be assigned one of two values:
638
639   Net::Z3950::SimpleServer::ScanSuccess  Full success (default)
640   Net::Z3950::SimpleServer::ScanPartial  Fewer terms returned than requested
641
642 The STEP member contains the requested number of entries in the term-list
643 between two adjacent entries in the response.
644
645 =head2 Close handler
646
647 The argument hash recieved by the close handler has two elements only:
648
649   $args = {
650                                     ## Server provides:
651
652              GHANDLE   =>  $obj     ## Global handler specified at creation
653              HANDLE    =>  ref      ## Reference to data structure
654           };
655
656 What ever data structure the HANDLE value points at goes out of scope
657 after this call. If you need to close down a connection to your server
658 or something similar, this is the place to do it.
659
660 =head2 Support for SRU and SRW
661
662 Since release 1.0, SimpleServer includes support for serving the SRU
663 and SRW protocols as well as Z39.50.  These ``web-friendly'' protocols
664 enable similar functionality to that of Z39.50, but by means of rich
665 URLs in the case of SRU, and a SOAP-based web-service in the case of
666 SRW.  These protocols are described at
667 http://www.loc.gov/sru
668
669 In order to serve these protocols from a SimpleServer-based
670 application, it is necessary to launch the application with a YAZ
671 Generic Frontend Server (GFS) configuration file, which can be
672 specified using the command-line argument C<-f> I<filename>.  A
673 minimal configuration file looks like this:
674
675   <yazgfs>
676     <server>
677       <cql2rpn>pqf.properties</cql2rpn>
678     </server>
679   </yazgfs>
680
681 This file specifies only that C<pqf.properties> should be used to
682 translate the CQL queries of SRU and SRW into corresponding Z39.50
683 Type-1 queries.  For more information about YAZ GFS configuration,
684 including how to specify an Explain record, see the I<Virtual Hosts>
685 section of the YAZ manual at
686 http://indexdata.com/yaz/doc/server.vhosts.tkl
687
688 The mapping of CQL queries into Z39.50 Type-1 queries is specified by
689 a file that indicates which BIB-1 attributes should be generated for
690 each CQL index, relation, modifiers, etc.  A typical section of this
691 file looks like this:
692
693   index.dc.title                        = 1=4
694   index.dc.subject                      = 1=21
695   index.dc.creator                      = 1=1003
696   relation.<                            = 2=1
697   relation.le                           = 2=2
698
699 This file specifies the BIB-1 access points (type=1) for the Dublin
700 Core indexes C<title>, C<subject> and C<creator>, and the BIB-1
701 relations (type=2) corresponding to the CQL relations C<E<lt>> and
702 C<E<lt>=>.  For more information about the format of this file, see
703 the I<CQL> section of the YAZ manual at
704 http://indexdata.com/yaz/doc/tools.tkl#tools.cql
705
706 The YAZ distribution include a sample CQL-to-PQF mapping configuration
707 file called C<pqf.properties>; this is sufficient for many
708 applications, and a good base to work from for most others.
709
710 If a SimpleServer-based application is run without this SRU-specific
711 configuration, it can still serve SRU; however, CQL queries will not
712 be translated, but passed straight through to the search-handler
713 function, as the C<CQL> member of the parameters hash.  It is then the
714 responsibility of the back-end application to parse and handle the CQL
715 query, which is most easily done using Ed Summers' fine C<CQL::Parser>
716 module, available from CPAN at
717 http://search.cpan.org/~esummers/CQL-Parser/
718
719 =head1 AUTHORS
720
721 Anders Sønderberg (sondberg@indexdata.dk),
722 Sebastian Hammer (quinn@indexdata.dk),
723 Mike Taylor (indexdata.com).
724
725 =head1 SEE ALSO
726
727 Any Perl module which is useful for accessing the database of your
728 choice.
729
730 =cut