implement matrix queries for annotext mode