X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fquerymodel.xml;h=6d41f895184156558c16f449c77b0a1b8e87c932;hb=1ae4d572640ac104c00f8306beed27b3a0bcfe3b;hp=bed7a2e3d153c420b414c4ce30ad8ad4a91fd327;hpb=0002d3ccff37e5598553683e95714ca5711f05e8;p=idzebra-moved-to-github.git diff --git a/doc/querymodel.xml b/doc/querymodel.xml index bed7a2e..6d41f89 100644 --- a/doc/querymodel.xml +++ b/doc/querymodel.xml @@ -1,5 +1,5 @@ - + Query Model @@ -14,14 +14,21 @@ to the international standards Z39.50 and SRU, - and implement the query model defined there. - Unfortunately, the Z39.50 query model has only defined a binary + and implement the + type-1 Reverse Polish Notation (RPN) query + model defined there. + Unfortunately, this model has only defined a binary encoded representation, which is used as transport packaging in the Z39.50 protocol layer. This representation is not human readable, nor defines any convenient way to specify queries. - + + Since the type-1 (RPN) + query structure has no direct, useful string + representation, every origin application needs to provide some + form of mapping from a local query notation or representation to it. + + Prefix Query Format (PQF) @@ -29,50 +36,110 @@ Index Data has defined a textual representaion in the Prefix Query Format, short - PQF, which then has been adopted by other - parties developing Z39.50 software. It is also often referred to as + PQF, which mappes + one-to-one to binary encoded + type-1 RPN query packages. + It has been adopted by other + parties developing Z39.50 software, and is often referred to as Prefix Query Notation, or in short - PQN, and is thoroughly explained in - . + PQN. See + for further explanaitions and + descriptions of Zebra's capabilities. - - Common Query Language (CQL) - - In addition, Zebra can be configured to understand and map the - Common Query Language - (CQL) - to PQF. See an introduction on the mapping to the internal query - representation in + + The query model of the type-1 RPN, + expressed in PQF/PQN is natively supported. + On the other hand, the default SRU + webservices Common Query Language + CQL is not natively supported. + + + Zebra can be configured to understand and map CQL to PQF. See . - - Query types + + Operation types + Zebra supports all of the three different + Z39.50/SRU operations defined in the + standards: explain, search, + and scan. A short description of the + functionality and purpose of each is quite in order here. - - Explain Queries + + Explain Operation + The syntax of Z39.50/SRU queries is + well known to any client, but the specific + semantics - taking into account a + particular servers functionalities and abilities - must be + discovered from case to case. Enters the + explain operation, which provides the means + for learning which + fields (also called + indexes or access points + are provided, which default parameter the server uses, which + retrieve document formats are defined, and which specific parts + of the general query model are supported. + + + The Z39.50 embeddes the explain operation + by perfoming a + search in the magic + IR-Explain-1 database; + see . + + + In SRU, explain is an entirely seperate + operation, which returns an Zeerex + XML record according to the + structure defined by the protocol. + + + In both cases, the information gathered through + explain operations can be used to + auto-configure a client user interface to the servers + capabilities. - - Search Queries + + Search Operation + Search and retrieve interactions are the raison d'être. + They are used to query the remote database and + return search result documents. Search queries span from + simple free text searches to nested complex boolean queries, + targeting specific indexes, and possibly enhanced with many + query semantic specifications. Search interactions are the heart + and soul of Z39.50/SRU servers. - - Scan Queries + + Scan Operation + + The scan operation is a helper functionality, + which operates on one index or access point a time. + + It provides + the means to investigate the content of specific indexes. + Scanning an index returns a handfull of terms actually fond in + the indexes, and in addition the scan + operation returns th enumber of documents indexed by each term. + A search client can use this information to propose proper + spelling of search terms, to auto-fill search boxes, or to + display controlled vocabularies. @@ -82,7 +149,7 @@ - Prefix Query Format structure and syntax + Prefix Query Format syntax and semantics The PQF grammer is documented in the YAZ manual, and shall not be @@ -98,7 +165,8 @@ may start with one specification of the attribute set used. Following is a query tree, which - consists of atomic query parts, eventually + consists of atomic query parts (APT) or + named result sets, eventually paired by boolean binary operators, and finally recursively combined into complex query trees. @@ -111,46 +179,75 @@ issued. Zebra comes with some predefined attribute set definitions, others can easily be defined and added to the configuration. - - The Zebra internal query procesing is modeled after - the Bib1 attribute set, and the non-use - attributes type 2-6 are hard-wired in. It is therefore essential - to be familiar with . - + - +
+ - + - - + + + - - + + + non-use attributes (type 2-9) define the hard-wired + Zebra internal query + processing. + - - + + + + +
Attribute sets predefined in Zebra
exp-1Explain attribute setExplainexp-1 Special attribute set used on the special automagic IR-Explain-1 database to gain information on server capabilities, database names, and database and semantics.predefined
bib-1Bib1 attribute setBib1bib-1 Standard PQF query language attribute set which defines the semantics of Z39.50 searching. In addition, all of the - non-use attributes (type 2-9) define the Zebra internal query - processingdefault
gilsGILS attribute setGILSgils Extention to the Bib1 attribute set.predefined
+ + + The use attributes (type 1) mappings the + predefined attribute sets are found in the + attribute set configuration files tab/*.att. + + + + The Zebra internal query processing is modeled after + the Bib1 attribute set, and the non-use + attributes type 2-6 are hard-wired in. It is therefore essential + to be familiar with . + + Boolean operators @@ -159,27 +256,31 @@ using the standard boolean operators into new query trees. - +
+ - - + - + - + - +
Boolean operators
@and
@and binary AND operator Set intersection of two atomic queries hit sets
@or
@or binary OR operator Set union of two atomic queries hit sets
@not
@not binary AND NOT operator Set complement of two atomic queries hit sets
@prox
@prox binary PROXIMY operator Set intersection of two atomic queries hit sets. In addition, the intersection set is purged for all @@ -219,8 +320,9 @@ The hit set is a subset of the coresponding AND query. - Z> find @prox information retrieval + Z> find @prox 0 3 0 2 k 2 information retrieval + See PQF grammer for details. Querying for the intersection of all documents containing the @@ -237,12 +339,13 @@ - Atomic queries + Atomic queries (APT) Atomic queries are the query parts which work on one acess point only. These consist of an attribute list followed by a single term or a - quoted term list. + quoted term list, and are often called + Attributes-Plus-Terms (APT) queries. Unsupplied non-use attributes type 2-9 are either inherited from @@ -250,7 +353,9 @@ See for details. - +
+ - + + - + +
Atomic queries
attribute list
attribute list List of orthogonal attributes Any of the orthogonal attribute types may be omitted, these are inherited from higher query tree nodes, or if not inherited, are set to the default Zebra configuration values.
term
term single term or quoted term list Here the search terms or list of search terms is added @@ -278,28 +385,73 @@ default index using the default attribite set, the server choice of access point/index, and the default non-use attributes. - Z> find "information" + Z> find information - Equivalent query fully specified: + Equivalent query fully specified including all default values: - Z> find @attrset bib-1 @attr 1=1017 @attr 2=3 @attr 3=3 @attr 4=1 @attr 5=100 @attr 6=1 "information" + Z> find @attrset bib-1 @attr 1=1017 @attr 2=3 @attr 3=3 @attr 4=1 @attr 5=100 @attr 6=1 information - Finding all documents which have empty titles. Notice that the - empty term must be quoted, but is otherwise legal. + Finding all documents which have the term + debussy in the title field. - Z> find @attr 1=4 "" + Z> find @attr 1=4 debussy + + + Named Result Sets + + Named result sets are supported in Zebra, and result sets can be + used as operands without limitations. + + + After the execution of a search, the result set is available at + the server, such that the client can use it for subsequent + searches or retrieval requests. The Z30.50 standard actually + stresses the fact that result sets are voliatile. It may cease + to exist at any time point after search, and the server will + send a diagnostic to the effect that the requested + result set does not exist any more. + + + + Defining a named result set and re-using it in the next query, + using yaz-client. + + Z> f @attr 1=4 mozart + ... + Number of hits: 43, setno 1 + ... + Z> f @and @set 1 @attr 1=4 amadeus + ... + Number of hits: 14, setno 2 + ... + Z> f @attr 1=1016 beethoven + ... + Number of hits: 26, setno 3 + ... + + + + + Named result sets are only supported by the Z39.50 protocol. + The SRU web service is stateless, and therefore the notion of + named result sets does not exist when acessing a Zebra server by + the SRU protocol. + + + + - Zebra's special use attribute type 1 of form 'string' + Zebra's special access point of type 'string' The numeric use (type 1) attribute is usually refered to from a given @@ -313,19 +465,24 @@ Finding all documents which have the term list "information - retrieval" in an Zebra index, using it's internal full string name. + retrieval" in an Zebra index, using it's internal full string + name. Scanning the same index. Z> find @attr 1=sometext "information retrieval" + Z> scan @attr 1=sometext aterm - Searching the bib-1 use attribute 54 using it's string name: + Searching or scanning + the bib-1 use attribute 54 using it's string name: Z> find @attr 1=Code-language eng + Z> scan @attr 1=Code-language "" - Searching in any silly string index - if it's defined in your + It is possible to search + in any silly string index - if it's defined in your indexation rules and can be parsed by the PQF parser. This is definitely not the recommended use of this facility, as it might confuse your users with some very @@ -335,7 +492,7 @@ - See for details, and + See also for details, and for the SRU PQF query extention using string names as a fast debugging facility. @@ -343,7 +500,7 @@ - Zebra's special use attribute type 1 of form 'XPath' + <title>Zebra's special access point of type 'XPath' for GRS filters As we have seen above, it is possible (albeit seldom a great @@ -357,7 +514,7 @@ XPath queries can entered at search time, and second, it might confuse users very much that an XPath-alike index name in fact gets populated from a possible entirely different XML element - than it pretends to acess. + than it pretends to access. When using the GRS Record Model @@ -399,15 +556,25 @@ + + Searching inside attribute strings is possible: + + Z> find @attr 1=/link/@creator morten + + + Filter the adressing XPath by a predicate working on exact string values in attributes (in the XML sense) can be done: return all those docs which have the term "english" contained in one of all text subnodes of the subtree defined by the XPath - /record/title[@lang='en'] + /record/title[@lang='en']. And similar + predicate filtering. Z> find @attr 1=/record/title[@lang='en'] english + Z> find @attr 1=/link[@creator='sisse'] sibelius + Z> find @attr 1=/link[@creator='sisse']/description[@xml:lang='da'] sibelius @@ -424,8 +591,7 @@ with '{ }' to prevent syntax errors: Z> find @attr {1=/root/first[@attr='danish']} content - Z> find @attr {1=/root/second[@attr='danish lake']} - Z> find @attr {1=/root/third[@attr='dansk s\xc3\xb8']} + Z> find @attr {1=/record/@set} oai @@ -435,6 +601,7 @@ this facility when speed is essential, and the database content size is medium to large. + @@ -443,8 +610,8 @@ Explain Attribute Set The Z39.50 standard defines the - Explainattribute set - exp-1, which is used to discover information + Explain attribute set + Exp-1, which is used to discover information about a server's search semantics and functional capabilities Zebra exposes a "classic" Explain database by base name IR-Explain-1, which @@ -452,7 +619,7 @@ The attribute-set exp-1 consists of a single - Use (type 1) attribute. + use attribute (type 1). In addition, the non-Use @@ -574,9 +741,6 @@ Bib1 Attribute Set - Something about querying to be written .. - - Most of the information contained in this section is an excerpt of the ATTRIBUTE SET BIB-1 (Z39.50-1995) SEMANTICS, @@ -585,13 +749,13 @@ Bib-1 Attribute Set version from 2003. Index Data is not the copyright holder of this - information. + information, except for the configuration details, the listing of + Zebra's capabilities, and the example queries. Use Attributes (type 1) - A use attribute specifies an access point for any atomic query. @@ -610,20 +774,26 @@ In addition, Zebra allows the acess of internal index names and dynamic - XPath as use attributes. - See - for - alternative acess to the Zebra internal index names and XPath queries. + XPath as use attributes; see + and + . Phrase search for information retrieval in - the title-register: + the title-register, scanning the same register afterwards: Z> find @attr 1=4 "information retrieval" + Z> scan @attr 1=4 information + + + + + + Zebra general Bib1 Non-Use Attributes (type 2-6) Relation Attributes (type 2) @@ -635,7 +805,9 @@ side of the relation), e.g., Date-publication <= 1975. - +
+ @@ -699,28 +871,75 @@
Relation Attributes (type 2)
+ The relation attributes + 1-5 are supported and work exactly as + expected. + All ordering operations are based on a lexicographical ordering, + expect when the + structure attribute numeric (109) is used. In + this case, ordering is numerical. See + . + + Z> find @attr 1=Title @attr 2=1 music + ... + Number of hits: 11745, setno 1 + ... + Z> find @attr 1=Title @attr 2=2 music + ... + Number of hits: 11771, setno 2 + ... + Z> find @attr 1=Title @attr 2=3 music + ... + Number of hits: 532, setno 3 + ... + Z> find @attr 1=Title @attr 2=4 music + ... + Number of hits: 11463, setno 4 + ... + Z> find @attr 1=Title @attr 2=5 music + ... + Number of hits: 11419, setno 5 + + + + The relation attribute - relevance (102) is supported, see + Relevance (102) is supported, see for full information. - - - All ordering operations are based on a lexicographical ordering, - expect when the - structure attribute numeric (109) is used. In - this case, ordering is numerical. See - . - + + Ranked search for information retrieval in + the title-register: + + Z> find @attr 1=4 @attr 2=102 "information retrieval" + + - Ranked search for information retrieval in - the title-register - (see for the glory details): - - Z> find @attr 1=4 @attr 2=102 "information retrieval" - - + The relation attribute + AlwaysMatches (103) is in the default + configuration + supported in conjecture with structure attribute + Phrase (1) (which may be omitted by + default). + It can be configured to work with other structure attributes, + see the configuration file + tab/default.idx and + . + + + AlwaysMatches (103) is a + great way to discover how many documents have been indexed in a + given field. The search term is ignored, but needed for correct + PQF syntax. An empty search term may be supplied. + + Z> find @attr 1=Title @attr 2=103 "" + Z> find @attr 1=Title @attr 2=103 @attr 4=1 "" + + + + @@ -731,7 +950,9 @@ within the field or subfield in which it appears. - +
+ @@ -781,12 +1002,14 @@ The possible values of the structure attribute (type 4) can be defined - using the configuraiton file + using the configuration file tab/default.idx. The default configuration is summerized in this table. -
Position Attributes (type 3)
+
+ @@ -878,16 +1101,56 @@
Structure Attributes (type 4)
-
+ + + + The structure attribute values + Word list (6) + is supported, and maps to the boolean AND + combination of words supplied. The word list is useful when + google-like bag-of-word queries need to be translated from a GUI + query language to PQF. For example, the following queries + are equivalent: + + Z> find @attr 1=Title @attr 4=6 "mozart amadeus" + Z> find @attr 1=Title @and mozart amadeus + + + + + The structure attribute value + Free-form-text (105) and + Document-text (106) + are supported, and map both to the boolean OR + combination of words supplied. The following queries + are equivalent: + + Z> find @attr 1=Body-of-text @attr 4=105 "bach salieri teleman" + Z> find @attr 1=Body-of-text @attr 4=106 "bach salieri teleman" + Z> find @attr 1=Body-of-text @or bach @or salieri teleman + + This OR list of terms is very usefull in + combination with relevance ranking: + + Z> find @attr 1=Body-of-text @attr 2=102 @attr 4=105 "bach salieri teleman" + + - The structure attribute value local-number - (107) - is supported, and maps always to the Zebra internal document ID. - + The structure attribute value + Local number (107) + is supported, and maps always to the Zebra internal document ID, + irrespectively which use attribute is specified. The following queries + have exactly the same unique record in the hit set: + + Z> find @attr 4=107 10 + Z> find @attr 1=4 @attr 4=107 10 + Z> find @attr 1=1010 @attr 4=107 10 + + - For example, in + In the GILS schema (gils.abs), the west-bounding-coordinate is indexed as type n, and is therefore searched by specifying @@ -898,6 +1161,13 @@ Z> find @attr 4=109 @attr 2=5 @attr gils 1=2038 -114 + + The exact mapping between PQF queries and Zebra internal indexes + and index types is explained in + . + + + Truncation Attributes (type = 5) @@ -909,7 +1179,9 @@ document hit set of a search query. - +
+ @@ -958,45 +1230,195 @@
Truncation Attributes (type 5)
- Truncation attribute value - Process # in search term (100) is a + The truncation attribute values 1-3 perform the obvious way: + + Z> scan @attr 1=Body-of-text schnittke + ... + * schnittke (81) + schnittkes (31) + schnittstelle (1) + ... + Z> find @attr 1=Body-of-text @attr 5=1 schnittke + ... + Number of hits: 95, setno 7 + ... + Z> find @attr 1=Body-of-text @attr 5=2 schnittke + ... + Number of hits: 81, setno 6 + ... + Z> find @attr 1=Body-of-text @attr 5=3 schnittke + ... + Number of hits: 95, setno 8 + + + + + The truncation attribute value + Process # in search term (101) is a poor-man's regular expression search. It maps each # to .*, and performes then a Regexp-1 (102) regular - expression search. + expression search. The following two queries are equivalent: + + Z> find @attr 1=Body-of-text @attr 5=101 schnit#ke + Z> find @attr 1=Body-of-text @attr 5=102 schnit.*ke + ... + Number of hits: 89, setno 10 + + - Truncation attribute value + The truncation attribute value Regexp-1 (102) is a normal regular search, - see. + see for details. + + Z> find @attr 1=Body-of-text @attr 5=102 schnit+ke + Z> find @attr 1=Body-of-text @attr 5=102 schni[a-t]+ke + + - Truncation attribute value + The truncation attribute value Regexp-2 (103) is a Zebra specific extention which allows fuzzy matches. One single error in spelling of search terms is allowed, i.e., a document is hit if it includes a term which can be mapped to the used search term by one character substitution, addition, deletion or change of posiiton. + + Z> find @attr 1=Body-of-text @attr 5=100 schnittke + ... + Number of hits: 81, setno 14 + ... + Z> find @attr 1=Body-of-text @attr 5=103 schnittke + ... + Number of hits: 103, setno 15 + ... + -
Completeness Attributes (type = 6) + + + + The Completeness Attributes (type = 6) + is used to specify that a given search term or term list is either + part of the terms of a given index/field + (Incomplete subfield (1)), or is + what literally is found in the entire field's index + (Complete field (3)). + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Completeness Attributes (type = 6)
CompletenessValueNotes
Incomplete subfield1default
Complete subfield2depreciated
Complete field3supported
+ + + The Completeness Attributes (type = 6) + is only partially and conditionally + supported in the sense that it is ignored if the hit index is + not of structure type="w" or + type="p". + - This attribute is ONLY used if structure w, p is to be - chosen. completeness is ignorned if not w, p is to be - used.. - Incomplete field(1) is the default and makes Zebra use - register type w. - complete subfield(2) and complete field(3) both triggers - search field type p. + Incomplete subfield (1) is the default, and + makes Zebra use + register type="w", whereas + Complete field (3) triggers + search and scan in index type="p". + + The Complete subfield (2) is a reminiscens + from the happy MARC + binary format days. Zebra does not support it, but maps silently + to Complete field (3). + + + + The exact mapping between PQF queries and Zebra internal indexes + and index types is explained in + . +
+ + + + + + Advanced Zebra PQF Features + + The Zebra internal query engine has been extended to specific needs + not covered by the bib-1 attribute set query + model. These extentions are non-standard + and non-portable: most functional extentions + are modeled over the bib-1 attribute set, + defining type 7-9 attributes. + There are also the speciel + string type index names for the + idxpath attribute set. + + + Zebra specific retrieval of all records + + Zebra defines a hardwired string index name + called _ALLRECORDS. It matches any record + contained in the database, if used in conjunction with + the relation attribute + AlwaysMatches (103). + + + The _ALLRECORDS index name is used for total database + export. The search term is ignored, it may be empty. + + Z> find @attr 1=_ALLRECORDS @attr 2=103 "" + + + + Combination with other index types can be made. For example, to + find all records which are not indexed in + the Title register, issue one of the two + equivalent queries: + + Z> find @not @attr 1=_ALLRECORDS @attr 2=103 "" @attr 1=Title @attr 2=103 "" + Z> find @not @attr 1=_ALLRECORDS @attr 2=103 "" @attr 1=4 @attr 2=103 "" + + + + The special string index _ALLRECORDS is + experimental, and the provided functionality and syntax may very + well change in future releases of Zebra. + + + Zebra specific Search Extentions to all Attribute Sets @@ -1006,7 +1428,9 @@ set used in a search operation query. - +
+ @@ -1059,6 +1483,15 @@ faster and does not require clients to deal with the Sort Facility. + + + All ordering operations are based on a lexicographical ordering, + expect when the + structure attribute numeric (109) is used. In + this case, ordering is numerical. See + . + + The possible values after attribute type 7 are 1 ascending and @@ -1159,7 +1592,8 @@ Zebra Extention Term Reference Attribute (type 10) - Zebra supports the searchResult-1 facility. If attribute 10 is + Zebra supports the searchResult-1 facility. + If the Term Reference Attribute (type 10) is given, that specifies a subqueryId value returned as part of the search result. It is a way for a client to name an APT part of a query. @@ -1185,53 +1619,83 @@ recognized regardless of attribute set used in a scan operation query. -
Zebra Search Attribute Extentions
+
+ - + + - + + - + +
Zebra Scan Attribute Extentions
Name and TypeNameType Operation Zebra version
Result Set Narrow (type 8)Result Set Narrow8 scan 1.3
Approximative Limit (type 9)Approximative Limit9 scan 1.4
- + Zebra Extention Result Set Narrow (type 8) - If attribute 8 is given for scan, the value is the name of a - result set. Each hit count in scan is @and'ed with the result set - given. + If attribute Result Set Narrow (type 8) + is given for scan, the value is the name of a + result set. Each hit count in scan is + @and'ed with the result set given. - + - Experimental and buggy. Definitely not to be used in production code. + Experimental. Do not use in production code. - + Zebra Extention Approximative Limit (type 9) - The approximative limit (as for search) is a way to enable approx - hit counts for scan hit counts. + The Zebra Extention Approximative Limit (type + 9) is a way to enable approx + hit counts for scan hit counts, in the same + way as for search hit counts. - Experimental. Do not use in production code. + Experimental and buggy. Definitely not to be used in production code.
- + + + + Zebra special IDXPATH Attribute Set for GRS indexing + + The attribute-set idxpath consists of a single + Use (type 1) attribute. All non-use attributes + behave as normal. + + + This feature is enabled when defining the + xpath enable option in the GRS filter + *.abs configuration files. If one wants to use + the special idxpath numeric attribute set, the + main Zebra configuraiton file zebra.cfg + directive attset: idxpath.att must be enabled. + + The idxpath is depreciated, may not be + supported in future Zebra versions, and should definitely + not be used in production code. + + + + IDXPATH Use Attributes (type = 1) + + This attribute set allows one to search GRS filter indexed + records by XPATH like structured index names. + + + The idxpath option defines hard-coded + index names, which might clash with your own index names. + + + - - Mapping from Bib1 Attributes to Zebra internal + <caption>Zebra specific IDXPATH Use Attributes (type 1)</caption> + <thead> + <tr> + <td>IDXPATH</td> + <td>Value</td> + <td>String Index</td> + <td>Notes</td> + </tr> + </thead> + <tbody> + <tr> + <td>XPATH Begin</td> + <td>1</td> + <td>_XPATH_BEGIN</td> + <td>depreciated</td> + </tr> + <tr> + <td>XPATH End</td> + <td>2</td> + <td>_XPATH_END</td> + <td>depreciated</td> + </tr> + <tr> + <td>XPATH CData</td> + <td>1016</td> + <td>_XPATH_CDATA</td> + <td>depreciated</td> + </tr> + <tr> + <td>XPATH Attribute Name</td> + <td>3</td> + <td>_XPATH_ATTR_NAME</td> + <td>depreciated</td> + </tr> + <tr> + <td>XPATH Attribute CData</td> + <td>1015</td> + <td>_XPATH_ATTR_CDATA</td> + <td>depreciated</td> + </tr> + </tbody> + </table> + + + <para> + See <filename>tab/idxpath.att</filename> for more information. + </para> + <para> + Search for all documents starting with root element + <literal>/root</literal> (either using the numeric or the string + use attributes): + <screen> + Z> find @attrset idxpath @attr 1=1 @attr 4=3 root/ + Z> find @attr idxpath 1=1 @attr 4=3 root/ + Z> find @attr 1=_XPATH_BEGIN @attr 4=3 root/ + </screen> + </para> + <para> + Search for all documents where specific nested XPATH + <literal>/c1/c2/../cn</literal> exists. Notice the very + counter-intuitive <emphasis>reverse</emphasis> notation! + <screen> + Z> find @attrset idxpath @attr 1=1 @attr 4=3 cn/cn-1/../c1/ + Z> find @attr 1=_XPATH_BEGIN @attr 4=3 cn/cn-1/../c1/ + </screen> + </para> + <para> + Search for CDATA string <emphasis>text</emphasis> in any element + <screen> + Z> find @attrset idxpath @attr 1=1016 text + Z> find @attr 1=_XPATH_CDATA text + </screen> + </para> + <para> + Search for CDATA string <emphasis>anothertext</emphasis> in any + attribute: + <screen> + Z> find @attrset idxpath @attr 1=1015 anothertext + Z> find @attr 1=_XPATH_ATTR_CDATA anothertext + </screen> + </para> + <para> + Search for all documents with have an XML element node + including an XML attribute named <emphasis>creator</emphasis> + <screen> + Z> find @attrset idxpath @attr 1=3 @attr 4=3 creator + Z> find @attr 1=_XPATH_ATTR_NAME @attr 4=3 creator + </screen> + </para> + <para> + Combining usual <literal>bib-1</literal> attribut set searches + with <literal>idxpath</literal> attribute set searches: + <screen> + Z> find @and @attr idxpath 1=1 @attr 4=3 link/ @attr 1=4 mozart + Z> find @and @attr 1=_XPATH_BEGIN @attr 4=3 link/ @attr 1=_XPATH_CDATA mozart + </screen> + </para> + <para> + Scanning is supportet on all <literal>idxpath</literal> + indexes, both specified as numeric use attributes, or as string + index names. + <screen> + Z> scan @attrset idxpath @attr 1=1016 text + Z> scan @attr 1=_XPATH_ATTR_CDATA anothertext + Z> scan @attrset idxpath @attr 1=3 @attr 4=3 '' + </screen> + </para> + + </sect3> + </sect2> + + + <sect2 id="querymodel-pqf-apt-mapping"> + <title>Mapping from PQF atomic APT queries to Zebra internal register indexes - TO-DO + The rules for PQF APT mapping are rather tricky to grasp in the + first place. We deal first with the rules for deciding which + internal register or string index to use, according to the use + attribute or access point specified in the query. Thereafter we + deal with the rules for tetermining the correct structure type of + the named register. + + + + Mapping of PQF APT access points + + Zebra understands four fundamental different types of access + points, of which only the + numeric use attribute type access points + are defined by the Z39.50 + standard. + All other access point types are Zebra specific, and non-portable. + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Acces point name
Acess PointTypeGrammarNotes
Use attibutenumeric[1-9][1-9]*directly mapped to string index name
String index namestring[a-zA-Z](\-?[a-zA-Z0-9])*normalized name is used as internal string index name
Zebra internal index namezebra_[a-zA-Z](_?[a-zA-Z0-9])*hardwired internal string index name
XPATH special indexXPath/.*special xpath search for GRS indexed records
+ + + Attribute set names and + string index names are normalizes + according to the following rules: all single + hyphens '-' are stripped, and all upper case + letters are folded to lower case. + + + Numeric use attributes are mapped + to the Zebra internal + string index according to the attribute set defintion in use. + The default attribute set is Bib-1, and may be + omitted in the PQF query. According to normalization and numeric + use attribute mapping, it follows that the following + PQF queries are considered equivalent (assuming the default + configuration has not been altered): + + Z> find @attr 1=Body-of-text serenade + Z> find @attr 1=bodyoftext serenade + Z> find @attr 1=BodyOfText serenade + Z> find @attr 1=bO-d-Y-of-tE-x-t serenade + Z> find @attr 1=1010 serenade + Z> find @attrset Bib-1 @attr 1=1010 serenade + Z> find @attrset bib1 @attr 1=1010 serenade + Z> find @attrset Bib1 @attr 1=1010 serenade + Z> find @attrset b-I-b-1 @attr 1=1010 serenade + + + + + The numerical + use attributes (type 1) + are interpreted according to the + attribute sets which have been loaded in the + zebra.cfg file, and are matched against specific + fields as specified in the .abs file which + describes the profile of the records which have been loaded. + If no use attribute is provided, a default of Bib-1 Any is + assumed. + The predefined use attribute sets + can be reconfigured by tweaking the configuration files + tab/*.att, and + new attribute sets can be defined by adding similar files in the + configuration path profilePath of the server. + + + + String indexes can be acessed directly, + independently which attribute set is in use. These are just + ignored. The above mentioned name normalization applies. + String index names are defined in the + used indexing filter configuration files, for example in the + GRS + *.abs configuration files, or in the + alvis filter XSLT indexing stylesheets. + + Zebra internal indexes can be acessed directly, + according to the same rules as the user defined + string indexes. The only difference is that + Zebra internal indexe names are hardwired, + all uppercase and + must start with the character '_'. + + + + Finally, XPATH access points are only + available using the GRS filter for indexing. + These acees point names must start with the character + '/', they are not + normalized, but passed unaltered to the Zebra internal + XPATH engine. See . + + + + +
+ + + Mapping of PQF APT structure and type + + + - - Use attributes are interpreted according to the - attribute sets which have been loaded in the - zebra.cfg file, and are matched against specific - fields as specified in the .abs file which - describes the profile of the records which have been loaded. - If no Use attribute is provided, a default of Bib-1 Any is assumed. - If a Structure attribute of @@ -1422,6 +2164,8 @@ replacement) is accepted when terms are matched against the register contents. + +
@@ -1434,7 +2178,9 @@ Both query types follow the same syntax with the operands: - +
+ - - + + - + - + @@ -1462,8 +2208,8 @@ The above operands can be combined with the following operators: - -
Regular Expression Operands
xMatches the character x.xMatches the character x.
.. Matches any character.
[ .. ][ .. ] Matches the set of characters specified; such as [abc] or [a-c].
+
- - + - - + - - + - - + - - + - +
Regular Expression Operators
x*Matches x zero or more times. + x*Matches x zero or more times. Priority: high.
x+Matches x one or more times. + x+Matches x one or more times. Priority: high.
x? Matches x zero or once. + x? Matches x zero or once. Priority: high.
xy Matches x, then y. + xy Matches x, then y. Priority: medium.
x|y Matches either x or y. + x|y Matches either x or y. Priority: low.
( )( ) The order of evaluation may be changed by using parentheses.
- + - If the first character of the Regxp-2 query + If the first character of the Regxp-2 query is a plus character (+) it marks the beginning of a section with non-standard specifiers. The next plus character marks the end of the section. @@ -1528,8 +2274,7 @@ Combinations with other attributes are possible. For example, a - ranked search with a regular expression - (see for the glory details): + ranked search with a regular expression: Z> find @attr 1=4 @attr 5=102 @attr 2=102 "informat.* retrieval" @@ -1544,7 +2289,7 @@ process input records. Two basic types of processing are available - raw text and structured data. Raw text is just that, and it is selected by providing the - argument text to Zebra. Structured records are + argument text to Zebra. Structured records are all handled internally using the basic mechanisms described in the subsequent sections. Zebra can read structured records in many different formats.