Validation of SHACL Constraints over KGs with OWL 2 QL Ontologies via Rewriting

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11503)


Constraints have traditionally been used to ensure data quality. Recently, several constraint languages such as SHACL, as well as mechanisms for constraint validation, have been proposed for Knowledge Graphs (KGs). KGs are often enhanced with ontologies that define relevant background knowledge in a formal language such as OWL 2 QL. However, existing systems for constraint validation either ignore these ontologies, or compile ontologies and constraints into rules that should be executed by some rule engine. In the latter case, one has to rely on different systems when validating constrains over KGs and over ontology-enhanced KGs. In this work, we address this problem by defining rewriting techniques that allow to compile an OWL 2 QL ontology and a set of SHACL constraints into another set of SHACL constraints. We show that in the general case the rewriting may not exists, but it always exists for the positive fragment of SHACL. Our rewriting techniques allow to validate constraints over KGs with and without ontologies using the same SHACL validation engines.



This work was partially funded by the SIRIUS Centre, Norwegian Research Council project number 237898; by the Free University of Bozen-Bolzano projects QUEST, ROBAST and ADVANCED4KG.


  1. 1.
    Freebase: an open, shared database of the world’s knowledge.
  2. 2.
  3. 3.
    W3C: OWL 2 Web Ontology Language.
  4. 4.
    Abiteboul, S., Buneman, P., Suciu, D.: Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufmann, Burlington (1999)Google Scholar
  5. 5.
    Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Boston (1995)zbMATHGoogle Scholar
  6. 6.
    Arenas, M., Grau, B.C., Kharlamov, E., Marciuska, S., Zheleznyakov, D.: Faceted search over RDF-based knowledge graphs. J. Web Semant. 37–38, 55–74 (2016)CrossRefGoogle Scholar
  7. 7.
    Arenas, M., Gutiérrez, C., Pérez, J.: Foundations of RDF databases. In: Tessaris, S., et al. (eds.) Reasoning Web 2009. LNCS, vol. 5689, pp. 158–204. Springer, Heidelberg (2009). Scholar
  8. 8.
    Boneva, I., Labra Gayo, J.E., Prud’hommeaux, E.G.: Semantics and validation of shapes schemas for RDF. In: d’Amato, C., et al. (eds.) ISWC 2017. LNCS, vol. 10587, pp. 104–120. Springer, Cham (2017). Scholar
  9. 9.
    Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Rosati, R.: Tractable reasoning and efficient query answering in description logics: the DL-Lite family. JAR 39, 385–429 (2007)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Calvanese, D., Kharlamov, E., Nutt, W., Zheleznyakov, D.: Evolution of DLLite knowledge bases. In: Patel-Schneider, P.F., et al. (eds.) ISWC 2010. LNCS, vol. 6496, pp. 112–128. Springer, Heidelberg (2010). Scholar
  11. 11.
    Cheng, G., Kharlamov, E.: Towards a semantic keyword search over industrial knowledge graphs (extended abstract). In: IEEE Big Data, pp. 1698–1700 (2017)Google Scholar
  12. 12.
    Corman, J., Reutter, J.L., Savković, O.: Semantics and validation of recursive SHACL. In: Vrandečić, D., et al. (eds.) ISWC 2018. LNCS, vol. 11136, pp. 318–336. Springer, Cham (2018). Scholar
  13. 13.
    Corman, J., Reutter, J.L., Savkovic, O.: Semantics and validation of recursive SHACL (extended version). Technical report KRDB18-1, KRDB Research Center, Free University of Bozen-Bolzano (2018). Scholar
  14. 14.
    Dantsin, E., Eiter, T., Gottlob, G., Voronkov, A.: Complexity and expressive power of logic programming. ACM Comput. Surv. 33(3), 374–425 (2001)CrossRefGoogle Scholar
  15. 15.
    Ekaputra, F.J., Lin, X.: SHACL4p: SHACL constraints validation within Protégé ontology editor. In: ICoDSE (2016)Google Scholar
  16. 16.
    Fan, W., Fan, Z., Tian, C., Dong, X.L.: Keys for graphs. PVLDB 8(12), 1590–1601 (2015)Google Scholar
  17. 17.
    Fan, W., Wu, Y., Xu, J.: Functional dependencies for graphs. In: SIGMOD, pp. 1843–1857 (2016)Google Scholar
  18. 18.
    Hansen, P., Lutz, C., Seylan, I., Wolter, F.: Efficient query rewriting in the description logic EL and beyond. In: IJCAI, pp. 3034–3040 (2015)Google Scholar
  19. 19.
    Horrocks, I., Giese, M., Kharlamov, E., Waaler, A.: Using semantic technology to tame the data variety challenge. IEEE Internet Comput. 20(6), 62–66 (2016)CrossRefGoogle Scholar
  20. 20.
    Kharlamov, E., et al.: Capturing industrial information models with ontologies and constraints. In: Groth, P., et al. (eds.) ISWC 2016. LNCS, vol. 9982, pp. 325–343. Springer, Cham (2016). Scholar
  21. 21.
    Kharlamov, E., et al.: SOMM: industry oriented ontology management tool. In: ISWC Posters & Demos (2016)Google Scholar
  22. 22.
    Kharlamov, E., et al.: Ontology based data access in Statoil. J. Web Semant. 44, 3–36 (2017)CrossRefGoogle Scholar
  23. 23.
    Kharlamov, E., et al.: Semantic access to streaming and static data at Siemens. J. Web Semant. 44, 54–74 (2017)CrossRefGoogle Scholar
  24. 24.
    Kharlamov, E., Martín-Recuerda, F., Perry, B., Cameron, D., Fjellheim, R., Waaler, A.: Towards semantically enhanced digital twins. In: IEEE Big Data, pp. 4189–4193 (2018)Google Scholar
  25. 25.
    Kharlamov, E., et al.: Towards simplification of analytical workflows with semantics at Siemens (extended abstract). In: IEEE Big Data, pp. 1951–1954 (2018)Google Scholar
  26. 26.
    Kharlamov, E., et al.: Diagnostics of trains with semantic diagnostics rules. In: Riguzzi, F., Bellodi, E., Zese, R. (eds.) ILP 2018. LNCS (LNAI), vol. 11105, pp. 54–71. Springer, Cham (2018). Scholar
  27. 27.
    Kharlamov, E., et al.: Semantic rules for machine diagnostics: execution and management. In: CIKM, pp. 2131–2134 (2017)Google Scholar
  28. 28.
    Kharlamov, E., et al.: Finding data should be easier than finding oil. In: IEEE Big Data, pp. 1747–1756 (2018)Google Scholar
  29. 29.
    Kharlamov, E., Zheleznyakov, D.: Capturing instance level ontology evolution for DL-Lite. In: Aroyo, L., et al. (eds.) ISWC 2011. LNCS, vol. 7031, pp. 321–337. Springer, Heidelberg (2011). Scholar
  30. 30.
    Kharlamov, E., Zheleznyakov, D., Calvanese, D.: Capturing model-based ontology evolution at the instance level: the case of DL-Lite. J. Comput. Syst. Sci. 79(6), 835–872 (2013)MathSciNetCrossRefGoogle Scholar
  31. 31.
    Knublauch, H., Ryman, A.: Shapes constraint language (SHACL). W3C Recommendation, vol. 11, no. 8 (2017)Google Scholar
  32. 32.
    König, M., Leclère, M., Mugnier, M., Thomazo, M.: Sound, complete and minimal UCQ-rewriting for existential rules. Semant. Web 6(5), 451–475 (2015)CrossRefGoogle Scholar
  33. 33.
    Mehdi, G., et al.: Semantic rule-based equipment diagnostics. In: d’Amato, C., et al. (eds.) ISWC 2017. LNCS, vol. 10588, pp. 314–333. Springer, Cham (2017). Scholar
  34. 34.
    Mehdi, G., et al.: SemDia: semantic rule-based equipment diagnostics tool. In: CIKM, pp. 2507–2510 (2017)Google Scholar
  35. 35.
    Motik, B., Horrocks, I., Sattler, U.: Bridging the gap between OWL and relational databases. Web Semant. Sci. Serv. Agents World Wide Web 7(2), 74–89 (2009)CrossRefGoogle Scholar
  36. 36.
    Patel-Schneider, P.F.: Using description logics for RDF constraint checking and closed-world recognition. In: AAAI (2015)Google Scholar
  37. 37.
    Ringsquandl, M., et al.: On event-driven knowledge graph completion in digital factories. In: IEEE Big Data, pp. 1676–1681 (2017)Google Scholar
  38. 38.
    Savkovic, O., Calvanese, D.: Introducing datatypes in DL-Lite. In: ECAI, pp. 720–725 (2012)Google Scholar
  39. 39.
    Savković, O., et al.: Semantic diagnostics of smart factories. In: Ichise, R., Lecue, F., Kawamura, T., Zhao, D., Muggleton, S., Kozaki, K. (eds.) JIST 2018. LNCS, vol. 11341, pp. 277–294. Springer, Cham (2018). Scholar
  40. 40.
    Soylu, A., et al.: OptiqueVQS: a visual query system over ontologies for industry. Semant. Web 9(5), 627–660 (2018)CrossRefGoogle Scholar
  41. 41.
    Suchanek, F.M., Kasneci, G., Weikum, G.: YAGO: a core of semantic knowledge. In: Proceedings of WWW, pp. 697–706 (2007)Google Scholar
  42. 42.
    Tao, J., Sirin, E., Bao, J., McGuinness, D.L.: Integrity constraints in OWL. In: AAAI (2010)Google Scholar
  43. 43.
    Zheleznyakov, D., Kharlamov, E., Horrocks, I.: Trust-sensitive evolution of DL-Lite knowledge bases. In: AAAI, pp. 1266–1273 (2017)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

Authors and Affiliations

  1. 1.Free University of Bozen-BolzanoBolzanoItaly
  2. 2.University of OsloOsloNorway
  3. 3.Bosch Centre for Artificial IntelligenceRobert Bosch GmbHRenningenGermany
  4. 4.Siemens CT, Siemens AGMunichGermany

Personalised recommendations