Creating Bool Queries

Bool query data tests use the following comma-delimited format:

<logic operator>,<record type>,<variable tag>,<fixed field number>,<rule>,<operation type>,<target1>,<target2>,<multiple line delimiter>

The elements of this format are:

Element Description
<logic operator> Specifies the type of condition line. Possible values are:
^ (caret)Value: AND
The condition on this line is ANDed with the condition on the next line. If both conditions match the resource, WebBridge displays the resource on the bibliographic display.
v (lowercase 'v')Value: OR
The condition on this line is ORed with the condition on the next line. If either of the conditions match the resource, WebBridge displays the resource on the bibliographic display.
qNeither AND nor OR applies. Used primarily for a one line entry or as the last of multiple lines.
<record type> The type of record to which the bool query data test applies.
<variable tag> The tag for a specific variable-length field. Leave this value empty (i.e., leave a ",," entry) if matching for a fixed-length field.
<fixed field number> The number for a specific fixed-length field. Leave this value empty (i.e., leave a ",," entry) if matching for a variable-length field.
<rule> If the <variable tag> element is ^ (link field), this element specifies the type of link (e.g., 'p' for patron link field). If the <variable tag> element is a regular variable-length field, this element may contain a special function number and/or a more specific definition of the field (e.g., 245;ab means the data must be in subfields 'a' and 'b' of the 245 field). Otherwise, this element should be left empty (i.e., leave a ",," entry).
<operation type> Logic that the data in the specified tag must meet for WebBridge to display the resource on the bibliographic display. This defines the relationship that must exist between the data in the specified tag in the tested record and the value(s) in the <target1> and <target2> elements. Possible values are:
=Equal to
gGreater than or equal to
>Greater than
<Less than
lLess than or equal to
~Not equal to
wBetween
hHas
eExists
nDoes not exist
rRegular expression
<target1> The resource displays if all of the following are true:
  • This element contains a value.
  • The tested record contains the field specified in the <variable tag> or <fixed field number> element.
  • This element's value and the tested record's value meet the condition specified in the <operation type> element.

If the <operation type> is 'w' (between), the <target2> element contains the second value for this test.

If this element is empty (i.e., is ",,"), then the resource displays if the field in the <variable tag> or <fixed field number> element does not exist in the tested record.

For link fields, this value is the number of occurrences of the field that the tested record must contain in order to display the request. A value of '0' means that the tested record must contain NO occurrences of the field.

<target2> Used with the 'w' (between) operator to specify the second value for the <variable tag> or <fixed field number>. This element is ignored for other operators.
<multiple line delimiter> You can enter multiple lines for a bool query by using a '/' delimiter.

Bool Query Examples

Two example bool queries are shown below.

The PubDatePre1995 bool query tests for records with a publication date before 1995.

The isFilmStudies bool query tests for records in a specified call number range.

Bool Query Name Bool Query Elements
PubDatePre1995 q,b,p,,260;c,<,1995,, The logic operator for this one-line test is q.

The variable-length field tag for the PUB INFO field is p.

The fixed-length field number is left empty (no spaces between the commas).

The rule is 260;c. Note that in this example, the fixed-length field information is used to narrow the results of a query on a variable-length field (the p-tagged field). The query uses 260;c (the MARC tag and subfield for PUB INFO and publication date) to narrow the results to only those p-tagged fields containing the MARC tag 260 and the subfield |c. This is why you put 260;c in the rule (fifth) element rather than the fixed-length field (fourth) element.

The operation type is less than.

The target is 1995.

The second target is left empty (no spaces between the commas).

No multiple line delimiter is needed.
isFilmStudies v,b,g,,,w,PN1993,PN1999.z,/
q,b,c,,,w,791,791.999,/
The logic operators for this multi-line test are v (OR) and q (end line of the query).

The variable-length field tags for the GOVT DOC # field and CALL # field are g and c.

The fixed-length field number is left empty (no spaces between the commas).

The rule is left empty (no spaces between the commas).

The operation type is w (between).

The targets are PN1993 and 791.

The second targets are PN1999.z and 791.999.

The multiple line delimiter ends both lines.