Checking the Data Complexity of Ontology-Mediated Queries: A Case Study with Non-uniform CSPs and Polyanna

  • Olga GerasimovaEmail author
  • Stanislav Kikot
  • Michael Zakharyaschev
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11560)


It has recently been shown that first-order- and datalog-rewritability of ontology-mediated queries (OMQs) with expressive ontologies can be checked in NExpTime using a reduction to CSPs. In this paper, we present a case study for OMQs with Boolean conjunctive queries and a fixed ontology consisting of a single covering axiom \(A \sqsubseteq F \sqcup T\), possibly supplemented with a disjointness axiom for T and F. The ultimate aim is to classify such OMQs according to their data complexity: \(\textsc {AC}^0\), L, NL, P or coNP. We report on our experience with trying to distinguish between OMQs in P and coNP using the reduction to CSPs and the Polyanna software for finding polymorphisms.



The work of O. Gerasimova and M. Zakharyaschev was carried out at the National Research University Higher School of Economics and supported by the Russian Science Foundation under grant 17-11-01294. We are grateful to Peter Jeavons and Standa Živný for helpful discussions of Polyanna and arc consistency.


  1. 1.
    Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)zbMATHGoogle Scholar
  2. 2.
    Afrati, F.N., Gergatsoulis, M., Toni, F.: Linearisability on datalog programs. Theor. Comput. Sci. 308(1–3), 199–226 (2003). Scholar
  3. 3.
    Arora, S., Barak, B.: Computational Complexity: A Modern Approach, 1st edn. Cambridge University Press, New York (2009)CrossRefGoogle Scholar
  4. 4.
    Baader, F., Horrocks, I., Lutz, C., Sattler, U.: An Introduction to Description Logic. Cambridge University Press, Cambridge (2017). Scholar
  5. 5.
    Barto, L., Krokhin, A., Willard, R.: Polymorphisms, and how to use them. In: Dagstuhl Follow-Ups. vol. 7. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2017)Google Scholar
  6. 6.
    Benedikt, M., ten Cate, B., Colcombet, T., Vanden Boom, M.: The complexity of boundedness for guarded logics. In: 30th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2015, Kyoto, Japan, 6–10 July 2015, pp. 293–304. IEEE Computer Society (2015).
  7. 7.
    Benedikt, M., Grau, B.C., Kostylev, E.V.: Logical foundations of information disclosure in ontology-based data integration. Artif. Intell. 262, 52–95 (2018). Scholar
  8. 8.
    Bienvenu, M., ten Cate, B., Lutz, C., Wolter, F.: Ontology-based data access: a study through disjunctive datalog, CSP, and MMSNP. ACM Trans. Database Syst. 39(4), 33:1–33:44 (2014)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Bulatov, A.A.: A dichotomy theorem for nonuniform CSPs. In: Umans, C. (ed.) 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, 15–17 October 2017, pp. 319–330. IEEE Computer Society (2017).
  10. 10.
    Calvanese, D., et al.: The MASTRO system for ontology-based data access. Semant. Web 2(1), 43–53 (2011)Google Scholar
  11. 11.
    Calvanese, D., et al.: Ontop: answering SPARQL queries over relational databases. Semant. Web 8(3), 471–487 (2017)CrossRefGoogle Scholar
  12. 12.
    Cosmadakis, S.S., Gaifman, H., Kanellakis, P.C., Vardi, M.Y.: Decidable optimization problems for database logic programs (preliminary report). In: STOC, pp. 477–490 (1988)Google Scholar
  13. 13.
    Gault, R., Jeavons, P.: Implementing a test for tractability. Constraints 9(2), 139–160 (2004)MathSciNetCrossRefGoogle Scholar
  14. 14.
    Gerasimova, O., Kikot, S., Podolskii, V., Zakharyaschev, M.: More on the data complexity of answering ontology-mediated queries with a covering axiom. In: Różewski, P., Lange, C. (eds.) KESW 2017. CCIS, vol. 786, pp. 143–158. Springer, Cham (2017). Scholar
  15. 15.
    Gerasimova, O., Kikot, S., Podolskii, V.V., Zakharyaschev, M.: On the data complexity of ontology-mediated queries with a covering axiom. In: Artale, A., Glimm, B., Kontchakov, R. (eds.) Proceedings of the 30th International Workshop on Description Logics. CEUR Workshop Proceedings, Montpellier, France, 18–21 July 2017, vol. 1879. (2017).
  16. 16.
    Gerasimova, O., Kikot, S., Zakharyaschev, M.: Towards a data complexity classification of ontology-mediated queries with covering. In: Ortiz, M., Schneider, T. (eds.) Proceedings of the 31st International Workshop on Description Logics co-located with 16th International Conference on Principles of Knowledge Representation and Reasoning (KR 2018), Tempe, Arizona, US. CEUR Workshop Proceedings, 27–29 October 2018, vol. 2211. (2018).
  17. 17.
    Hernich, A., Lutz, C., Ozaki, A., Wolter, F.: as a description logic. In: Calvanese, D., Konev, B. (eds.) Proceedings of the 28th International Workshop on Description Logics. CEUR Workshop Proceedings, Athens, Greece, 7–10 June 2015, vol. 1350. (2015).
  18. 18.
    Jeavons, P., Cohen, D., Gyssens, M.: A test for tractability. In: Freuder, E.C. (ed.) CP 1996. LNCS, vol. 1118, pp. 267–281. Springer, Heidelberg (1996). Scholar
  19. 19.
    Kaminski, M., Nenov, Y., Grau, B.C.: Datalog rewritability of disjunctive datalog programs and non-Horn ontologies. Artif. Intell. 236, 90–118 (2016). Scholar
  20. 20.
    Kharlamov, E., et al.: Ontology based data access in Statoil. J. Web Semant. 44, 3–36 (2017). Scholar
  21. 21.
    Kozik, M.: Weak consistency notions for all the CSPs of bounded width. In: Grohe, M., Koskinen, E., Shankar, N. (eds.) Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2016, New York, NY, USA, 5–8 July 2016, pp. 633–641. ACM (2016).
  22. 22.
    Lanti, D., Rezk, M., Xiao, G., Calvanese, D.: The NPD benchmark: reality check for OBDA systems. In: Alonso, G., et al. (eds.) Proceedings of the 18th International Conference on Extending Database Technology, EDBT 2015, Brussels, Belgium, 23–27 March 2015, pp. 617–628. (2015).
  23. 23.
    Lutz, C., Sabellek, L.: Ontology-mediated querying with the description logic EL: trichotomy and linear datalog rewritability. In: Sierra, C. (ed.) Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, 19–25 August 2017, pp. 1181–1187. (2017).
  24. 24.
    Lutz, C., Wolter, F.: Non-uniform data complexity of query answering in description logics. In: Brewka, G., Eiter, T., McIlraith, S.A. (eds.) Principles of Knowledge Representation and Reasoning: Proceedings of the Thirteenth International Conference, KR 2012, Rome, Italy, 10–14 June 2012. AAAI Press (2012).
  25. 25.
    Lutz, C., Wolter, F.: The data complexity of description logic ontologies. Log. Methods Comput. Sci. 13(4) (2017).
  26. 26.
    Marcinkowski, J.: DATALOG SIRUPs uniform boundedness is undecidable. In: Proceedings, 11th Annual IEEE Symposium on Logic in Computer Science, New Brunswick, New Jersey, USA, 27–30 July 1996, pp. 13–24. IEEE Computer Society (1996).
  27. 27.
    Papadimitriou, C.: Computational Complexity. Addison-Wesley, Boston (1994)zbMATHGoogle Scholar
  28. 28.
    Poggi, A., Lembo, D., Calvanese, D., De Giacomo, G., Lenzerini, M., Rosati, R.: Linking data to ontologies. In: Spaccapietra, S. (ed.) Journal on Data Semantics X. LNCS, vol. 4900, pp. 133–173. Springer, Heidelberg (2008). Scholar
  29. 29.
    Ramakrishnan, R., Sagiv, Y., Ullman, J.D., Vardi, M.Y.: Proof-tree transformation theorems and their applications. In: Proceedings of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, pp. 172–181. ACM (1989)Google Scholar
  30. 30.
    Rodríguez-Muro, M., Kontchakov, R., Zakharyaschev, M.: Ontology-based data access: Ontop of databases. In: Alani, H., et al. (eds.) ISWC 2013. LNCS, vol. 8218, pp. 558–573. Springer, Heidelberg (2013). Scholar
  31. 31.
    Saraiya, Y.P.: Linearizing nonlinear recursions in polynomial time. In: Silberschatz, A. (ed.) Proceedings of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, Philadelphia, Pennsylvania, USA, 29–31 March 1989, pp. 182–189. ACM Press (1989).
  32. 32.
    Schaerf, A.: On the complexity of the instance checking problem in concept languages with existential quantification. J. Intell. Inf. Syst. 2, 265–278 (1993)CrossRefGoogle Scholar
  33. 33.
    Ullman, J.D., Gelder, A.V.: Parallel complexity of logical query programs. Algorithmica 3, 5–42 (1988). Scholar
  34. 34.
    Vardi, M.Y.: Decidability and undecidability results for boundedness of linear recursive queries. In: Edmondson-Yurkanan, C., Yannakakis, M. (eds.) Proceedings of the Seventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, Austin, Texas, USA, 21–23 March 1988, pp. 341–351. ACM (1988).
  35. 35.
    Xiao, G., et al.: Ontology-based data access: a survey. In: Lang, J. (ed.) Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, Stockholm, Sweden, 13–19 July 2018, pp. 5511–5519. (2018).
  36. 36.
    Zhang, W., Yu, C.T., Troy, D.: Necessary and sufficient conditions to linearize double recursive programs in logic databases. ACM Trans. Database Syst. 15(3), 459–482 (1990). Scholar
  37. 37.
    Zhuk, D.: A proof of CSP dichotomy conjecture. In: Umans, C. (ed.) 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, 15–17 October 2017, pp. 331–342. IEEE Computer Society (2017).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Olga Gerasimova
    • 1
    Email author
  • Stanislav Kikot
    • 2
  • Michael Zakharyaschev
    • 3
  1. 1.National Research University Higher School of EconomicsMoscowRussia
  2. 2.University of OxfordOxfordUK
  3. 3.Birkbeck, University of LondonLondonUK

Personalised recommendations