User Tools

Site Tools


02_browsing:04_queries:01_support

This is an old revision of the document!


2.4.1 Query building support

The query tool ANNIS supports you in different way. We list them up here.

Annotations per sub-corpus

Every sub-corpus in the list has more information about its annotations behind the <i> next to its name. This helps you find available annotations per (sub-)corpus.

Query Builder: Word sequences and meta information

This is probably the easiest way to build your (complex) query step by step.You find the Query Builder at the top, to the right of the query field: Query Builder Figure 1: Starting the query builder

It comes in two flavors, as you can see. You can use the "General (TigerSearch like) function, which is a bit more demanding or you can use the "Word sequences and meta information" function. To switch between these two functions, just press the arrow down.

Let us first look at the "Word sequences and meta information" function. This function helps you build queries per (sub-)corpus, so when you first open it, all sections have a button "initialize". When you press this button, the tool looks for available fields and options for the (sub-)corpus that you have selected at that moment. When you switch corpora, you have to re-initialize the tool by closing its tab and starting it anew.

The tool is set up into five different sections, which we will discuss in more detail in the following.

The first four sections describe the string that you want to query. They all can be found in the section Linguistic sequence in the query builder. Figure 2 shows the following query:

  1. A token with the part of speech PRELS
  2. This same token has to have the value was as an additional property
  3. The token was as a PRELS has to be followed by a token with the value me
  4. The token me as to follow directly, i.e. with no other tokens in between the two tokens

As you can see in figure 1, properties that apply to the same token are listed below each other (1 and 2 in figure 1), while sequences of tokens are listed in a horizontal line (1 and 3 in figure 1).

Figure 2: The query "was (part of speech: PRELS) me" built with word sequence builder.

Figure 3: The relationship between the tokens

Once you have defined these attributes, you can click on Create AQL Query below and your query is created in the query field to the left of the Query Builder as you can see in figure 2.

In the fields below you can add additional annotations from the layers messages and chats. These will be added you the query you defined above. As you can see in figure 4, the resulting query is rather complex and thus justifies the use of the query builder.

Figure 4: complex query from different layers.

Query Builder. General (TigerSearch like)

This type of query builder focuses on relationships between entities. It basically works as follows: you select an entity (ie. the value of the token) and then select another entity (eg. the part of speech that this tokens is to have) and then link the two via a relationship. Figure 5 shows how this example is constructed.

Figure 5: Building a query by selecting a relationship between entities

To work with this query builder, you first select all the nodes ("Add node") required for your query (i.e. the value of the token and the PoS in the example). You then add an edge, i.e. a relationship between these two entities (e.g. different types of precedence, inclusion, overlap etc.) and dock the selected entity to the other one.

NB: you cannot have isolated identities, they all have to be linked via edges.

02_browsing/04_queries/01_support.1587541361.txt.gz · Last modified: 2022/06/27 09:21 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki