protecting log rotation with a mutex
[yaz-moved-to-github.git] / doc / tools.xml
index 816d8c9..9385c8a 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: tools.xml,v 1.35 2004-04-22 13:12:49 adam Exp $ -->
+<!-- $Id: tools.xml,v 1.38 2004-10-02 13:41:46 adam Exp $ -->
  <chapter id="tools"><title>Supporting Tools</title>
   
   <para>
          <row>
           <entry><literal>u=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Use attribute. Common use attributes are
+           Use attribute (1). Common use attributes are
            1 Personal-name, 4 Title, 7 ISBN, 8 ISSN, 30 Date,
            62 Subject, 1003 Author), 1016 Any. Specify value
            as an integer.
          <row>
           <entry><literal>r=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Relation attribute. Common values are
+           Relation attribute (2). Common values are
            1 &lt;, 2 &lt;=, 3 =, 4 &gt;=, 5 &gt;, 6 &lt;&gt;,
            100 phonetic, 101 stem, 102 relevance, 103 always matches.
           </entry>
          <row>
           <entry><literal>p=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Position attribute. Values: 1 first in field, 2
+           Position attribute (3). Values: 1 first in field, 2
            first in any subfield, 3 any position in field.
           </entry>
          </row>
          <row>
           <entry><literal>s=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Structure attribute. Values: 1 phrase, 2 word,
+           Structure attribute (4). Values: 1 phrase, 2 word,
            3 key, 4 year, 5 date, 6 word list, 100 date (un),
            101 name (norm), 102 name (un), 103 structure, 104 urx,
            105 free-form-text, 106 document-text, 107 local-number,
          <row>
           <entry><literal>t=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Truncation attribute. Values: 1 right, 2 left,
+           Truncation attribute (5). Values: 1 right, 2 left,
            3 left&amp; right, 100 none, 101 process #, 102 regular-1,
            103 regular-2, 104 CCL.
           </entry>
          <row>
           <entry><literal>c=</literal><replaceable>value</replaceable></entry>
           <entry>
-           Completeness attribute. Values: 1 incomplete subfield,
+           Completeness attribute (6). Values: 1 incomplete subfield,
            2 complete subfield, 3 complete field.
           </entry>
          </row>
          </row>
          
          <row><entry><literal>r=o</literal></entry><entry>
-           Allows operators greather-than, less-than, ... equals and
-           sets relation attribute accordingly (relation ordered).
+           Allows ranges and the operators greather-than, less-than, ...
+           equals.
+           This sets Bib-1 relation attribute accordingly (relation
+           ordered). A query construct is only treated as a range if
+           dash is used and that is surrounded by white-space. So
+           <literal>-1980</literal> is treated as term 
+           <literal>"-1980"</literal> not <literal>&lt;= 1980</literal>.
+           If <literal>- 1980</literal> is used, however, that is
+           treated as a range.
+          </entry>
+         </row>
+         
+         <row><entry><literal>r=r</literal></entry><entry>
+           Similar to <literal>r=o</literal> but assumes that terms
+           are non-negative (not prefixed with <literal>-</literal>).
+           Thus, a dash will always be treated as a range.
+           The construct <literal>1980-1990</literal> is
+           treated as a range with <literal>r=r</literal> but as a
+           single term <literal>"1980-1990"</literal> with
+           <literal>r=o</literal>. The special attribute
+           <literal>r=r</literal> is available in YAZ 2.0.24 or later.
           </entry>
          </row>
          
        date     u=30 r=o
       </screen>
        <para>
-       Four qualifiers are defined - <literal>ti</literal>, 
-       <literal>au</literal>, <literal>ranked</literal> and
-       <literal>date</literal>.
-       </para>
-       <para>
        <literal>ti</literal> and <literal>au</literal> both set 
        structure attribute to phrase (s=1).
        <literal>ti</literal>
        <para>
        Query
        <screen>
-        year > 1980
+        date > 1980
        </screen>
-       is a valid query, while
+       is a valid query. But
        <screen>
         ti > 1980
        </screen>
        be an alias for <replaceable>q1</replaceable>, 
        <replaceable>q2</replaceable>... such that the CCL
        query <replaceable>q=x</replaceable> is equivalent to
-       <replaceable>q1=x or w2=x or ...</replaceable>.
+       <replaceable>q1=x or q2=x or ...</replaceable>.
       </para>
      </sect4>
 
@@ -1035,34 +1049,28 @@ struct cql_node *cql_parser_result(CQL_parser cp);
       <synopsis>
 #define CQL_NODE_ST 1
 #define CQL_NODE_BOOL 2
-#define CQL_NODE_MOD 3
 struct cql_node {
     int which;
     union {
         struct {
             char *index;
+           char *index_uri;
             char *term;
             char *relation;
+           char *relation_uri;
             struct cql_node *modifiers;
-            struct cql_node *prefixes;
         } st;
         struct {
             char *value;
             struct cql_node *left;
             struct cql_node *right;
             struct cql_node *modifiers;
-            struct cql_node *prefixes;
         } boolean;
-        struct {
-            char *name;
-            char *value;
-            struct cql_node *next;
-        } mod;
     } u;
 };
       </synopsis>
-      There are three kinds of nodes, search term (ST), boolean (BOOL),
-      and modifier (MOD).
+      There are two node types: search term (ST) and boolean (BOOL).
+      A modifier is treated as a search term too.
      </para>
      <para>
       The search term node has five members:
@@ -1073,6 +1081,10 @@ struct cql_node {
          If an index is unspecified for a search term,
          <literal>index</literal> will be NULL.
         </para>
+        <para>
+         <literal>index_uri</literal>: index URi for search term
+        or NULL if none could be resolved for the index.
+        </para>
        </listitem>
        <listitem>
         <para>
@@ -1086,18 +1098,14 @@ struct cql_node {
        </listitem>
        <listitem>
         <para>
-         <literal>modifiers</literal>: relation modifiers for search
-         term. The <literal>modifiers</literal> is a simple linked
-         list (NULL for last entry). Each relation modifier node
-         is of type <literal>MOD</literal>.
+         <literal>relation_uri</literal>: relation URI for search term.
         </para>
        </listitem>
        <listitem>
         <para>
-         <literal>prefixes</literal>: index prefixes for search
-         term. The <literal>prefixes</literal> is a simple linked
-         list (NULL for last entry). Each prefix node
-         is of type <literal>MOD</literal>.
+         <literal>modifiers</literal>: relation modifiers for search
+         term. The <literal>modifiers</literal> list itself of cql_nodes
+        each of type <literal>ST</literal>.
         </para>
        </listitem>
       </itemizedlist>
@@ -1119,37 +1127,6 @@ struct cql_node {
          <literal>modifiers</literal>: proximity arguments.
         </para>
        </listitem>
-       <listitem>
-        <para>
-         <literal>prefixes</literal>: index prefixes.
-         The <literal>prefixes</literal> is a simple linked
-         list (NULL for last entry). Each prefix node
-         is of type <literal>MOD</literal>.
-        </para>
-       </listitem>
-      </itemizedlist>
-     </para>
-
-     <para>
-      The modifier node is a "utility" node used for name-value pairs,
-      such as prefixes, proximity arguements, etc.
-      <itemizedlist>
-       <listitem>
-        <para>
-         <literal>name</literal> name of mod node.
-        </para>
-       </listitem>
-       <listitem>
-        <para>
-         <literal>value</literal> value of mod node.
-        </para>
-       </listitem>
-       <listitem>
-        <para>
-         <literal>next</literal>: pointer to next node which is
-         always a mod node (NULL for last entry).
-        </para>
-       </listitem>
       </itemizedlist>
      </para>