<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Formalization and Complexity of MongoDB Queries (Extended Abstract)?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Elena Botoeva</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Diego Calvanese</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Benjamin Cogrel</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Guohui Xiao</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science Free University of Bozen-Bolzano</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we study MongoDB, a widely adopted but not formally understood database system managing JSON documents and equipped with a powerful query mechanism, called the aggregation framework. We define its formal abstraction MQuery, of which we study expressivity and computational complexity. We show the equivalence of MQuery and nested relational algebra, and obtain (tight) bounds in combined complexity, which range from LOGSPACE to alternating exponential-time with a polynomial number of alternations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        JavaScript Object Notation (JSON) is currently adopted extensively as the de-facto
standard format for representing nested data. JSON organizes data as semi-structured
tree-shaped documents, with a minimalistic set of node types, and as such is commonly
considered a lightweight alternative to XML. JSON documents can also be seen as
complex values [
        <xref ref-type="bibr" rid="ref1 ref15 ref7">7,1,15</xref>
        ], in particular due to the presence of nested arrays. Consider, e.g.,
the document in Figure 1, containing personal information (such as name and birth-date)
about Kristen Nygaard, and information about the awards he received, the latter stored
inside an array.
      </p>
      <p>
        Following its massive adoption by practitioners, recently JSON has also received
attention in the database theory community. A powerful (Turing-complete, in its full
generality) Datalog-like query language for JSON named JLogic is introduced in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
where the expressive power and complexity of the full language and of significant
fragments are studied. In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], both JSON and its main schema language JSON Schema1
are formalized, and their expressive power and the computational complexity of basic
computational tasks, such as satisfiability and evaluation of expressions, are studied.
Although some of the latter results apply to the simple find query language2 of the
widespread JSON-based document database system MongoDB, still little is known about
the precise formal properties of the query languages for JSON with rich capabilities
popular among practitioners, such as JSONiq [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and SQL++ [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
? SEBD 2018, June 24–27, 2018, Castellaneta Marina, Italy. Copyright held by the author(s).
      </p>
      <p>
        This is an abridged version of [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
1 http://json-schema.org/
2 https://docs.mongodb.com/manual/crud/
{ "_id": 4,
"awards": [
{ "award": "Rosing Prize", "year": 1999, "by": "Norwegian Data Association" },
{ "award": "Turing Award", "year": 2001, "by": "ACM" },
{ "award": "IEEE John von Neumann Medal", "year": 2001, "by": "IEEE" } ],
"birth": "1926-08-27",
"contribs": [ "OOP", "Simula" ],
"death": "2002-08-10",
"name": { "first": "Kristen", "last": "Nygaard" } }
      </p>
      <p>Differently from XML, where XQuery is the official standard query language,
embraced also by the developer community, so far there is no standard query language
for JSON. However, in terms of adoption, the MongoDB aggregation framework3 is
currently the most prominent language providing rich querying capabilities over
collections of JSON documents, and hence has become the de-facto standard language for
JSON. This language is modeled on the flexible notion of a data processing pipeline,
where a query consists of multiple stages, each defining a transformation using a specific
operator, applied to the set of documents produced by the previous stage. As such, the
language is very expressive and rich in features, but it has been developed in an ad-hoc
manner, resulting in some counter-intuitive behavior.</p>
      <p>
        We study the formal foundations and computational properties of the MongoDB
aggregation framework, which has many similarities with well-known query languages
for complex values, e.g., nested relational algebra (NRA) [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and Core XQuery [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>Our first contribution is a formalization of the JSON data model and of the
aggregation framework query language, in which we deliberately abstract away some low-level
features of MongoDB: we adopt set semantics (as opposed to bag or list semantics), and
we abstract away from order within documents. Our formal language, which we call
MQuery, includes the match, unwind, project, group, and lookup operators, roughly
corresponding to the NRA operators select, unnest, project, nest, and left join, respectively.
In our investigation, we consider various fragments of MQuery, which we denote by
M , where consists of the initials of the stages allowed in the fragment.</p>
      <p>Our second contribution is a characterization of the expressive power of MQuery
obtained by devising translations in both directions between (a suitably defined
welltyped fragment of) MQuery and NRA, showing that the two languages are equivalent
in expressive power. Our translations are compact (i.e., polynomial), hence complexity
results between MQuery and NRA carry over.</p>
      <p>Our third contribution is an investigation of the computational complexity of MMUPGL
and its fragments. We establish several tight bounds (in combined complexity), which
range from LOGSPACE-complete for MM to TA[2nO(1); nO(1)]-complete for MQuery
itself. As a byproduct, we also establish a tight lower bound for the combined complexity
of Boolean query evaluation in NRA.</p>
      <p>
        In the following, we assume familiarity with nested relational algebra (NRA) [
        <xref ref-type="bibr" rid="ref14 ref9">9,14</xref>
        ].
3 https://docs.mongodb.com/manual/core/aggregation-pipeline/
VALUE ::= LITERAL j OBJECT j ARRAY
OBJECT ::= ff LIST&lt;KEY : VALUE&gt; gg
ARRAY ::= [ LIST&lt;VALUE&gt; ]
      </p>
      <p>LIST&lt;T&gt; ::= " j LIST+ &lt;T&gt;
LIST+ &lt;T&gt; ::= T j T , LIST+ &lt;T&gt;
In this section, we propose a formalization of the syntax and the semantics of JSON
documents. With respect to MongoDB, we abstract away the order of key-value pairs
within a document.</p>
      <p>A MongoDB database stores collections of documents, where a collection
corresponds to a table in a (nested) relational database, and a document to a row in a table.
We define the syntax of documents. Literals are atomic values, such as strings, numbers,
and Booleans. A JSON object is a finite set of key-value pairs, where a key is a string
and a value can be a literal, an object, or an array of values, constructed inductively
according to the grammar in Figure 2 (where the terminals are ‘ff’, ‘gg’, ‘[’, ‘]’, ‘:’, and
‘,’). We require that the set of key-value pairs constituting a JSON object does not contain
the same key twice. A (MongoDB) document is a JSON object not nested within any
other object, with a special key ‘ id’, used to identify the document. Figure 1 shows a
document with keys id, awards, birth, etc. Given a collection name C, a (MongoDB)
collection for C is a finite set FC of documents, each identified by its value of id,
i.e., each value of id is unique in FC . Given a set C of collection names, a MongoDB
database instance D (over C) is a set of collections, one for each name C 2 C. We write
D:C to denote the collection for name C.</p>
      <p>We formalize JSON objects as finite unordered, unranked, node-labeled, and
edgelabeled trees (see Figure 3 for the tree tKN corresponding to the document in Figure 1,
where we have additionally labeled nodes with ni, to refer to them later). We assume
three disjoint sets of labels: the sets K of keys and I of indexes (non-negative integers),
used as edge-labels, and the set V of literals, containing the special elements null, true,
and false, and used as node labels. A tree is a tuple (N; E; Ln; Le), where N is a set of
nodes, E is the edge relation, Ln : N ! V [ ‘ffgg’; ‘[ ]’ is a node labeling function,
and Le : E ! K [ I is an edge labeling function, such that (i) (N; E) forms a tree,
(ii) a node labeled by a literal must be a leaf, (iii) all outgoing edges of a node labeled
by ‘ffgg’ must be labeled by keys, and (iv) all outgoing edges of a node labeled by ‘[ ]’</p>
      <p>Fig. 3. The tree tKN corresponding to the JSON document in Figure 1.
must be labeled by distinct indexes. The type of a node x in a tree t, denoted type(x; t),
is defined as literal if Ln(x) 2 V , object if Ln(x) = ‘ffgg’, and array if Ln(x) = ‘[ ]’.
root(t) denotes the root of t. A forest is a set of trees.</p>
      <p>We define inductively the value represented by a node x in a tree t, denoted
value(x; t): (i) value(x; t) = Ln(x), if x is a leaf in t; (ii) let x1; : : : ; xm, be all children
of x with Le(x; xi) = ki. Then value(x; t) is ffk1:value(x1; t); : : : ; km:value(xm; t)gg
if type(x; t) = object, and [value(x1; t); : : : ; value(xm; t)], if type(x; t) = array. The
JSON value represented by t is then value(root(t); t). Conversely, the tree corresponding
to a value u, denoted tree(u), is defined as (N; E; Ln; Le), where N is the set of all xv
such that v is an object, array, or literal value appearing in u, and for xv 2 N : (i) if v is
a literal, then Ln(xv) = v and xv is a leaf; (ii) if v = ffk1:v1; : : : ; km:vmgg for m 0,
then Ln(xv) = ‘ffgg’, and xv has m children xv1 ; : : : ; xvm with Le(xv; xvi ) = ki; (iii) if
v = [v1; : : : ; vm] for m 0, then Ln(xv) = ‘[ ]’, and xv has m children xv1 ; : : : ; xvm
with Le(xv; xvi ) = i 1. In the following, when convenient, we blur the distinction
between JSON values and the corresponding trees.
3</p>
    </sec>
    <sec id="sec-2">
      <title>The MQuery Language</title>
      <p>
        MongoDB is equipped with an expressive query mechanism provided by the aggregation
framework (see [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for its formal syntax. Our first contribution is a formalization of
the core aspects of this query language, where we use set (as opposed to bag and list)
semantics, and we deliberately abstract away some low-level features that either are not
relevant for understanding the expressive power and computational properties of the
language, or appear ad-hoc and possibly are remnants of experimental development. We
call the resulting language MQuery.
      </p>
      <p>An MQuery is a sequence of stages, also called a pipeline, applied to a collection
name C, where each stage transforms a forest into another forest. The grammar of
MQuery is given in Figure 4. In an MQuery, paths, which are (possibly empty)
concatenations of keys, are used to access actual values in a tree, similarly to how attributes are
used in relational algebra. We use " to denote the empty path. For two paths p and p0, we
say that p0 is a (strict) prefix of p, if p = p0:p00, for some (non-empty) path p00. MQuery
allows for five types of stages:
– match ', which selects trees according to criterion '. Such criterion is a Boolean
combination of atomic conditions p = v, expressing the equality of a path p to
a value v, or 9p, expressing the existence of a path p. E.g., for '1 = ( id=4),
'2 = (awards.award=”Turing Award”), and '3 = (name = fffirst: ”Kristen”gg), '1 and
'2 select tKN, but '3 does not.
' ::= true j p = v j 9p j :' j ' _ ' j ' ^ '
d ::= v j p j [d; : : : ; d] j j ( ? d: d)
s ::::== tr'uje!jppj=Pp jj pG=: Avjj 9ppp=Cj::p j _ j ^
P ::= p j p=d j p; P j p=d; P
G ::= p=p j p=p; G
A ::= p=p j p=p; A
MQuery ::= C . s . . s</p>
      <p>
        – unwind !p, which flattens an array reached through a path p in the input tree, and
outputs a tree for each element of the array. E.g., !awards applied to tKN produces
three trees, which coincide on all key-value pairs, except for the awards key, whose
values are nested objects such as, e.g., ffaward: ”Turing Award”, year: 2001, by: ”ACM”gg.
– project P , which modifies trees by projecting away paths, renaming paths, or
introducing new paths. Here P is a sequence of elements of the form p or q=d, where
p is a path to be kept, q is a new path whose value is defined by d, and among all such
paths p and q, there is no pair p, p0 where p is a prefix of p0. A value definition d can
provide for q: (i) a constant v, (ii) the value reached through a path p (i.e., renaming
path p to q), (iii) a new array defined through its values, (iv) the value of a Boolean
expression , or (v) a value computed through a conditional expression ( ? d1: d2).
E.g., bool=(birth=death); cond=((9awards)? contribs: id); newArray=[0;1] applied to tKN produces
ffbool: false, cond: [”OOP”, ”Simula”], newArray: [
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]gg.
– group G : A, which groups trees according to a grouping condition G and aggregates
values of interest according to A. Both G and A are (possibly empty) sequences of
elements of the form p=p0, where p0 is a path in the input trees, and p a path in the
output trees. Each different combination v of values in the input trees for the p0s
in G determines a group. For each such group there is a tree in the output with an
id whose value is constructed from v and the ps in G. The remaining keys in each
output tree have as value an array constructed using the aggregation expression A.
Consider, e.g., as input ffa: 1, b: ”x”gg, ffa: 1, b: ”y”gg, and ffa: 2, b: ”z”gg. Then c=a : bs=b
produces the two groups ff id: ffc: 1gg, bs: [”x”,”y”]gg and ff id: ffc: 2gg, bs: [”z”]gg.
– lookup pp1=C:p2 , which joins input trees with trees in an external collection C,
using a local path p1 and a path p2 in C to express the join condition, and stores the
matching trees in an array under a path p. E.g., let C consist of ff id: 1, a: 3gg and
ff id: 2, a: 4gg. Then diodcs=C:a evaluated over tKN adds to it docs: [ff id: 2, a: 4gg].
We consider various fragments M of MQuery, where consists of the initials of the
allowed stages. E.g., MMUPGL denotes MQuery itself, while MMUPG disallows lookup.
      </p>
      <p>
        For the formal semantics of MQuery, we first observe that a path p over a tree t is
interpreted as the set of nodes reachable via p from the root of t, where the indexes of
intermediate arrays encountered in the tree are skipped. Then, given a forest F and a
stage s, we can define the forest F . s (for a lookup stage, we also require an additional
forest F 0 as parameter) obtained by applying s to F . We refer to [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] for details. The
semantics of an MQuery is obtained by composing (via .) the answers of its stages.
Definition 1. Let q = C . s1 . . sn be an MQuery. The result of evaluating q over a
MongoDB instance D, denoted ansmo(q; D), is defined as Fn, where F0 = D:C, and for
i 2 f1; : : : ; ng, Fi = (Fi 1 . si) if si is not a lookup stage, and Fi = (Fi 1 . si[D:C0])
if si is a lookup stage referring to an external collection name C0.
4
      </p>
    </sec>
    <sec id="sec-3">
      <title>Expressivity of MQuery</title>
      <p>
        In this section we characterize the expressivity of MQuery in terms of nested relational
algebra (NRA), and we do so by developing translations between the two languages.
To make it possible to compare MQuery and NRA, we need to define how MongoDB
instances can be viewed as nested relations. In the case of a MongoDB instance with an
irregular structure, there is no natural way to define such a relational view. This happens
either when the type of a path in a tree is not defined, or when a path has different types
in two trees in the instance. Therefore, in order to define a schema for the relational view,
which is also independent of the actual MongoDB instances, we impose on them some
form of regularity. This is done by introducing the notion of type of a tree, which is
analogous to complex object types [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], and similar to JSON schema [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>A forest F is of type if all its trees are of type , and it is well-typed if it is of some
type . We can then associate to each type a relation schema rschema( ) in which,
intuitively, attributes correspond to paths, and each nested relation corresponds to an
array in . The names of sub-relations and of atomic attributes in rschema( ) are given
by paths from the root in , and therefore are unique. And we can define the relational
view rel(F ), of a well-typed forest F .</p>
      <p>To define the relational view of MongoDB instances, we introduce the notion of
(MongoDB) type constraints, which are given by a set S of pairs (C; ), one for each
collection name C, where is a type. We say that a database D satisfies the constraints
S if D:C is of type , for each (C; ) 2 S. For a given S, for each (C; ) 2 S, we refer
to by C . Moreover, we assume that in rschema( C ), the relation name R C is actually
C. Then, for a set S of type constraints and a MongoDB instance D satisfying S, the
relational view rdbS (D) of D with respect to S is the instance frel(D:C) j (C; ) 2 Sg.</p>
      <p>Finally, we define equivalence between MQueries and NRA queries. To this purpose,
we also define equivalence between two kinds of answers: well-typed forests and nested
relations. We say that a well-typed forest F is equivalent to a nested relation R, denoted
F ' R, if rel(F ) = R. An MQuery q is equivalent to an NRA query Q w.r.t. type
constraints S, denoted q S Q, if ansmo(q; D) ' ansra(Q; rdbS (D)), for each MongoDB
instance D satisfying S (where ansra(Q; R) denotes the answer to the NRA query Q
computed over the nested relation R).</p>
      <p>We are now ready to establish the correspondence between NRA and MQuery. On
the one hand, we show that MMUPGL captures NRA, while MMUPG captures NRA over
a single collection. In our translation from NRA to MQuery, we have to deal with the
fact that an NRA query in general has a tree structure where the leaves are relation
names, while an MQuery contains one sequence of stages. So, we have to show how
to “linearize” tree-shaped NRA expressions into a MongoDB pipeline. More precisely,
we can show that it is possible to combine two MMUPG sequences q1 and q2 of stages
into a single MMUPG sequence pipeline(q1; q2), so that the results of q1 and q2 can
be accessed from the result of pipeline(q1; q2) for further processing. Having defined
pipeline(q1; q2), we are ready to show how to translate NRA to MQuery. For a singleton
set S = f(C; C )g of type constraints for a collection name C and an NRA query Q
over the relation name C (with schema rschema( C )), we can define inductively on
the structure of Q a pipeline nra2mq(Q), and then translate Q into the MMUPG query
C . nra2mq(Q). We obtain that C . nra2mq(Q) S Q. This result can be generalized
to NRA queries over multiple collections, by making use of lookup. We obtain:
Theorem 1. MMUPG captures NRA over a single collection, while MMUPGL captures full
NRA. Moreover there are polynomial translations from NRA to MMUPG/MMUPGL.</p>
      <p>To define a translation from MQuery to NRA we want to exploit the structure, i.e.,
the stages of MQueries. Hence, we define a translation mq2nra(s) from stages s to NRA
expressions such that, for an MQuery C . s1 . . sn, the corresponding NRA query
is defined as C mq2nra(s1) mq2nra(sn)4, where we identify the collection
name C with the corresponding relation schema in the relational view. However, such
a translation might not always be possible, since MQuery is capable of producing non
well-typed forests, for which the relational view is not defined. Therefore, we restrict
our attention to MQueries with stages preserving well-typedness. It is possible to check
whether an MQuery satisfies this property.</p>
      <p>
        The translation mq2nra(s), for well-typed stages s, is quite natural, although it
requires some attention to properly capture the semantics of MQuery. It is given in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
Theorem 2. Let S be a set of type constraints, q an MQuery C . s1 . . sm in which
each stage is well-typed for its input type, and Q = C mq2nra(s1) mq2nra(sm).
Then q S Q. Moreover, the size of Q is polynomial in the size of q and S.
5
      </p>
    </sec>
    <sec id="sec-4">
      <title>Complexity of MQuery</title>
      <p>
        We have studied the complexity of MMUPGL and of some of its fragments, and have
obtained the following results:
– What we consider the minimal fragment, namely MM, which allows only for match,
is LOGSPACE-complete in combined complexity.
– Projection and grouping allow one to create exponentially large objects, but by
representing intermediate results compactly as DAGs, one can still evaluate MMPGL queries
in PTIME. Specifically, MMP is PTIME-hard in query complexity and MMPGL is in
PTIME in combined complexity.
– For MMU, the use of unwind causes loss of tractability in combined complexity,
specifically it leads to NP-completeness, but the language remains LOGSPACE-complete in
query complexity.
– Further adding project in MMUP, or lookup in MMUL, leads again to NP-harness even
in query complexity, although MMUPL stays NP-complete in combined complexity.
– In the presence of unwind, grouping provides another source of complexity, since it
allows one to create doubly-exponentially large objects; indeed MMUG is PSPACE-hard
in query complexity.
– The full language MMUPGL and also the MMUPG fragment are complete for
TA[2nO(1); nO(1)] (i.e., exponential time with a polynomial number of
alternations [
        <xref ref-type="bibr" rid="ref10 ref5">5,10</xref>
        ]) in combined complexity, and in AC0 in data complexity.
      </p>
      <p>
        The latter result provides also a tight TA[2nO(1); nO(1)] bound for the combined
complexity of Boolean query evaluation in NRA, whose exact complexity was open [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
6
      </p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions and Future Work</title>
      <p>We have carried out a first formal investigation on the foundations and computational
properties of the MongoDB aggregation framework, currently the most widely adopted
4 We follow the convention that (f g)(x) = g(f (x)).
expressive query language for JSON. We proposed a clean abstraction for its five main
operators, which we called MQuery. We have studied the expressivity of MQuery,
establishing the equivalence between its well-typed fragment and NRA, by developing
compact translations in both directions. This shows that, despite its design driven by
practical requirements, the aggregation framework relies on solid foundations. Moreover,
we analyzed the computational complexity of significant fragments of MQuery, obtaining
several (tight) bounds. As a byproduct, we obtained also a tight bound for NRA.</p>
      <p>
        We are currently working on applying our results to provide high-level access to
MongoDB data sources by relying on the standard ontology-based data access (OBDA)
paradigm [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. We build on the translation from NRA to MQuery presented in Section 4.
Acknowledgements. This research has been partially supported by the projects OnProm
and STyLoLa, respectively funded through the 2015 Call and the 2017 Interdisciplinary
Call, both issued by the Research Committee of the Free University of Bozen-Bolzano.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Abiteboul</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Beeri</surname>
          </string-name>
          .
          <article-title>The power of languages for the manipulation of complex values</article-title>
          .
          <source>VLDBJ</source>
          ,
          <volume>4</volume>
          (
          <issue>4</issue>
          ):
          <fpage>727</fpage>
          -
          <lpage>794</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>E.</given-names>
            <surname>Botoeva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Cogrel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Xiao</surname>
          </string-name>
          .
          <article-title>Expressivity and complexity of MongoDB (Extended version)</article-title>
          .
          <source>CoRR Technical Report arXiv:1603.09291</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>E.</given-names>
            <surname>Botoeva</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Cogrel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Xiao</surname>
          </string-name>
          .
          <article-title>Expressivity and complexity of MongoDB queries</article-title>
          .
          <source>In Proc. ICDT</source>
          , volume
          <volume>98</volume>
          <source>of LIPIcs</source>
          , pages
          <volume>9</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>9</lpage>
          :
          <fpage>22</fpage>
          ,
          <string-name>
            <surname>Dagstuhl</surname>
          </string-name>
          , Germany,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>P.</given-names>
            <surname>Bourhis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Reutter</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          <article-title>Sua´rez, and D. Vrgocˇ</article-title>
          . JSON:
          <article-title>Data model, query languages and schema specification</article-title>
          .
          <source>In Proc. PODS</source>
          , pages
          <fpage>123</fpage>
          -
          <lpage>135</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>A. K. Chandra</surname>
            ,
            <given-names>D. C.</given-names>
          </string-name>
          <string-name>
            <surname>Kozen</surname>
            , and
            <given-names>L. J.</given-names>
          </string-name>
          <string-name>
            <surname>Stockmeyer</surname>
          </string-name>
          . Alternation. JACM,
          <volume>28</volume>
          (
          <issue>1</issue>
          ):
          <fpage>114</fpage>
          -
          <lpage>133</lpage>
          ,
          <year>1981</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>D.</given-names>
            <surname>Florescu</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Fourny. JSONiq:</surname>
          </string-name>
          <article-title>The history of a query language</article-title>
          .
          <source>IEEE Internet Computing</source>
          ,
          <volume>17</volume>
          (
          <issue>5</issue>
          ):
          <fpage>86</fpage>
          -
          <lpage>90</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>S.</given-names>
            <surname>Grumbach</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vianu</surname>
          </string-name>
          .
          <article-title>Tractable query languages for complex object databases</article-title>
          .
          <source>In Proc. PODS</source>
          , pages
          <fpage>315</fpage>
          -
          <lpage>327</lpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Hidders</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Paredaens</surname>
          </string-name>
          , and J.
          <string-name>
            <surname>Van den Bussche.</surname>
          </string-name>
          J-Logic:
          <article-title>Logical foundations for JSON querying</article-title>
          .
          <source>In Proc. PODS</source>
          , pages
          <fpage>137</fpage>
          -
          <lpage>149</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>G.</given-names>
            <surname>Jaeschke and H.-J. Schek</surname>
          </string-name>
          .
          <article-title>Remarks on the algebra of non first normal form relations</article-title>
          .
          <source>In Proc. PODS</source>
          , pages
          <fpage>124</fpage>
          -
          <lpage>138</lpage>
          ,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Johnson</surname>
          </string-name>
          .
          <article-title>A catalog of complexity classes</article-title>
          .
          <source>In Handbook of Theoretical Computer Science</source>
          , volume
          <string-name>
            <surname>A</surname>
          </string-name>
          , chapter
          <volume>2</volume>
          , pages
          <fpage>67</fpage>
          -
          <lpage>161</lpage>
          . Elsevier,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>C.</given-names>
            <surname>Koch</surname>
          </string-name>
          .
          <article-title>On the complexity of nonrecursive XQuery and functional query languages on complex values</article-title>
          .
          <source>ACM TODS</source>
          ,
          <volume>31</volume>
          (
          <issue>4</issue>
          ):
          <fpage>1215</fpage>
          -
          <lpage>1256</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>K. W. Ong</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          <string-name>
            <surname>Papakonstantinou</surname>
            , and
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Vernoux</surname>
          </string-name>
          . The SQL+
          <article-title>+ semi-structured data model and query language: A capabilities survey of SQL-on-Hadoop, NoSQL and NewSQL databases</article-title>
          .
          <source>CoRR Technical Report arXiv:1405.3631</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>F.</given-names>
            <surname>Pezoa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Reutter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Suarez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ugarte</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Vrgocˇ</surname>
          </string-name>
          .
          <article-title>Foundations of JSON schema</article-title>
          .
          <source>In Proc. WWW</source>
          , pages
          <fpage>263</fpage>
          -
          <lpage>273</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. J. Van den Bussche.
          <article-title>Simulation of the nested relational algebra by the flat relational algebra, with an application to the complexity of evaluating powerset algebra expressions</article-title>
          .
          <source>TCS</source>
          ,
          <volume>254</volume>
          (
          <issue>1</issue>
          ):
          <fpage>363</fpage>
          -
          <lpage>377</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. J. Van den Bussche and
          <string-name>
            <surname>J. Paredaens.</surname>
          </string-name>
          <article-title>The expressive power of complex values in object-based data models</article-title>
          .
          <source>Information and Computation</source>
          ,
          <volume>120</volume>
          (
          <issue>2</issue>
          ):
          <fpage>220</fpage>
          -
          <lpage>236</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. G. Xiao,
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kontchakov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lembo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Poggi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Rosati</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>Ontology-based data access: A survey</article-title>
          .
          <source>In Proc. IJCAI</source>
          . AAAI Press,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>