# Acquiring Ontology Axioms through Mappings to Data Sources +
## 4 Queries  
In this section we describe the class of queries that we consider in this paper. We start by introducing \"query atoms\". Intuitively, a query atom is an atom constituted by a meta-predicate applied to a set of arguments, where each argument is either an expression or a variable. The precise definition relies on the notion of \(q\)-_terms_: a q-term is any element of the set \(\tau_{\mathit{DL-Lite}_{R}}(\mathcal{S})\cup\mathcal{V}\). Thus a q-term is either an expression in \(\mathit{DL-Lite}_{R}\) or a variable. In other words, we do not allow for non-ground terms in queries, except for variables themselves. We are now ready to define the notion of _query atom_. A query atom is an atom constituted by the application of a meta-predicate in \(\mathit{MP}(\mathit{DL-Lite}_{R})\) to a set of q-terms. A query atom is called _ground_ if no variable occurs in it and is called an _instance-query atom_ if its meta-predicate is \(\mathit{Inst}_{C}\) or \(\mathit{Inst}_{R}\). The definition of the syntax of the class of queries that we are interested in is as follows. Definition 3: A _higher-order conjunctive query (HCQ)_ is an expression of the form  
\[q(x_{1},\ldots,x_{n})\gets a_{1},\ldots,a_{m}\]  
, where \(q\), called the query predicate, is a symbol not in \(\mathcal{S}\cup\mathcal{V}\), \(n\) is the arity of the query, every \(a_{i}\) is a (possibly non-ground) query atom, and all variables \(x_{1},\ldots,x_{n}\) belong to \(\mathcal{V}\) and occur in some \(a_{j}\). The variables \(x_{1},\ldots,x_{n}\) are called the _free variables_ (or distinguished variables) of the query, while the other variables occurring in \(a_{1},\ldots,a_{m}\) are called _existential variables_. A _higher-order union of conjunctive queries (HUCQ)_ is a set of HCQs of the same arity with the same query predicate. Notice that an HCQ corresponds to an HUCQ formed by a single query. A HCQ is called _Boolean_ if it has no free variables. It is analogous for an HUCQ. An HCQ (HUCQ) constituted by _instance-query atoms only_ is called an _instance HCQ or IHCQ (IHUCQ)_. We now turn our attention to the semantics of queries. Let \(\mathcal{I}\) be an interpretation and \(\mu\) an assignment over \(\mathcal{I}\). A Boolean HCQ \(q\) of the form \(q\gets a_{1},\ldots,a_{n}\) is _satisfied_ in \(\mathcal{I},\mu\) if every query atom \(a_{i}\) is satisfied in \(\mathcal{I},\mu\). Given a Boolean HCQ \(q\) and a \(\mathit{Hi}(\mathit{DL-Lite}_{R})\) KB (or MKB) \(\mathcal{K}\), we say that \(q\) is _logically implied_ by \(\mathcal{K}\) (denoted by \(\mathcal{K}\models q\)) if for each model \(\mathcal{I}\) of \(\mathcal{K}\) there exists an assignment \(\mu\) such that \(q\) is satisfied by \(\mathcal{I},\mu\). Given a non-Boolean HCQ \(q\) of the form \(q(e_{1},\ldots,e_{n})\gets a_{1},\ldots,a_{m}\), a grounding substitution of \(q\) is a substitution \(\theta\) such that \(e_{1}\theta,\ldots,e_{n}\theta\) are ground terms. We call \(e_{1}\theta,\ldots,e_{n}\theta\) a grounding tuple. Definition 4: Given a \(\mathit{Hi}(\mathit{DL-Lite}_{R})\) KB \(\mathcal{K}\) and a non-Boolean HCQ \(q\) of the form \(q(e_{1},\ldots,e_{n})\gets a_{1},\ldots,a_{m}\). The set of _certain answers_ to \(q\) in \(\mathcal{K}\), denoted by \(\mathit{cert}(q,\mathcal{K})\), is the set of grounding tuples \(e_{1}\theta,\ldots,e_{n}\theta\) that make the Boolean query \(q_{\theta}\gets a_{1}\theta,\ldots,a_{m}\theta\) logically implied by \(\mathcal{K}\). These notions extend immediately to HUCQs. **Example 5**. : _We illustrate some examples of HCQs that can be posed to the MKB \(\mathcal{K}\) of Example 4._  
1. _Compute the instances of_ _Ford_ _that were produced in Australia and are of type_ _Coupe_; note that an instance_ \(x\) _of_ _Ford_ _of certain type_ \(T\) _is an instance of a car model_ \(y\) _such that_ \(y\) _is an instance of_ \(T\) _(this in fact holds for all instances of_ _Car_, not only for instances of_ _Ford_).