[Paper Review] A Concise Query Language with Search and Transform Operations for Corpora with Multiple Levels of Annotation
This paper proposes a concise, expressive query language for annotated corpora with multiple levels of annotation using 'threaded trees'—a hybrid structure between trees and graphs. It enables efficient search and transformation operations through a simple syntax with typed threads, supporting complex queries and data manipulation without programming, outperforming existing languages in expressiveness and conciseness for tree-annotated data.
The usefulness of annotated corpora is greatly increased if there is an associated tool that can allow various kinds of operations to be performed in a simple way. Different kinds of annotation frameworks and many query languages for them have been proposed, including some to deal with multiple layers of annotation. We present here an easy to learn query language for a particular kind of annotation framework based on 'threaded trees', which are somewhere between the complete order of a tree and the anarchy of a graph. Through 'typed' threads, they can allow multiple levels of annotation in the same document. Our language has a simple, intuitive and concise syntax and high expressive power. It allows not only to search for complicated patterns with short queries but also allows data manipulation and specification of arbitrary return values. Many of the commonly used tasks that otherwise require writing programs, can be performed with one or more queries. We compare the language with some others and try to evaluate it.
Motivation & Objective
- To address the challenge of querying and transforming linguistically annotated corpora with multiple annotation layers.
- To design a query language that is easy to learn yet powerful enough to replace custom programming for common annotation tasks.
- To support both pattern matching and data transformation in a single, unified language for threaded tree-structured data.
- To evaluate the language’s expressive power and conciseness against existing tree and graph query languages.
- To enable non-programmers, such as annotators and adjudicators, to perform complex data operations efficiently.
Proposed method
- The language is built around a formalism based on 'threaded trees', where nodes can have 'typed' threads to other nodes, enabling multiple annotation layers within a single tree structure.
- It uses a simple, intuitive syntax with constructs like objects, members, operators, wildcards, variables, and aliases to express complex queries.
- Queries are structured with conditions (e.g., node type, label, attribute), path expressions, and transformation rules, including return values and multiple sources/destinations.
- The language supports conjunctions and disjunctions via special index operators (e.g., '@' for conjunction, '*' for disjunction), enabling complex pattern matching.
- It allows data manipulation through transformation actions, such as extracting subtrees or modifying annotations, and supports nested and aliased expressions.
- The language is evaluated using a standard set of seven syntactic queries from prior work, comparing expressiveness and conciseness with NiteQL, Tgrep2, Emu, and others.
Experimental results
Research questions
- RQ1Can a query language be designed that is both concise and expressive for multi-layered annotated corpora encoded as threaded trees?
- RQ2How does the proposed language compare in expressive power and conciseness to existing tree and graph query languages like NiteQL, Tgrep2, and Emu?
- RQ3To what extent can non-programmers learn and use this language for complex annotation tasks without writing code?
- RQ4What are the limitations of the current implementation, particularly regarding performance and missing operators like 'dominates'?
- RQ5Can the language serve as a scripting tool for annotation tasks such as validation, sanity checks, and feature extraction?
Key findings
- All seven benchmark queries from Bird and Lai (2004) can be expressed in the proposed language, demonstrating high expressive power.
- The language matches or exceeds the conciseness of other languages, with many queries expressible in fewer tokens than in NiteQL, which is known for high expressiveness but verbose syntax.
- Only NiteQL could express all seven queries, but the proposed language achieves comparable expressiveness with significantly more concise syntax.
- The language supports complex operations like subtree extraction, conditional matching, and multi-source/multi-destination transformations without requiring programming.
- Users with non-computational backgrounds have found the language easy to learn, with power users mastering it in a few hours, though formal evaluation of learnability is pending.
- The current implementation lacks full support for key operators like 'dominates' and 'is-dominated-by', which would further improve conciseness and usability.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.