Answer Counting under Guarded TGDs

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. [19]. 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. 2012 ACM Subject Classification Theory of computation → Database theory

[1]  Arnaud Durand,et al.  The complexity of weighted counting for acyclic conjunctive queries , 2011, J. Comput. Syst. Sci..

[2]  Jörg Flum,et al.  The Parameterized Complexity of Counting Problems , 2004, SIAM J. Comput..

[3]  Georg Gottlob,et al.  Semantic Optimization of Conjunctive Queries , 2020, J. ACM.

[4]  Marc Roth,et al.  Counting Answers to Existential Questions , 2019, ICALP.

[5]  David S. Johnson,et al.  Testing containment of conjunctive queries under functional and inclusion dependencies , 1982, J. Comput. Syst. Sci..

[6]  David Maier,et al.  Testing implications of data dependencies , 1979, SIGMOD '79.

[7]  Martin Grohe The complexity of homomorphism and constraint satisfaction problems seen from the other side , 2007, JACM.

[8]  Reinhard Pichler,et al.  Tractable Counting of the Answers to Conjunctive Queries , 2013, AMW.

[9]  Marcelo Arenas,et al.  When is Approximate Counting for Conjunctive Queries Tractable , 2020 .

[10]  Georg Gottlob,et al.  Semantic Acyclicity Under Constraints , 2016, AMW.

[11]  Pablo Barceló,et al.  Efficient approximations of conjunctive queries , 2012, PODS '12.

[12]  Carsten Lutz,et al.  The Limits of Efficiency for Open- and Closed-World Query Evaluation Under Guarded TGDs , 2020, PODS.

[13]  Diego Figueira,et al.  Semantically Acyclic Conjunctive Queries under Functional Dependencies , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[14]  Ronald Fagin,et al.  Data exchange: semantics and query answering , 2003, Theor. Comput. Sci..

[15]  Bogdan Kostov,et al.  Count Distinct Semantic Queries over Multiple Linked Datasets , 2018, Open J. Semantic Web.

[16]  Peter Jonsson,et al.  The complexity of counting homomorphisms seen from the other side , 2004, Theor. Comput. Sci..

[17]  Ian Horrocks,et al.  An Introduction to Description Logic , 2017 .

[18]  Georg Gottlob,et al.  Querying the Guarded Fragment , 2010, 2010 25th Annual IEEE Symposium on Logic in Computer Science.

[19]  Giorgio Terracina,et al.  Fast Query Answering over Existential Rules , 2019, ACM Trans. Comput. Log..

[20]  Andrea Calì,et al.  Towards more expressive ontology languages: The query answering problem , 2012, Artif. Intell..

[21]  Egor V. Kostylev,et al.  Complexity of Answering Counting Aggregate Queries over DL-Lite , 2013, Description Logics.

[22]  Carsten Lutz,et al.  Ontology-Based Data Access , 2014, ACM Trans. Database Syst..

[23]  Hubie Chen,et al.  Counting Answers to Existential Positive Queries: A Complexity Classification , 2016, PODS.

[24]  Arnaud Durand,et al.  Structural Tractability of Counting of Solutions to Conjunctive Queries , 2013, ICDT '13.

[25]  Diego Calvanese,et al.  Linking Data to Ontologies , 2008, J. Data Semant..

[26]  Michaël Thomazo,et al.  Cardinality Queries over DL-Lite Ontologies , 2021, IJCAI.

[27]  Diego Calvanese,et al.  Dwq : Esprit Long Term Research Project, No 22469 on the Decidability of Query Containment under Constraints on the Decidability of Query Containment under Constraints , 2022 .

[28]  Carsten Lutz,et al.  When is Ontology-Mediated Querying Efficient? , 2019, 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[29]  Michaël Thomazo,et al.  Answering Counting Queries over DL-Lite Ontologies , 2020, IJCAI.

[30]  Andrea Calì,et al.  Taming the Infinite Chase: Query Answering under Expressive Relational Constraints , 2008, Description Logics.

[31]  Leslie Ann Goldberg,et al.  Approximately Counting Answers to Conjunctive Queries with Disequalities and Negations , 2021, PODS.

[32]  Pablo Barceló,et al.  Containment for Rule-Based Ontology-Mediated Queries , 2017, PODS.

[33]  Magdalena Ortiz,et al.  Ontology-Mediated Query Answering with Data-Tractable Description Logics , 2015, Reasoning Web.

[34]  Diego Calvanese,et al.  Counting Query Answers over a DL-Lite Knowledge Base , 2020, IJCAI.

[35]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[36]  Jean-François Baget,et al.  On rules with existential variables: Walking the decidability line , 2011, Artif. Intell..

[37]  Hubie Chen,et al.  A Trichotomy in the Complexity of Counting Answers to Conjunctive Queries , 2014, ICDT.