skip to main content
10.1145/3340531.3411911acmconferencesArticle/Chapter ViewAbstractPublication PagescikmConference Proceedingsconference-collections
research-article

Optimization of Answer Set Programs for Consistent Query Answering by Means of First-Order Rewriting

Published: 19 October 2020 Publication History

Abstract

Consistent Query Answering (CQA) with respect to primary keys is the following problem. Given a database instance that is possibly inconsistent with respect to its primary key constraints, define a repair as an inclusion-maximal consistent subinstance. Given a Boolean query q, the problem CERTAINTY(q) takes a database instance as input, and asks whether q is true in every repair. For every Boolean conjunctive query q, the complement of CERTAINTY(q) can be straightforwardly implemented in Answer Set Programming (ASP) by means of a generate-and-test approach: first generate a repair, and then test whether it falsifies the query. Theoretical research has recently revealed that for every self-join-free Boolean conjunctive query q, the complexity class of CERTAINTY(q) is one of FO, L-complete, or coNP-complete. Faced with this complexity trichotomy, one can hypothesize that in practice, the full power of generate-and-test is a computational overkill when CERTAINTY(q) is in the low complexity classes FO or L. We investigate part of this hypothesis within the context of ASP, by asking the following question: whenever CERTAINTY(q) is in FO, does a dedicated first-order algorithm exhibit significant performance gains compared to a generic generate-and-test implementation? We first elaborate on the construction of such dedicated first-order algorithms in ASP, and then empirically address this question.

Supplementary Material

MP4 File (3340531.3411911.mp4)
In this video, we first explain CERTAINTY(q), i.e., the problem of consistent query answering with respect to primary-key constraints. We then explain two approaches for solving CERTAINTY(q) in Answer Set Programming: generate-and-test and first-order rewriting. Finally, we discuss some experiments that compare the running times of both approaches.

References

[1]
Marcelo Arenas, Leopoldo E. Bertossi, and Jan Chomicki. 1999. Consistent Query Answers in Inconsistent Databases. In Proceedings of the Eighteenth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, May 31 - June 2, 1999, Philadelphia, Pennsylvania, USA, Victor Vianu and Christos H. Papadimitriou (Eds.). ACM Press, 68--79. https://doi.org/10.1145/303976.303983
[2]
Marcelo Arenas, Leopoldo E. Bertossi, and Jan Chomicki. 2003. Answer sets for consistent query answering in inconsistent databases. Theory Pract. Log. Program., Vol. 3, 4--5 (2003), 393--424. https://doi.org/10.1017/S1471068403001832
[3]
Leopoldo E. Bertossi. 2019. Database Repairs and Consistent Query Answering: Origins and Further Developments. In Proceedings of the 38th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019, Dan Suciu, Sebastian Skritek, and Christoph Koch (Eds.). ACM, 48--58. https://doi.org/10.1145/3294052.3322190
[4]
Jan Chomicki, Jerzy Marcinkowski, and Slawomir Staworko. 2004. Hippo: A System for Computing Consistent Answers to a Class of SQL Queries. In Advances in Database Technology - EDBT 2004, 9th International Conference on Extending Database Technology, Heraklion, Crete, Greece, March 14--18, 2004, Proceedings (Lecture Notes in Computer Science), Elisa Bertino, Stavros Christodoulakis, Dimitris Plexousakis, Vassilis Christophides, Manolis Koubarakis, Klemens Böhm, and Elena Ferrari (Eds.), Vol. 2992. Springer, 841--844. https://doi.org/10.1007/978--3--540--24741--8_53
[5]
Akhil A. Dixit and Phokion G. Kolaitis. 2019. A SAT-Based System for Consistent Query Answering. In Theory and Applications of Satisfiability Testing - SAT 2019 - 22nd International Conference, SAT 2019, Lisbon, Portugal, July 9--12, 2019, Proceedings (Lecture Notes in Computer Science), Mikolás Janota and Inês Lynce (Eds.), Vol. 11628. Springer, 117--135. https://doi.org/10.1007/978--3-030--24258--9_8
[6]
Ariel Fuxman, Elham Fazli, and Renée J. Miller. 2005. ConQuer: Efficient Management of Inconsistent Databases. In Proceedings of the ACM SIGMOD International Conference on Management of Data, Baltimore, Maryland, USA, June 14--16, 2005, Fatma Ö zcan (Ed.). ACM, 155--166. https://doi.org/10.1145/1066157.1066176
[7]
Ariel Fuxman and Renée J. Miller. 2005. First-Order Query Rewriting for Inconsistent Databases. In Database Theory - ICDT 2005, 10th International Conference, Edinburgh, UK, January 5--7, 2005, Proceedings (Lecture Notes in Computer Science), Thomas Eiter and Leonid Libkin (Eds.), Vol. 3363. Springer, 337--351. https://doi.org/10.1007/978--3--540--30570--5_23
[8]
Ariel Fuxman and Renée J. Miller. 2007. First-order query rewriting for inconsistent databases. J. Comput. Syst. Sci., Vol. 73, 4 (2007), 610--635. https://doi.org/10.1016/j.jcss.2006.10.013
[9]
Martin Gebser, Roland Kaminski, Benjamin Kaufmann, and Torsten Schaub. 2014. Clingo = ASP+Control: Preliminary Report. CoRR, Vol. abs/1405.3694 (2014). arxiv: 1405.3694 http://arxiv.org/abs/1405.3694
[10]
Martin Gebser, Roland Kaminski, Arne König, and Torsten Schaub. 2011. Advances in gringo Series 3. In Logic Programming and Nonmonotonic Reasoning - 11th International Conference, LPNMR 2011, Vancouver, Canada, May 16--19, 2011. Proceedings (Lecture Notes in Computer Science), James P. Delgrande and Wolfgang Faber (Eds.), Vol. 6645. Springer, 345--351. https://doi.org/10.1007/978--3--642--20895--9_39
[11]
Gianluigi Greco, Sergio Greco, and Ester Zumpano. 2003. A Logical Framework for Querying and Repairing Inconsistent Databases. IEEE Trans. Knowl. Data Eng., Vol. 15, 6 (2003), 1389--1408. https://doi.org/10.1109/TKDE.2003.1245280
[12]
Phokion G. Kolaitis, Enela Pema, and Wang-Chiew Tan. 2013. Efficient Querying of Inconsistent Databases with Binary Integer Programming. PVLDB, Vol. 6, 6 (2013), 397--408. https://doi.org/10.14778/2536336.2536341
[13]
Paraschos Koutris and Jef Wijsen. 2015. The Data Complexity of Consistent Query Answering for Self-Join-Free Conjunctive Queries Under Primary Key Constraints. In Proceedings of the 34th ACM Symposium on Principles of Database Systems, PODS 2015, Melbourne, Victoria, Australia, May 31 - June 4, 2015, Tova Milo and Diego Calvanese (Eds.). ACM, 17--29. https://doi.org/10.1145/2745754.2745769
[14]
Paraschos Koutris and Jef Wijsen. 2017. Consistent Query Answering for Self-Join-Free Conjunctive Queries Under Primary Key Constraints. ACM Trans. Database Syst., Vol. 42, 2 (2017), 9:1--9:45. https://doi.org/10.1145/3068334
[15]
Paraschos Koutris and Jef Wijsen. 2018. Consistent Query Answering for Primary Keys and Conjunctive Queries with Negated Atoms. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, Houston, TX, USA, June 10--15, 2018, Jan Van den Bussche and Marcelo Arenas (Eds.). ACM, 209--224. https://doi.org/10.1145/3196959.3196982
[16]
Paraschos Koutris and Jef Wijsen. 2019. Consistent Query Answering for Primary Keys in Logspace. In 22nd International Conference on Database Theory, ICDT 2019, March 26--28, 2019, Lisbon, Portugal (LIPIcs), Pablo Barceló and Marco Calautti (Eds.), Vol. 127. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 23:1--23:19. https://doi.org/10.4230/LIPIcs.ICDT.2019.23
[17]
Paraschos Koutris and Jef Wijsen. 2020 a. Consistent Query Answering for Primary Keys in Datalog. Theory of Computing Systems (2020), 1--57. https://doi.org/10.1007/s00224-020-09985--6
[18]
Paraschos Koutris and Jef Wijsen. 2020 b. First-Order Rewritability in Consistent Query Answering with Respect to Multiple Keys. In Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2020, Portland, OR, USA, June 14--19, 2020, Dan Suciu, Yufei Tao, and Zhewei Wei (Eds.). ACM, 113--129. https://doi.org/10.1145/3375395.3387654
[19]
Nicola Leone, Gerald Pfeifer, Wolfgang Faber, Thomas Eiter, Georg Gottlob, Simona Perri, and Francesco Scarcello. 2006. The DLV system for knowledge representation and reasoning. ACM Trans. Comput. Log., Vol. 7, 3 (2006), 499--562. https://doi.org/10.1145/1149114.1149117
[20]
Mónica Caniupán Marileo and Leopoldo E. Bertossi. 2010. The consistency extractor system: Answer set programs for consistent query answering in databases. Data Knowl. Eng., Vol. 69, 6 (2010), 545--572. https://doi.org/10.1016/j.datak.2010.01.005
[21]
Jef Wijsen. 2012. Certain conjunctive query answering in first-order logic. ACM Trans. Database Syst., Vol. 37, 2 (2012), 9:1--9:35. https://doi.org/10.1145/2188349.2188351
[22]
Jef Wijsen. 2019. Foundations of Query Answering on Inconsistent Databases. SIGMOD Rec., Vol. 48, 3 (2019), 6--16. https://doi.org/10.1145/3377391.3377393

Cited By

View all
  • (2024)Computing Range Consistent Answers to Aggregation Queries via RewritingProceedings of the ACM on Management of Data10.1145/36958362:5(1-19)Online publication date: 7-Nov-2024
  • (2023)LinCQA: Faster Consistent Query Answering with Linear Time GuaranteesProceedings of the ACM on Management of Data10.1145/35887181:1(1-25)Online publication date: 30-May-2023
  • (2022)A Dichotomy in Consistent Query Answering for Primary Keys and Unary Foreign KeysProceedings of the 41st ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3517804.3524157(437-449)Online publication date: 12-Jun-2022

Index Terms

  1. Optimization of Answer Set Programs for Consistent Query Answering by Means of First-Order Rewriting

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      CIKM '20: Proceedings of the 29th ACM International Conference on Information & Knowledge Management
      October 2020
      3619 pages
      ISBN:9781450368599
      DOI:10.1145/3340531
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 19 October 2020

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. answer set programming
      2. conjunctive queries
      3. consistent query answering
      4. database repairing
      5. first-order rewriting
      6. primary keys

      Qualifiers

      • Research-article

      Conference

      CIKM '20
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 1,861 of 8,427 submissions, 22%

      Upcoming Conference

      CIKM '25

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)7
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 17 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Computing Range Consistent Answers to Aggregation Queries via RewritingProceedings of the ACM on Management of Data10.1145/36958362:5(1-19)Online publication date: 7-Nov-2024
      • (2023)LinCQA: Faster Consistent Query Answering with Linear Time GuaranteesProceedings of the ACM on Management of Data10.1145/35887181:1(1-25)Online publication date: 30-May-2023
      • (2022)A Dichotomy in Consistent Query Answering for Primary Keys and Unary Foreign KeysProceedings of the 41st ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems10.1145/3517804.3524157(437-449)Online publication date: 12-Jun-2022

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media