PML Tree-Query Engine
Latin Valency Lexicon
Select Resource Documentation Project Page
Limit: Timeout:


This quick introduction to PML-TQ is semi-automatically generated and covers the most basic topics only. See the Documentation for full reference. You can always return to this help by clicking the logo.

Using This Interface

Type your query into the text box above. The menus allow you to insert special strings into the query, such as node types, attribute names, node relations, operators, and functions. ⇩ Query sends the query to the server and displays the results. Complex or low-selective queries may take a few seconds to evaluate; the Timeout option specifies maximum time the server should spend trying to evaluate the query. The ⇩ w/o Filters button submits the query without any output filters (see below). The ☼ Visualize button shows visualization of the query.

It is also possible to add result nodes to the query: run some simple query to display a tree from the treebank. Then mark (by clicking) one or more related nodes in the result tree and press ⇧ Suggest; a PML-TQ query based on the marked nodes will be suggested and displayed in a dialog where you can exclude/include its parts and then paste it directly to the query text box.

The button ✕ Clear empties the query form.

Annotation Schema of Latin Valency Lexicon

This treebank, consists of the following annotation layer(s) and node type(s):

Query Language

A basic query for nodes of the type, say v-element, looks like this:

v-element [ ]

Similarly for other node types and node-type wildcards.

Contstraints on the node go between the square brackets [...]. Basic constraints on attribute values have the following forms:

attribute = 'value' string comparison
attribute ~ 'reg-exp' regular expression match
attribute < number number comparison, same for >, <=, >=, =
attribute in {'value1', 'value2', ...} membership in an enumeration

For example:

v-element [ forms='' ]

See the Attributes menu for the list of attributes for each node type.

Other node properties, such as number of sons, descendants, siblings, etc. can be obtained using functions (see Funcions ยป Node Properties). In fact, complex expressions can be used on left and right hand side of the comparison operators in constraints; see the menus Operators and Funcions for available arithmetic and string operators and functions.

The constraints can be combined using commas (and) or the logical operators ! (not), and, or (see also the Operators menu). For example:

v-element [ forms='', sons()=0 or lbrothers()+rbrothers()=0  ]

searches for any v-element with forms='' that is either a leaf node (has no sons) or an only child (has no left nor right siblings).

To introduce another node into the query, include it among the constrains and specify its relation to the existing node. The Relation menu contains a list list of available relations. Here a is an example using the relation 'child':

v-element [
  child v-element [ ]

Additional relations between a pair of nodes can be specified by assigning symbolic names to the query nodes. The names can be used also to refer to other node's attributes, e.g.

v-element $a := [
  sibling v-element [
     depth-first-follows $a,

searches for any v-element $a with a sibling v-element having the same value of forms and following the node $a. We may also search for any v-element with no such sibling, using a so called subquery by quantifying the number of occurrences:

v-element $a := [
  0x sibling v-element [
     depth-first-follows $a,

The symbol 0x, stands for `zero times'. Similarly, 1x stands for `exactly one', 3+x for `three and more', 2-x for `at most two', or 1..10x for `one to ten'.

Output Filters

To count number of all matches of a query, append an output filter, e.g.

v-element [ ]
>> count()

Be careful when counting matches for queries with more than one node, To count only distinct occurrences of a particular node, say $a, regardless of the other nodes in the query, use these output filters instead:

>> distinct $a
>> count()

Output filters are used to extract data and generate a tabular output from a query. For example, the following query lists all values of the attribute forms and counts their occurrences:

v-element $a:= [ ]
>> for $a.forms give $1, count()

See the Documentation for more on output-filters.