X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Ftools.xml;h=9ca9e2470cd140096cfbc15ac00a24d5b5974e7a;hb=757c8c0ffb82023c9059d9a5997515f65ad68561;hp=add24b4c022007ca84152f5f56e640db08d4e365;hpb=08eb8faf0366e6e0814ecd80ddd0ce6392424a52;p=yaz-moved-to-github.git diff --git a/doc/tools.xml b/doc/tools.xml index add24b4..9ca9e24 100644 --- a/doc/tools.xml +++ b/doc/tools.xml @@ -1,4 +1,4 @@ - + Supporting Tools @@ -225,7 +225,7 @@ @and. Its semantics are described in section 3.7.2 (Proximity) of Z39.50 the standard itself, which can be read on-line at - + In PQF, the proximity operation is represented by a sequence @@ -294,50 +294,63 @@ (The numeric values of the relation and well-known unit-code parameters are taken straight from - the ASN.1 of the proximity structure in the standard.) PQF queries - PQF queries using simple terms + + PQF queries using simple terms dylan + "bob dylan" - PQF boolean operators + + PQF boolean operators @or "dylan" "zimmerman" + @and @or dylan zimmerman when + @and when @or dylan zimmerman - PQF references to result sets + + PQF references to result sets @set Result-1 - @and @set seta setb + + @and @set seta @set setb - Attributes for terms + + Attributes for terms @attr 1=4 computer + @attr 1=4 @attr 4=1 "self portrait" + @attrset exp1 @attr 1=1 CategoryList + @attr gils 1=2008 Copenhagen + @attr 1=/book/title computer - PQF Proximity queries + + PQF Proximity queries @prox 0 3 1 2 k 2 dylan zimmerman @@ -376,14 +389,16 @@ - PQF specification of search term + + PQF specification of search term type @term string "a UTF-8 string, maybe?" - PQF mixed queries + + PQF mixed queries @or @and bob dylan @set Result-1 @@ -431,7 +446,8 @@ license, it is included as a supplement to &yaz;. - CCL Syntax + + CCL Syntax The CCL parser obeys the following grammar for the FIND argument. @@ -480,7 +496,8 @@ - CCL queries + + CCL queries The following queries are all valid: @@ -514,7 +531,8 @@ - CCL Qualifiers + + CCL Qualifiers Qualifiers are used to direct the search to a particular searchable @@ -536,7 +554,8 @@ lines in a CCL profile: qualifier specification, qualifier alias, comments and directives. - Qualifier specification + + Qualifier specification A qualifier specification is of the form: @@ -561,7 +580,8 @@ or c for completeness. The attributes for the special qualifier name term are used when no CCL qualifier is given in a query. - Common Bib-1 attributes +
+ Common Bib-1 attributes @@ -632,17 +652,16 @@
- The complete list of Bib-1 attributes can be found - - here - . + Refer to the complete + list of Bib-1 attributes It is also possible to specify non-numeric attribute values, which are used in combination with certain types. The special combinations are: - Special attribute combos +
+ Special attribute combos @@ -728,7 +747,7 @@
- CCL profile + CCL profile Consider the following definition: @@ -773,7 +792,8 @@
- Qualifier alias + + Qualifier alias A qualifier alias is of the form: @@ -790,20 +810,23 @@ - Comments + + Comments Lines with white space or lines that begin with character # are treated as comments. - Directives + + Directives Directive specifications takes the form @directive value - CCL directives +
+ CCL directives @@ -867,7 +890,8 @@
- CCL API + + CCL API All public definitions can be found in the header file ccl.h. A profile identifier is of type @@ -930,22 +954,20 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, - CQL + CQL - CQL + CQL - Common Query Language - was defined for the - SRW - protocol. + SRU protocol. In many ways CQL has a similar syntax to CCL. The objective of CQL is different. Where CCL aims to be an end-user language, CQL is the protocol - query language for SRW. + query language for SRU. If you are new to CQL, read the - Gentle - Introduction. + Gentle Introduction. @@ -965,17 +987,16 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, The parser converts a valid CQL query to PQF, thus providing a - way to use CQL for both SRW/SRU servers and Z39.50 targets at the + way to use CQL for both SRU servers and Z39.50 targets at the same time. The parser converts CQL to - - XCQL. + XCQL. XCQL is an XML representation of CQL. - XCQL is part of the SRW specification. However, since SRU + XCQL is part of the SRU specification. However, since SRU supports CQL only, we don't expect XCQL to be widely used. Furthermore, CQL has the advantage over XCQL that it is easy to read. @@ -983,7 +1004,7 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, - CQL parsing + CQL parsing A CQL parser is represented by the CQL_parser handle. Its contents should be considered &yaz; internal (private). @@ -1029,7 +1050,7 @@ int cql_parser_stdio(CQL_parser cp, FILE *f); - CQL tree + CQL tree The the query string is valid, the CQL parser generates a tree representing the structure of the @@ -1081,6 +1102,8 @@ struct cql_node { If an index is unspecified for a search term, index will be NULL. + + index_uri: index URi for search term or NULL if none could be resolved for the index. @@ -1131,12 +1154,12 @@ struct cql_node { - CQL to PQF conversion + CQL to PQF conversion Conversion to PQF (and Z39.50 RPN) is tricky by the fact that the resulting RPN depends on the Z39.50 target capabilities (combinations of supported attributes). - In addition, the CQL and SRW operates on index prefixes + In addition, the CQL and SRU operates on index prefixes (URI or strings), whereas the RPN uses Object Identifiers for attribute sets. @@ -1171,10 +1194,10 @@ int cql_transform_buf(cql_transform_t ct, If conversion failed, cql_transform_buf - returns a non-zero SRW error code; otherwise zero is returned + returns a non-zero SRU error code; otherwise zero is returned (conversion successful). The meanings of the numeric error - codes are listed in the SRW specifications at - + codes are listed in the SRU specifications at + If conversion fails, more information can be obtained by calling @@ -1190,7 +1213,7 @@ int cql_transform_error(cql_transform_t ct, char **addinfop); context set that was not recognised. - The SRW error-codes may be translated into brief human-readable + The SRU error-codes may be translated into brief human-readable error messages using const char *cql_strerror(int code); @@ -1213,8 +1236,8 @@ int cql_transform_FILE(cql_transform_t ct, open FILE. - - Specification of CQL to RPN mapping + + Specification of CQL to RPN mappings The file supplied to functions cql_transform_open_FILE, @@ -1364,7 +1387,7 @@ int cql_transform_FILE(cql_transform_t ct, - CQL to RPN mapping file + CQL to RPN mapping file This simple file defines two context sets, three indexes and three relations, a position pattern and a default structure. @@ -1419,7 +1442,7 @@ int cql_transform_FILE(cql_transform_t ct, - CQL to XCQL conversion + CQL to XCQL conversion Conversion from CQL to XCQL is trivial and does not require a mapping to be defined. @@ -1598,7 +1621,7 @@ typedef struct oident again, corresponding to the specific OIDs defined by the standard. Refer to the - + Registry of Z39.50 Object Identifiers for the whole list. @@ -1803,12 +1826,12 @@ typedef struct oident production use of those applications. - The log functions are declared in header yaz/ylog.h + The log functions are declared in header yaz/log.h and implemented in src/log.c. Due to name clash with syslog and some math utilities the logging interface has been modified as of YAZ 2.0.29. The obsolete interface - is still available if the application includes - yaz/log.h. The key points of the interface are: + is still available if in header file yaz/log.h. + The key points of the interface are: void yaz_log(int level, const char *fmt, ...) @@ -1835,10 +1858,11 @@ typedef struct oident The log level is a bit mask, that says on which level(s) the log entry should be made, and optionally set some behaviour of the logging. In the most simple cases, it can be one of YLOG_FATAL, - YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits - that modify the way the log entry is written:YLOG_ERRNO, - YLOG_NOTIME, YLOG_FLUSH. - Most of the rest of the bits are deprecated, and should not be used. + YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits + that modify the way the log entry is written:YLOG_ERRNO, + YLOG_NOTIME, YLOG_FLUSH. + Most of the rest of the bits are deprecated, and should not be used. Use + the dynamic log levels instead. @@ -1874,6 +1898,17 @@ typedef struct oident + Yaz uses the following dynamic log levels: + server, session, request, requestdetail for the server + functionality. + zoom for the zoom client api. + ztest for the simple test server. + malloc, nmem, odr, eventl for internal debugging of yaz itself. + Of course, any program using yaz is welcome to define as many new ones, as + it needs. + + + By default the log is written to stderr, but this can be changed by a call to yaz_log_init_file or yaz_log_init. If the log is directed to a file, the @@ -1884,6 +1919,15 @@ typedef struct oident rotation feature. + + A typical yaz-log looks like this + 13:23:14-23/11 yaz-ztest(1) [session] Starting session from tcp:127.0.0.1 (pid=30968) + 13:23:14-23/11 yaz-ztest(1) [request] Init from 'YAZ' (81) (ver 2.0.28) OK + 13:23:17-23/11 yaz-ztest(1) [request] Search Z: @attrset Bib-1 foo OK:7 hits + 13:23:22-23/11 yaz-ztest(1) [request] Present: [1] 2+2 OK 2 records returned + 13:24:13-23/11 yaz-ztest(1) [request] Close OK + + The log entries start with a time stamp. This can be omitted by setting the YLOG_NOTIME bit in the loglevel. This way automatic tests @@ -1894,10 +1938,11 @@ typedef struct oident - Next in a log line comes the prefix, often the name of the program. Then + Next in a log line comes the prefix, often the name of the program. For + yaz-based servers, it can also contain the session number. Then comes one or more logbits in square brackets, depending on the logging level set by yaz_log_init_level and the loglevel - passed to yaz_log_init_level. Finally comes all format + passed to yaz_log_init_level. Finally comes the format string and additional values passed to yaz_log @@ -1915,12 +1960,15 @@ typedef struct oident - The dynamic log levels and log rotation were introduced in &yaz; 2.0.28. + The dynamic log levels and log rotation were introduced in &yaz; 2.0.28. At + the same time, the log bit names were changed from + LOG_something to YLOG_something, + to avoid collision with syslog.h. - MARC + MARC YAZ provides a fast utility that decodes MARC records and @@ -1942,6 +1990,7 @@ typedef struct oident #define YAZ_MARC_OAIMARC 2 #define YAZ_MARC_MARCXML 3 #define YAZ_MARC_ISO2709 4 + #define YAZ_MARC_XCHANGE 5 /* supply iconv handle for character set conversion .. */ void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd); @@ -2007,7 +2056,7 @@ typedef struct oident stores the resulting record in a WRBUF handle (WRBUF is a simple string type). - + Display of MARC record The followint program snippet illustrates how the MARC API may