Answer Counting under Guarded TGDs
Cristina Feier, Carsten Lutz, Marcin Przybyłko
TL;DR
The paper provides a comprehensive classification of the parameterized complexity of counting answers for ontology-mediated queries and constraint queries under guarded TGDs, extending the known UCQ-only results to settings with ontologies and constraints. The central idea is to reduce counting for OMQs/CQSs to counting for carefully transformed CQs via the Chen–Mengel closure and chase-based rewritings, thereby connecting counting complexity to structural measures such as $TW$, $CTW$, $SS$, and $LMN$ through a unifying class $ extsf{Q}^igstar$. The authors establish a five-way dichotomy (exactly the same five complexity levels as in the classical case) and show how ontologies interact with all measures, sometimes reducing to equivalent, bounded-measure forms. They also develop approximation results (FPTRAS/FPRAS) and meta-problems for recognizing and constructing small-measure equivalents, with decidability results under full schema assumptions and guarded TGDs. The work advances practical counting capabilities in ontology-enabled data management and highlights rich interactions between logical constraints and combinatorial graph-structure properties in query evaluation and counting.
Abstract
We study the complexity of answer counting for ontology-mediated queries and for querying under constraints, considering conjunctive queries and unions thereof (UCQs) as the query language and guarded TGDs as the ontology and constraint language, respectively. Our main result is a classification according to whether answer counting is fixed-parameter tractable (FPT), W[1]-equivalent, #W[1]-equivalent, #W[2]-hard, or #A[2]-equivalent, lifting a recent classification for UCQs without ontologies and constraints due to Dell et al. The classification pertains to various structural measures, namely treewidth, contract treewidth, starsize, and linked matching number. Our results rest on the assumption that the arity of relation symbols is bounded by a constant and, in the case of ontology-mediated querying, that all symbols from the ontology and query can occur in the data (so-called full data schema). We also study the meta-problems for the mentioned structural measures, that is, to decide whether a given ontology-mediated query or constraint-query specification is equivalent to one for which the structural measure is bounded.
