X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Ftools.xml;h=4d19542d5685bb1cdd82ae2fa83b8d2a44e128bb;hb=6b7929b5e5663fb9a768b11aeaa3f930691e6ece;hp=4d47a1b3bf15f205859e154c9afbfafc9e59c1be;hpb=3227202c561b3189378cba8318c7610aeae1421a;p=yaz-moved-to-github.git diff --git a/doc/tools.xml b/doc/tools.xml index 4d47a1b..4d19542 100644 --- a/doc/tools.xml +++ b/doc/tools.xml @@ -1,13 +1,13 @@ - - Supporting Tools - + + Supporting Tools + In support of the service API - primarily the ASN module, which - provides the programmatic interface to the Z39.50 APDUs, YAZ contains + provides the pro-grammatic interface to the Z39.50 APDUs, &yaz; contains a collection of tools that support the development of applications. - Query Syntax Parsers + Query Syntax Parsers Since the type-1 (RPN) query structure has no direct, useful string @@ -51,9 +51,8 @@ int p_query_attset (const char *arg); to provide a memory source (the structure created is released on the next call to odr_reset() on the stream), a protocol identifier (one of the constants PROTO_Z3950 and - PROTO_SR), an attribute set - reference, and finally a null-terminated string holding the query - string. + PROTO_SR), an attribute set reference, and + finally a null-terminated string holding the query string. If the parse went well, p_query_rpn() returns a @@ -73,47 +72,43 @@ int p_query_attset (const char *arg); The grammar of the PQF is as follows: - - Query ::= [ AttSet ] QueryStruct. - - AttSet ::= string. + + query ::= top-set query-struct. - QueryStruct ::= { Attribute } Simple | Complex. + top-set ::= [ '@attrset' string ] - Attribute ::= '@attr' AttributeType '=' AttributeValue. + query-struct ::= attr-spec | simple | complex - AttributeType ::= integer. + attr-spec ::= '@attr' [ string ] string query-struct - AttributeValue ::= integer. + complex ::= operator query-struct query-struct. - Complex ::= Operator QueryStruct QueryStruct. + operator ::= '@and' | '@or' | '@not' | '@prox' proximity. - Operator ::= '@and' | '@or' | '@not' | '@prox' Proximity. + simple ::= result-set | term. - Simple ::= ResultSet | Term. + result-set ::= '@set' string. - ResultSet ::= '@set' string. + term ::= string - Term ::= string | '"' string '"'. + proximity ::= exclusion distance ordered relation which-code unit-code. - Proximity ::= Exclusion Distance Ordered Relation WhichCode UnitCode. + exclusion ::= '1' | '0' | 'void'. - Exclusion ::= '1' | '0' | 'void'. + distance ::= integer. - Distance ::= integer. + ordered ::= '1' | '0'. - Ordered ::= '1' | '0'. + relation ::= integer. - Relation ::= integer. + which-code ::= 'known' | 'private' | integer. - WhichCode ::= 'known' | 'private' | integer. - - UnitCode ::= integer. - + unit-code ::= integer. + You will note that the syntax above is a fairly faithful - representation of RPN, except for the Attibute, which has been + representation of RPN, except for the Attribute, which has been moved a step away from the term, allowing you to associate one or more attributes with an entire query structure. The parser will automatically apply the given attributes to each term as required. @@ -139,6 +134,8 @@ int p_query_attset (const char *arg); @attr 4=1 @attr 1=4 "self portrait" @prox 0 3 1 2 k 2 dylan zimmerman + + @and @attr 2=4 @attr gils 1=2038 -114 @attr 2=2 @attr gils 1=2039 -109 @@ -155,14 +152,15 @@ int p_query_attset (const char *arg); - The EUROPAGATE research project working under the Libraries programme + The EUROPAGATE + research project working under the Libraries programme of the European Commission's DG XIII has, amongst other useful tools, implemented a general-purpose CCL parser which produces an output structure that can be trivially converted to the internal RPN - representation of YAZ (The Z_RPNQuery structure). + representation of &yaz; (The Z_RPNQuery structure). Since the CCL utility - along with the rest of the software - produced by EUROPAGATE - is made freely available on a liberal license, it - is included as a supplement to YAZ. + produced by EUROPAGATE - is made freely available on a liberal + license, it is included as a supplement to &yaz;. CCL Syntax @@ -205,7 +203,7 @@ int p_query_attset (const char *arg); | string -- Qualifiers is a list of strings separated by comma - Relation ::= '=' | '>=' | '<=' | '<>' | '>' | '<' + Relation ::= '=' | '>=' | '<=' | '<>' | '>' | '<' -- Relational operators. This really doesn't follow the ISO8777 -- standard. @@ -252,7 +250,7 @@ int p_query_attset (const char *arg); index, such as title (ti) and author indexes (au). The CCL standard itself doesn't specify a particular set of qualifiers, but it does suggest a few short-hand notations. You can customize the CCL parser - to support a particular set of qualifiers to relect the current target + to support a particular set of qualifiers to reflect the current target profile. Traditionally, a qualifier would map to a particular use-attribute within the BIB-1 attribute set. However, you could also define qualifiers that would set, for example, the @@ -347,14 +345,14 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, which takes the CCL profile (bibset) and query (str) as input. Upon successful completion the RPN - tree is returned. If an error eccur, such as a syntax error, the integer + tree is returned. If an error occur, such as a syntax error, the integer pointed to by error holds the error code and pos holds the offset inside query string in which the parsing failed. - An english representation of the error may be obtained by calling + An English representation of the error may be obtained by calling the ccl_err_msg function. The error codes are listed in ccl.h. @@ -385,7 +383,7 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, - Object Identifiers + Object Identifiers The basic YAZ representation of an OID is an array of integers, @@ -416,7 +414,7 @@ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, The OID module provides a higher-level representation of the - family of object identifers which describe the Z39.50 protocol and its + family of object identifiers which describe the Z39.50 protocol and its related objects. The definition of the module interface is given in the oid.h file. @@ -582,7 +580,7 @@ typedef struct oident The oid_ent_to_oid() function can be used whenever you need to prepare a PDU containing one or more OIDs. The separation of - the protocol element from the remainer of the + the protocol element from the remainder of the OID-description makes it simple to write applications that can communicate with either Z39.50 or OSI SR-based applications. @@ -631,7 +629,7 @@ typedef struct oident - Nibble Memory + Nibble Memory Sometimes when you need to allocate and construct a large, @@ -659,6 +657,7 @@ typedef struct oident void nmem_reset(NMEM n); int nmem_total(NMEM n); void nmem_init(void); + void nmem_exit(void); @@ -674,19 +673,22 @@ typedef struct oident allocated on the handle. - - - The nibble memory pool is shared amonst threads. POSIX - mutex'es and WIN32 Critical sections are introduced to keep the - module thread safe. On WIN32 function nmem_init() - initialises the Critical Section handle and should be called once - before any other nmem function is used. - - + + The nibble memory pool is shared amongst threads. POSIX + mutex'es and WIN32 Critical sections are introduced to keep the + module thread safe. Function nmem_init() + initializes the nibble memory library and it is called automatically + the first time the YAZ.DLL is loaded. &yaz; uses + function DllMain to achieve this. You should + not call nmem_init or + nmem_exit unless you're absolute sure what + you're doing. Note that in previous &yaz; versions you'd have to call + nmem_init yourself. + - +