17 EQL EBNF26

This chapter presents the EBNF (Garshol 2003) that describes version 2 of the EQL. As the original EBNF adapted from John (2012) was written in German, some of the abbreviation terms were translated into English abbreviations (e.g., DOMA is the abbreviation for the German term Dominanzabfrage and the newly translated DOMQ is the abbreviation for the English term domination query).

17.1 Terminal symbols of EQL2 (operators) and their meaning

The terminal symbols described below are listed in descending order by their binding priority.

Symbol Meaning
# Result modifier (projection)
, Parameter list separator
== Equality (new in version 2 of the EQL; added for cleaner syntax)
= Equality (optional; for backwards compatibility)
!= Inequality
=~ Regular expression matching
!~ Regular expression non-matching
> Greater than
>= Equal to or greater than
< Less than
>= Equal to or less than
| Alternatives separator
& Conjunction of equal rank
^ Dominance conjunction
-> Sequence operator

17.2 Terminal symbols of EQL2 (brackets) and their meanings.

Symbol Meaning
Quotes literal string
( Function parameter list opening bracket
) Function parameter list closing bracket
[ Sequence or dominance-enclosing opening bracket
] Sequence or dominance-enclosing closing bracket

17.3 Terminal symbols of EQL2 (functions) and their meanings.

Symbol Meaning
Start Start
Medial Medial
End Final
Num Count

17.4 Formal description of EMU Query Language Version 2

EBNF_term Abbreviation Conditions
EQL = CONJQ | SEQQ | DOMQ; EMU Query Language
DOMQ = “[", ( CONJQ | DOMQ | SEQQ ), "^", ( CONJQ | DOMQ | SEQQ ), "]”; dominance query levels must be hierarchically associated
SEQQ = “[", ( CONJQ | SEQQ | DOMQ ), "->", ( CONJQ | SEQQ | DOMQ ), "]”; sequential query levels must be linearly associated
CONJQ = { “[" }, SQ, { "&", SQ }, { "]” }; conjunction query levels must be linearly associated
SQ = LABELQ | FUNCQ; simple query
LABELQ = [ “#” ], LEVEL, ( “=” | “==” | “!=” | “=~” | “!~” ), LABELALTERNATIVES; label query
FUNCQ = POSQ | NUMQ; function query
POSQ = POSFCT, “(,” LEVEL, “,” LEVEL, “),” “=,” “0” | “1”; position query levels must be hierarchically associated; second level determines semantics
NUMQ = “Num,” “(,” LEVEL, “,” LEVEL, “),” COP, INTPN; number query levels must be hierarchically associated; first level determines semantics
LABELALTERNATIVES = LABEL , { “|,” LABEL }; label alternatives
LABEL = LABELING | ( “‘“, LABELING,”’” ); label levels must be part of the database structure; LABELING is an arbitrary character string or a label group class configured in the emuDB; result modifier # may only occur once
POSFCT = “Start” | “Medial” | “End”; position function
COP = “=” | “==” | “!=” | “>” | “<” | “<=” | “>=”; comparison operator
INTPN = “0” | INTP; integer positive with null
INTP = DIGIT-“0,” { DIGIT }; integer positive
DIGIT = “0” | “1” | “2” | “3” | “4” | “5” | “6” | “7” | “8” | “9”; digit

INFO: The LABELING term used in the LABEL EBNF term can represent any character string that is present in the annotation. As this can be any combination of Unicode characters, we chose not to explicitly list them as part of the EBNF.

17.5 Restrictions

A query may only contain a single result modifier # (hashtag).


  1. The EBNF presented here is an updated version of the EBNF of the EQL vignette.↩︎