korpling / ANNIS

ANNIS is an open source, versatile web browser-based search and visualization architecture for complex multilevel linguistic corpora with diverse types of annotation.
http://corpus-tools.org/annis/
Apache License 2.0
67 stars 25 forks source link

Query with more than one @* fails (Annis 4) #833

Closed gcelano closed 12 months ago

gcelano commented 1 year ago

Describe the bug

In Annis 4 desktop, a search like:

tok @* author=‎"Euripides‎" @* title=‎"Hippolytus‎"

does not return anything (by mistake). The problem seems to be the presence of two @*, because each of them works without the other

System:

thomaskrause commented 12 months ago

I think this should be

tok  @* author=‎"Euripides‎" _ident_ title=‎"Hippolytus‎"

or alternatively

tok  & author=‎"Euripides‎" & title=‎"Hippolytus‎"
& #1 @* #2
& #1 @* #3

The @* means "part of" and both the author and title annotations are part of the same identical node. So with the initial query you would ask for a corpus structure like

                root-corpus
           /                    \
title=‎"Hippolytus‎"             [...]
          |
author=‎"Euripides‎"
          |
 tok tok tok tok

You can either just repeat the relation from the token to the document it is part of with two independent @* relations to the different metadata annotations, or explicitly state that both metadata annotations belong to the same document node (using the _ident_ operator).

Since, as far as I understand the issue, is intended behavior, I would close this bug report. If I misunderstood or it does not answer your question please re-open the issue.