How to Build a Query using a Mix of Operators

Video Tutorial: Further Example Queries

The examples shown are based on the sample project Children & Happiness. You can download and import it, if you want to follow along.

The instructions below are not as detailed, as it is assumed that you have read the examples for Boolean Queries and Proximity Queries.

Example 1

Question: Find all blog comments written by people who have one child AND who expressed the ambivalence of parenthood that contain a statement that having children made them happier.

The AND query needs to be embedded within the co-occurrence query:

Select the option Quotation co-occurrence. Add the AND query on the next line and enter the two codes '#fam: 1 child' and 'parenthood: ambivalence of'.

To complete the co-occurrence query, add the code 'children: > happiness' to the last line.

Complex Query Example 1

The following image shows one of the resulting quotations:

Complex Query Example 1 Result

To explore the data further, you can exchange the single nodes of the query, for example to see whether there are also comments that match the same criteria for people with two children; or to find comments where people with 1 / 2 or more children write that having children made them less happy.

Example 2

The aim is to find all blog comments written by people who have expressed that children make them happy, that are NOT coded with the code 'parenthood: ambivalence'

Here we have to define two conditions that both must apply:

  • Blog comments that enclose statements that children mean > happiness.
  • All quotations that have not been coded with 'parenthood: ambivalence' As both conditions must be true, we need to use the AND operator to combine them:

Complex Query Example 2

The query yields 11 quotations. You see one of the results in the image above.