Chapter 5. Querying a Database

Table of Contents
Simple Queries
Compound Queries
Modifying the Target of a Query
Combining queries

Database queries consist of patterns which match either individual segments, sequences of segments or parts of the hierarchical description of an utterance. The result of a query is a segment list which contains the labels and start and end times of each segment or sequence of segments which matched the query, along with the utterances to which they belong.

Queries can relate to any level of the hierarchy defined by the template file (see the chapter on Template Files). The type of segments returned depends on the form of the query.

There are two basic kinds of query: simple queries (see the section on simple queries) which relate to single segments, and compound queries (see the section on compound queries) which relate to either sequences of segments or to segments at different levels in the hierarchy.

Simple Queries

Simple queries relate to a single segment, for example to find segments labelled p at the Phonetic level:


they can also include disjunctions to match a set of labels:


Segment labels can be quoted if they contain special characters, for example:


The following functions can also be used:

These can be combined with & to further qualify the target segment. For example, to find content Words with Nuclear Accent:

Word=C & Accent=Nuclear

Note, however, that Word and Accent labels are at the same level. For labels at different levels you need to use a compound query (see the section called Compound Queries).