<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1" global="139"/><title>Querying and Updating Treebanks: A Critical Survey and Requirements Analysis</title><author surname="Lai" givenname="Catherine"><org  name="Peking University" country="China" city="Beijing"/></author><author surname="Bird" givenname="Steven"><org  name="University of Melbourne" country="Australia" city="Melbourne"/></author></firstpageheader><frontmatter><p><b>Querying and Updating Treebanks: A Critical Survey and Requirements Analysis</b></p><p><b>Catherine Lai and Steven Bird</b></p><p>Department of Computer Science and Software Engineering University of Melbourne, Victoria 3010, Australia</p><p>(clai,sb}@csse.unimelb.edu.au</p></frontmatter><abstract>Language technology makes extensive use of hierarchi­cally annotated text and speech data. These databases are stored in flat files and manipulated using corpus-specific query tools or special-purpose scripts. While the size of these databases and the range of applications has grown rapidly in recent years, neither method for managing the data has led to reusable, scalable software. The formal properties of the query languages are not well under­stood. Hence established methods for indexing tree data and optimizing tree queries cannot be employed. We analyze a range of existing linguistic query languages, and adduce a set of requirements for a reusable, scalable linguistic query language. </abstract></header><body><section number="1" title="Introduction"><p>Corpora form the backbone of language technol­ogy. However corpora usually need to be annotated with structural information describing, for example, syntax or phonology. Query languages are neces­sary to extract useful information from these mas­sive data sets. Moreover, annotated corpora require thousands of hours of manual annotation to create, revise and maintain. Query languages are also use­ful during this process. For example, queries can be used to find parse errors or to transform annotations into different schemes.</p><p>However, the query languages currently available for annotated corpora suffer from several problems. Firstly, updates are not supported as query languages focus on the needs of linguists searching for syntactic constructions. Secondly, their relationship to existing database query languages is poorly understood, making it difficult to apply standard database indexing and query optimization techniques. As a consequence they do not scale well. Finally, linguistic annotations have both a sequential and a hierarchical organization. Query languages must support queries that refer to both of these types of structure simultaneously. Such hybrid queries should have a concise syntax. The interplay between these factors has resulted in a variety of mutually-inconsistent approaches.</p><p>This paper aims to describe the query language requirements for navigating and modifying struc­turally annotated corpora. We focus on tree struc­tured annotation. This entails sequential structure.</p><p>This paper is organized as follows. Section 2 surveys six linguistic tree querying languages and where appropriate the data models they are based on. The survey is the basis of the linguistic tree query requirements presented in Section 3. We con­clude in Section 4 with suggested areas for further work.</p></section><section number="2" title="Tree Models and Query Languages"><p>The prototypical hierarchical linguistic annotation is the syntax tree, an ordered tree where termi­nals (leaves) contain the text of a sentence being analyzed. Non-terminals represent syntactic cate­gories, and the hierarchical organization represents constituency. The leaf level is usually considered immutable. The queries in Figure 1 have been cho­sen to highlight the expressive capabilities of cur­rent tree query languages.</p><p>A query language must be able to accurately specify which subtrees to match in a corpus. This means quantifying the existence of nodes and succintly stating the relationships between them. Q1 is a simple query based on the dominance relation inherent in trees. As mentioned earlier, however, the sequential ordering of nodes is also an important factor. Q3 and Q4 demonstrate the precision that is available for describing subtrees constrained by both dominance and precedence relations.</p><p>It is also desirable to specify subtrees by what they do not contain. This requires some form of negation. Q2 is a simple example of this type of<page local="2" global="140"/></p><p>Q1. Find sentences that include the word 'saw'. Q2. Find sentences that do not include the word 'saw'. Q3. Find noun phrases whose rightmost child is a noun. Q4. Find verb phrases that contain a verb immediately followed by a noun phrase that is immediately fol­lowed by a prepositional phrase. Q5. Find the first common ancestor of sequences of a</p><p>noun phrase followed by a verb phrase. Q6. Find a noun phrase which dominates a word <i>dark</i> that is dominated by an intermediate phrase that</p><p>bears an L-tone. Q7. Find an noun phrase dominated by a verb phrase.</p><p>Return the subtree dominated by that noun phrase only.</p><p>Figure 1 : Syntactic Queries for Comparing Tree Query Languages</p><doubt alpha="100.0" length="4" tooSmall="False" monospace="0.0">SBAR</doubt><doubt alpha="66.7" length="9" tooSmall="False" monospace="0.0">WH-NP1 SQ</doubt><doubt alpha="100.0" length="4" tooSmall="False" monospace="0.0">What</doubt><p>is NP-SBJ VP</p><doubt alpha="66.7" length="18" tooSmall="False" monospace="0.0">Tim eatmg^NP*T*-1I</doubt><doubt alpha="0.0" length="1" tooSmall="True" monospace="0.0">0</doubt><figure caption="Figure 2: Trace elements in Penn Treebank"></figure><p>query. Q5 contains an implicit negation: we need to select the common ancestor that has no descen­dant that is also a common ancestor of the nodes in question. These queries also explore the interaction between quantification and negation of nodes and subtrees.</p><p>Linguistic query languages, in general, need to be able to deal with heterogeneous data. Many interesting queries fall on the interface of linguistic fields. For example, Q6 requires both syntactic and phonological data. This can be represented as two trees that intersect at the word level (Cassidy and Harrington, 2001).</p><p>Finally, trees can be large, and it is often unde­sirable to return whole trees for which the query tree matches a tiny fragment. Thus, we need a way to specify what part of a query simply constrains context, and what part should be returned. Q7 is a simple test of a query language's ability to control output.</p><subsection number="2.1" title="Penn Treebank and Tgrep2"><p>Penn Treebank contains approximately 50,000 parse trees of Wall Street Journal text (Marcus et al., 1994). Each parse is represented as an ordered tree, and syntactic dependencies are indicated using zero-width <i>trace </i>elements co-indexed with a full noun phrase (cf. Figure 2).</p><doubt alpha="29.2" length="48" tooSmall="False" monospace="0.0">Q1.    S &lt;&lt; saw Q2.    S  !&lt;&lt; saw Q3.    NP &lt;- N</doubt><doubt alpha="27.5" length="80" tooSmall="False" monospace="0.0">Q4 VP=vp &lt;&lt; (V . (N &gt;&gt; =vp . PP &gt;&gt; =vp)) Q5.    *=p &lt;&lt;   (NP=n  ..   (VP=v &gt;&gt; =p</doubt><doubt alpha="37.3" length="59" tooSmall="False" monospace="0.0">!&gt;&gt; (* &lt;&lt; =n &gt;&gt; =p))) Q6.* Not expressible Q7.    VP &lt;&lt; 'NP</doubt><figure caption="Figure 3: Tgrep2 Queries; Q5 is taken from (Rohde, 2001)"></figure><p>Tgrep2 is a <i>grep-like </i>tool for this database (Rohde, 2001), and all example queries can be specified correctly except Q6 (cf. Figure 3). Queries are nested expressions involving nodes and relationships between nodes. Nodes are specified using strings or regular expressions. Tgrep2 supports a large number of node relationships, including immediate precedence: a immediately precedes b (ie a . b) if the right corner of a immediately precedes the left corner of b in the sentence on which the tree is built. A wildcard (* ) can be used for a node when there is no constraint on its name. Node identifiers allow multiple sub-expressions to refer to the same node (e.g. Q4). Tgrep2 can specify non-inclusion or non-existence (Q2, Q5).</p><p>Query execution uses a binary file representation of the data, including an index on the words in the trees. The top node in a query is first matched and the rest of the tree is matched recursively, con­strained by node relations. The output is a set of human-readable subtrees. The subtree matched by the first node mentioned in the query is returned by default, but another return subtree can be specified by the user as shown in Q7. This output cannot be queried, since it must first be converted into the binary format; i.e. Tgrep2 is not compositional.</p><p>Not all node relationships are primitive (e.g. sibling relation ($)). However, dominates type relations such as leftmost descendant (&lt;&lt;,) cannot be derived. The depth of such a descendant is unknown. Thus, the language could be greatly simplified with a closure operator.</p></subsection><subsection number="2.2" title="The TIGER Corpus and TIGERSearch"><p>The TIGER corpus contains syntactically annotated German newspaper text (Brants et al., 2002). The syntax of German permits <i>discontinuous constituents, </i>which are represented in the corpus as trees with crossing edges. TIGERSearch is a logic and constraint programming approach to querying<page local="3" global="141"/></p><doubt alpha="32.0" length="50" tooSmall="False" monospace="0.0">Ql.      #s:[cat="S"]  &amp; #l:[lex="saw"] &amp; #s &gt;* #l</doubt><doubt alpha="29.4" length="51" tooSmall="False" monospace="0.0">Q2.*    #s:[cat="S"]  &amp; #l:[lex="saw"] &amp; #s  !&gt;* #l</doubt><doubt alpha="26.5" length="83" tooSmall="False" monospace="0.0">Q3. #nl:[cat="NP"] &amp; #n2:[pos="N"] &amp; (#nl &gt;* #n2) &amp; (#nl &gt;@r #n3) &amp;   (#n2  &gt;* #n4)</doubt><doubt alpha="32.5" length="40" tooSmall="False" monospace="0.0">Q4       #vp:[cat="VP"]  &amp; #v: [pos="V"]</doubt><doubt alpha="38.6" length="140" tooSmall="False" monospace="0.0">&amp; #np:[cat="NP"]  &amp; #pp:[cat="PP"] &amp; #vp &gt;* #v &amp; #vp &gt;* #np &amp; #vp &gt;* #pp &amp; #v &gt;@r #vr &amp; #np &gt;@l #npl &amp; #vr .l #npl &amp; pp &gt;@l ppl &amp; npl .l ppl</doubt><doubt alpha="26.1" length="88" tooSmall="False" monospace="0.0">Q5.*    #vp:[cat="VP"]   &amp; #np:[cat="NP"] &amp;  (#x &gt;* #v)   &amp;  (#x &gt;* #np) &amp;  (#v  .* #np)</doubt><doubt alpha="62.5" length="24" tooSmall="False" monospace="0.0">Q6.      Not expressible</doubt><doubt alpha="32.8" length="58" tooSmall="False" monospace="0.0">Q7.*    #vp:[cat="VP"]   &amp; #np:[cat="NP"] $   (#vp &gt;* #np)</doubt><p>Figure 4: TigerSearch Queries; (*) Queries are approxi­mations and may not produce the correct output these so-called "syntax graphs" (Konig and Lezius, 2001). Query graphs are built using two main relations: immediate dominance (&gt; ) and immediate precedence (.). Closures of these relations (&gt;* and . * respectively) and other node relations such sibling ($) and left and right corners (&gt;@l,&gt;@r) increase expressiveness. However, intersecting hierarchies are not supported (Q6).</p><p>A precedes B (i.e. A .. B) if the left corner of A precedes the left corner of B. Immediate prece­dence means the distance between left corners is 1. Queries requiring immediate precedence (e.g. Q4) will not be correctly described using this relation. Left and right corners can be used to define the query we want (cf. fig 4). However, this mimics the Tgrep2 precedence definition and may fail if the syntax graph has crossing branches.</p><p>Nodes are implicitly existentially quantified before the graph description. This means non-inclusion in Q2 will fail unless the negated node exists in the graph. The expression of Q5 is incorrect as the non-existence of a lower common ancestor cannot be established. The closest approximation will include all common ancestors. However, we can use the (somewhat unintuitive) fact that a rightmost child of a node must dominate the right corner ofthat node to formulate Q3.</p><p>The corpus of syntax graphs is indexed before querying. This index contains inferred facts about the corpus graphs with respect to TIGERSearch relations and predicates. In effect, the corpus data becomes a prolog fact database. The query proces­sor attempts to unify elements ofcorpus graphs with the query graph. Exhaustive search is avoided using label based filtering and by re-ordering the query graph traversal.</p><doubt alpha="56.3" length="119" tooSmall="False" monospace="0.0">Ql.     [Syntax=S " Word=saw] Q2.* Not expressible Q3.    end(Syntax=NP, Syntax=N)=l Q4.*   [Syntax=VP ~   [Syntax=V -&gt;</doubt><doubt alpha="51.0" length="96" tooSmall="False" monospace="0.0">[Syntax=NP -&gt; Syntax PP] ]] Q5.*   [Syntax!=x ~   [Syntax=NP -&gt; Syntax=VP]] Q6.     [Syntax=NP ~</doubt><doubt alpha="61.3" length="62" tooSmall="False" monospace="0.0">[Word=dark ~ intermediate=L-]] Q7.?   [Syntax=VP ~ #Syntax=NP]</doubt><figure caption="Figure 5: Emu Queries"></figure><p>Matching syntax graphs are returned in their entirety. This means output reduction of Q7 cannot be done.</p></subsection><subsection number="2.3" title="Emu Query Language"><p>The Emu speech database system (Cassidy and Har­rington, 2001) defines an annotation scheme involv­ing temporal constraints of precedence and over­lap. Emu annotations are stratified into levels; each level is an interval structure, and elements on each level overlap those on the same and on other levels. The overlap relation is called dominance in the Emu documentation, but it is a reflexive, symmetric and non-transitive relation best understood as temporal overlap. Given this approach to dominance, nodes in an Emu structure can be "dominated" by multiple parent nodes. Hence Emu claims to support multi­ple intersecting hierarchies. Example Emu queries are given in Figure 5.</p><p>Built in functions start ( ), end ( ), mid ( ) and position() allow expression of the positional constraint in Q3. However lack of precision in dominance and precedence relations is a problem when dealing with syntax. Immediate dominance is only expressible between the appropriate levels. However, syntax trees do not easily split into such identifiable levels. Precedence is only defined for nodes on the same level. There is no way to describe immediate precedence within a level. Negated relations are not possible hence Q2 type non-inclusion cannot be expressed either.</p><p>Each query only returns one node per match. The target node can be specified by the user (Q7). How­ever, this is unhelpful if structure is of interest. It also prevents query composition. Query constraints are tested in all possible match positions in the structure. This is satisfactory for small data sets but does not scale up well.</p><page local="4" global="142"/><doubt alpha="50.0" length="14" tooSmall="False" monospace="0.0">Ql.    node: S</doubt><doubt alpha="58.8" length="34" tooSmall="False" monospace="0.0">query:  saw exists Q2.    node : S</doubt><doubt alpha="58.3" length="36" tooSmall="False" monospace="0.0">query:   !saw exists Q3.    node: NP</doubt><p>query: NP iDomsLastl N Q4.? node : VP query: V iprecedes NP and NP iprecedes PP Q5.* Not expressible Q6.* Not expressible Q7.    node: VP query: exists NP node: NP query: exists *</p><figure caption="Figure 6: CorpusSearch Queries"></figure></subsection><subsection number="2.4" title="CorpusSearch"><p>CorpusSearch was developed for the Penn-Helsinki Parsed Corpus of Middle English, though it can be used with any corpus annotated in the Penn Treebank style. An interesting feature of this language is that queries are limited in scope to subtree rooted by a specific type of node. In Q1 exists asks that the word 'saw' exists in a subtree rooted with an 'S'. Surprisingly, the search function (relation) dominates has been discontinued. This means nested dominance queries cannot be expressed. Precedence is only defined among siblings which greatly restricts the number of queries possible. Q4, for example, will miss many hits.</p><p>Negation of dominance has the semantics required for Q2. However, VP precedes !NP will not match verb phrases that are rightmost amongst their siblings. Search functions such as iDomsLast exist to express this sort of positional constraint instead. Wildcards can be specified, however the lack of a dominance search function means Q5 cannot be expressed. Multiple domination, as in Q6, is not supported.</p><p>A striking feature of this language is that it treats regular expressions over node names as variable names. Thus A iprecedes B* | C and B*|C iprecedes D describes a sequence of three nodes, while A iprecedes B*|C and C|B* iprecedes D describes two unrelated sequences, each of two nodes.</p><p>CorpusSearch is compositional. This allows Q7 to be specified in two stages.</p></subsection><subsection number="2.5" title="NiteQL"><p>NiteQL extends the MATE workbench query language Q4M (McKelvie et al., 2001) and has been released as part of the NITE XML Toolkit (Heid et al., 2004). Queries consist of weakly typed variable declarations followed by match conditions. Matches are evaluated over attribute, structure and time constraints. Precedence can be defined by the application designer depending on the data model.</p><doubt alpha="46.7" length="30" tooSmall="False" monospace="0.0">Ql.   ($s syntax)   ($w word):</doubt><doubt alpha="36.4" length="77" tooSmall="False" monospace="0.0">($w@orth=="saw")  &amp;&amp; ($s@cat=="S") &amp;&amp;  ($s " $w) Q2.*($s syntax)   ($w word):</doubt><doubt alpha="39.4" length="33" tooSmall="False" monospace="0.0">($w@orth=="saw") &amp;&amp; ($s@cat=="S")</doubt><doubt alpha="37.9" length="29" tooSmall="False" monospace="0.0">Q3.   ($np cat)   ($w word) :</doubt><doubt alpha="37.5" length="32" tooSmall="False" monospace="0.0">($np@cat=="NP") &amp;&amp; ($w@pos=="N")</doubt><doubt alpha="39.5" length="43" tooSmall="False" monospace="0.0">&amp;&amp;  ($np $w) Q4.   ($vp syntax)   ($v word)</doubt><doubt alpha="57.1" length="28" tooSmall="False" monospace="0.0">($np syntax)   ($pp syntax):</doubt><doubt alpha="37.1" length="70" tooSmall="False" monospace="0.0">($v@pos=="V") &amp;&amp; ($np@cat=="NP") &amp;&amp; ($pp@cat=="PP") &amp;&amp; ($vp@cat=="VP")</doubt><doubt alpha="33.3" length="132" tooSmall="False" monospace="0.0">&amp;&amp;  ($v &lt;&gt;l $np)   &amp;&amp;  ($np &lt;&gt;l $pp) &amp;&amp;  ($vp " $v)   &amp;&amp;  ($vp " $np) &amp;&amp;  ($vp ~ $pp) Q5.*($vp syntax)   ($np syntax)   ($x syntax):</doubt><doubt alpha="41.2" length="34" tooSmall="False" monospace="0.0">($vp@cat=="VP") &amp;&amp; ($np@cat=="NP")</doubt><doubt alpha="37.5" length="96" tooSmall="False" monospace="0.0">&amp;&amp;  ($x " $vp)   &amp;&amp;  ($x " $np) &amp;&amp; ($np &lt;&gt; $vp) Q6.   ($s syntax)   ($i intermediate) ($w word):</doubt><doubt alpha="36.4" length="33" tooSmall="False" monospace="0.0">($s@cat=="NP") &amp;&amp; ($i@tone=="L-")</doubt><doubt alpha="39.1" length="92" tooSmall="False" monospace="0.0">&amp;&amp; ($w@orth=="dark") &amp;&amp;  ($s " $w)   &amp;&amp;  ($i " $w) Q7.   (exists $vp syntax)   ($np syntax):</doubt><doubt alpha="26.7" length="15" tooSmall="False" monospace="0.0">&amp;&amp;  ($vp " $np)</doubt><figure caption="Figure 7: NiteQL Queries"></figure><p>The queries in Figure 7 assume the model used by Tgrep2. If crossing branches are permitted, and the left corners precedence definition is used, then NiteQL will behave like TIGERSearch instead. Dominance and precedence relations can take modifiers that provide more positional constraints. In Q3, "l indicates immediate dominance and [-l] indicates rightmost descendant. Any sibling position at any level can be specified.</p><p>Like TIGERSearch, variables are existentially quantified when declared so Q2 and Q5 cannot be correctly expressed. Quantification (exists, forall) can be used in variable declarations. However their main purpose is to suppress marked in query output as used in Q7.</p><p>The NITE project encourages storage in standoff XML. An XPath-like pointer relation enables the formation of secondary (non-tree) edges between nodes.<page local="5" global="143"/> These can also occur between separate hier­archies. The final output is an XML document listing pointers to matches in the corpus. This is useful for searches during the annotation process. NiteQL's type system allows queries on intersecting hierarchies as seen in Q6. Complex queries provide compositionality and can be used to structure results to some extent.</p><doubt alpha="32.2" length="115" tooSmall="False" monospace="0.0">Ql.    /S[//_[@lex = 'saw']] Q2.    /S[not //_[@lex = 'saw']] Q3. //NP{/N$} Q4//Vp{v-&gt;NP-&gt;PP} Q5.?  //_{//NP--&gt;VP}/</doubt><doubt alpha="63.6" length="55" tooSmall="False" monospace="0.0">ancestor-or-self::*[l] Q6.* Not expressible Q7. //VP/NP</doubt><figure caption="Figure 8: LPath Queries"></figure></subsection><subsection number="2.6" title="LPath"><p>LPath is a path language for linguistic trees extending XPath, with with an immediate precedence and a scoping operator (Bird et al., 2004). LPath queries can be translated into SQL for efficient evaluation. The LPath versions of the example queries are shown in Figure 8. The LPath representation of Q5 follows from node set selection in XPath. The positional predicate [l] is applied as the ancestor axis is traversed. In this case, only the first node in <i>reverse document order </i>is selected. This is the first common ancestor required by the query.</p></subsection></section><section number="3" title="Requirements for Tree Query"><p>Tree query languages need to be able to express node relationships succinctly. The languages we have surveyed needed more than dominance and precedence relations to express the specialized rela­tions invoked in the example queries. A reason­able definition of immediate precedence is clearly necessary. However, more is required than positive descriptions. Non-inclusion queries such as Q2 and Q5 could not be expressed in all languages.</p><subsection number="3.1" title="Simple Navigation"><p><b>Subtree Matching. </b>A vital part of subtree match­ing is accurate specification of the query tree. An inventory of subtree description types is given in Figure 9. Subtree description may also be facilitated with a graphical interface that maps tree diagrams to expressions in a query language. This is an attrac­tive option for non-computer scientists and already exists in tools such as TIGERSearch.</p><p>Immediate dominance:</p><p><i>A dominates B, A may dominate other nodes</i></p><p>Positional constraint:</p><p><i>A dominates B, and B is the first (last) child of A</i></p><p>Positional constraint with respect to a label:</p><p><i>A dominates B, and B is the last B child </i><i>ofA</i></p><p>Multiple dominance:</p><p><i>A dominates both B and C, but the order </i><i>ofB</i><i> and C is unspecified.</i></p><p>Sibling precedence:</p><p><i>A dominates both B and C, B precedes C; A domi­nates both B and C, B immediately precedes C</i></p><p>Complete description:</p><p><i>A dominates B and C, in that order, and nothing else</i></p><p>Multiple copies:</p><p><i>A dominates B and B, and the two Bs are different instances</i></p><p>Negation:</p><p><i>A does not dominate node with label B </i>Figure 9: Subtree Matching Queries</p><p><b>Returning subtrees. </b>The query languages had some capacity to constrain the output of a query as was shown in example query Q7. However, only NiteQL could choose specific nodes (as opposed to subtree roots) to output. This sort of precise reduction needs to be further supported.</p><p><b>Reverse navigation. </b>Query specifications tend to reflect top down, left to right tree navigation. On the other hand, context can occur in any direc­tion from a node. This is a problem for languages such as Tgrep2 where graph description focuses on one particular node at a time. Reverse relations, such as 'follows', are implemented in Tgrep2 and are necessary for queries such as Q5. However, reverse relations have less value in a language like TIGERSearch where the ordering of graph descrip­tion is not important. In terms of expressiveness, necessity of these relations depends on the query structure.</p><p>However, reverse navigation is relevant for devel­oping a matching strategy. For example, matching an ancestor only requires nodes on the path from the current node to the root. Strategies that allow reduction of the search space need to be employed.</p><p><b>Non-tree navigation. </b>Queries are not always described in terms of edge traversal structure. Queries are often specified over the sequence of terminals (i.e. the text), regardless of hierarchical organization. Example queries have shown that this notion of sequential navigation needs to be extended to non-terminal nodes, e.g. to permit searching for sequences of one or more adjective<page local="6" global="144"/></p><doubt alpha="100.0" length="2" tooSmall="False" monospace="0.0">NP</doubt><p>Adj Adj N</p><p>(a) Flat Structure (b) Chomsky Adjunction</p><figure caption="Figure 10: Two Representations for Optional, Repeat-able Constituents"></figure><p>cats chase mice NP chase mice cats V mice cats chase NP NP V mice NP chase NP cats V NP cats VP NP VP NP V NP S</p><doubt alpha="55.6" length="18" tooSmall="False" monospace="0.0">S — NP VP VP — VNP</doubt><doubt alpha="66.7" length="9" tooSmall="False" monospace="0.0">NP - cats</doubt><doubt alpha="63.2" length="19" tooSmall="False" monospace="0.0">NP - mice V - chase</doubt><p>(a) Phrase Structure Grammar (b) Proper Analyses (c) Syntactic Chart Figure 11: Immediate Precedence in Linguistic Trees</p><doubt alpha="100.0" length="4" tooSmall="False" monospace="0.0">cats</doubt><doubt alpha="100.0" length="4" tooSmall="False" monospace="0.0">dogs</doubt><p>followed by a noun, regardless of the internal organization of the noun phrase (cf. Figure 10). All surveyed languages support some notion of precedence though not all allow for immediate precedence. Immediate precedence in a tree can be conceived in terms of the "proper analyses" of early generative grammar (Chomsky, 1963) or syntactic charts, as shown in Figure 11.</p></subsection><subsection number="3.2" title="Closures"><p>The surveyed languages include closures of basic relations such as dominance, precedence and sib­ling precedence. These are necessary as distance between nodes of interest can be arbitrarily large. These are generally represented as separate rela­tions in tree querying languages. However, closures are required of more complicated structures that are not handled currently.</p><p>We may wish to find parts of a corpus that fit a particular grammatical theory. For example, Chomsky adjunction in Figure 10 can be described by the productions: NP — Adj NP, NP — N. This translates to an LPath-like expression ( /NP [ /Adj ])*/N. Here closure is atomic and each repetition involves a single step along some axis. In general we would like to be able to express any self-recursive rule A — Li • • • LnAR1 • • • Rn using a closure. In LPath this might possibly be specified by (/A[&lt;=Ln...&lt;=Ll, =&gt;Rl...=&gt;Rn])+.</p><p>Closures involving more than one step are also required. For example, a path consisting of alter­nating VP and S's: (/VP/S)+. Outside of tree navigation we wish to find regular sequences such as consonants and vowels: ( - &gt;C-&gt;V) +. Moreover some structure may best be described using nested closures, e.g. ((-&gt;C)+-&gt;V)+.</p><p>Q5 represents a class of queries that ask for the first common ancestor of tree fragment. However, negation semantics means this can only be speci­fied in Tgrep2 and LPath. This problem may be addressed more generally with the greedy matching approach of regular expression processing. That is, signal that we want the first match only. However, this is not compositional.</p></subsection><subsection number="3.3" title="Beyond ordered trees"><p>Queries may need to extend beyond sentence boundaries. For example, anaphoric arguments may occur in previous sentences (Prasad et al., 2004). If trees represent sentences and querying is restricted to subtree matching this is a problem. One solution is to include multiple sentences in trees. However, this drastically increases the size of trees. Query trees are generally very small (if spread widely) so massive trees decrease filter effectiveness during query processing and have a bad effect on matching algorithms.</p><p>This presents a good case for querying over ordered forests. In fact this is necessary when querying the Verbmobil treebanks of spontaneous speech (Hinrichs et al., 2000). Here discourse turns are modelled to include repetitions, interjections, disfluencies and sentence fragments. These are represented as trees disconnected from surrounding well-formed sentences. Trees can occur wrapped in other trees as seen in Figure 12. VIQTORYA (Steiner and Kallmeyer, 2002) is a query language developed for these treebanks. However, this can be considered a subset of the TIGERSearch language so was not discussed in the survey.</p><doubt alpha="100.0" length="1" tooSmall="False" monospace="0.0">S</doubt><doubt alpha="100.0" length="5" tooSmall="False" monospace="0.0">chase</doubt><page local="7" global="145"/><p><b>das macht macht mir nichts</b> <b>PDS VVFIN VVFIN PPER PIS</b></p><figure caption="Figure 12: Forest representation of the Verbmobil corpus (Steiner and Kallmeyer, 2002)"></figure><p>There is a general need to move beyond single tree searches and integrate different types oflinguis-tic data. Querying intersecting hierarchies has been well motivated by the workbenches such as Emu and the NITE project. There is also a need to query over relational and structural data. (e.g. Switch­board Treebank). We may want to match subtrees depending on the attributes of a word stored else­where (e.g. verb class in dictionary). Scope for these types of queries needs to be included in query language development.</p><p>Beyond this, there is a need to query non-tree structure. For example, Penn Treebank and the TIGER corpus includes secondary edges. It would be useful to navigate these links to extract informa­tion about the long range phenomena stored there. This means a definite move from tree based models which needs to be explored further.</p></subsection><subsection number="3.4" title="Update"><p>Curating a corpus of trees requires frequent updates. Tree edits often describe restructuring of constituents. For example, transforming structure to (resp. from) a small clause representation involves insertion (resp. deletion) of a common parent. Changing annotation style to reflect X-bar theory involves relabelling certain NP nodes to N' . Another useful transform is to reattach a phrasal adjunct to a higher level node, which calls for a notion of subtree movement.</p><p>Insertion, deletion and relabelling nodes are stan­dard tree editing operations. However, linguistic trees are more constrained than general trees. Free­dom of movement of constituents almost always depends on preserving the base text. Subtree dele­tion is not allowed (except zero-width elements) nor is re-ordering of leaves. Any subtree can only legally move to a limited number of locations with­out perturbing the text.</p><p>Subtree movement can be described in terms of node insertion and deletion. However, this will be extremely tedious for the user to specify as sub­trees may be extremely large. Thus subtree move­ment should appear as a basic operation. (Cotton and Bird, 2002) present a tree edit operations all in terms of node movement of a distinguished node. The direction and surrounding structure determines where the node is reattached. Further operations are required to deal correctly with empty constituents. All update operations should have inverses so edits can be reversed.</p><p>Syntactically annotated corpora are often anno­tated with respect to a particular grammar. These grammars may be updated and annotations need to be changed to reflect this. However, it is inefficient to reannotate the entire corpus every time this hap­pens. A useful update mechanism should be able to compare grammars and then implement changes only where necessary. The closures described pre­viously will be useful here.</p></subsection></section><section number="4" title="Conclusion"><p>Several linguistic tree languages have been pro­posed in earlier work, and we have investigated their expressiveness and conciseness for a range of prac­tical queries. Our survey has led us to propose a number of requirements for any general-purpose linguistic tree query language. They should permit hierarchical and sequential navigation, including an immediate precedence relation which cuts across the hierarchy. They should go beyond simple sub­tree matching to support a range of closures which correspond to grammar fragments, and positive and negative constraints on context. Whether as inter­secting hierarchies or ordered forests, multiple tree querying must also be developed further. Require­ments for a tree update language derive from a need to maintain the underlying text and present natural edit operations to the user.</p><p>We have broached several topics which require further investigation. Query languages incorporat­ing variables, quantification, negation, and closures need to be better understood. This can be done by manually translating such queries to a language of first order logic or modal logic, exploring the kinds of nested quantification required, and consequences for implementation. The existing, well-understood relational and semi-structured query languages and finite automata could play a similar role.</p><p>Query expressions which can be mapped to the forwards and downwards subset of tree navigations are amenable to implementation in a streaming pro­cessor, opening the way for a true tree-grep tool which is able to function in a pipeline mode on unpreprocessed treebank files.<page local="8" global="146"/> Other areas of fur­ther work include an exploration of an appropriate typing system as used to navigate intersecting hier­archies; investigation of boundaries for contextual search; and the interaction of indexing and updates.</p></section><section title="Acknowledgements"><p>This research has been supported by an Australian Postgraduate Award (Lai), and a US National Sci­ence Foundation grant number 0317826 <i>Querying Linguistic Databases, </i>to the University of Pennsyl­vania (Bird).</p></section><references><p>S. Bird, Y. Chen, S. Davidson, H. Lee, and Y. Zheng. 2004. LPath: A path language for lin­guistic trees. Unpublished manuscript.</p><doubt alpha="66.0" length="47" tooSmall="False" monospace="0.0">S. Brants, S. Dipper, S. Hansen, W. Lezius, and</doubt><p>G. Smith. 2002. The TIGER Treebank. In <i>Pro­ceedings of the Workshop on Treebanks and Lin­guistic Theories Sozopol. </i>S. Cassidy and J. Harrington. 2001. Multi-level annotation in the Emu speech database man­agement system. <i>Speech Communication, </i>33(1-2):61-77.</p><p>N. Chomsky. 1963. Formal properties of gram­mars. In D. Luce, R. Bush, and E. Galanter, editors, <i>Handbook ofMathematical Psychology, </i>volume 2, pages 323-418. New York: Wiley and Sons.</p><p>S. Cotton and S. Bird. 2002. An Integrated Frame­work for Treebanks and Multilayer Annotations.</p><p>In <i>Proceedings ofthe Third International Con­ference on Language Resources and Evaluation,</i> and S. Pado. 2004. Querying both time-aligned and hierarchical corpora with nxt search. In <i>Fourth Language Resources and Evaluation Con­ference, Lisbon, Portugal. </i>E. W. Hinrichs, J. Bartels, Y. Kawata, and V. Kordoni. 2000. The VERBMOBIL Treebanks. In <i>KONVENS 2000 Sprachkommunikation, ITG-Fachbericht 161, </i>pages 107-112. VDE Verlag.</p><doubt alpha="53.5" length="71" tooSmall="False" monospace="0.0">pages 1670-1677. ELRA. U. Heid, H. Voormann, J-T Milde, U. Gut, K. Erk,</doubt><p>E. König and W. Lezius. 2001. The TIGER lan­guage - a description language for syntax graphs. Part 1: User's guidelines. Technical report, Uni­versity of Stuttgart, Stuttgart, Germany.</p><p>M. Marcus, G. Kim, M. Marcinkiewicz, R. Mac-Intyre, A. Bies, M. Ferguson, K. Katz, and B. Schasberger. 1994. The Penn treebank: Annotating predicate argument structure. In <i>ARPA Human Language Technology Workshop.</i></p><doubt alpha="60.5" length="86" tooSmall="False" monospace="0.0">D. McKelvie, A. Isard, A. Mengel, M. B. Moller, M. Gross, and M. Klein. 2001. The MATE</doubt><p>workbench — an annotation tool for XML coded speech corpora. <i>Speech Communication, </i>33(1-2):97-112.</p><p>R. Prasad, E. Miltsakaki, A. Joshi, and B. Webber. 2004. Annotation and Data Mining of the Penn Discourse TreeBank. In <i>Proceedings ofthe ACL Workshop on Discourse Annotation Barcelona, Spain.</i></p><p>D. Rohde. 2001. Tgrep2 user manual.</p><p>I. Steiner and L. Kallmeyer. 2002. VIQTORYA - A Visual Query Tool for Syntactically Anno­tated Corpora. In <i>Proceedings ofthe Third Inter­national Conference on Language Resources and Evaluation (LREC2002), </i>pages 1704-1711.</p><p>ELRA.</p></references></body></article>