Deciding SHACL Shape Containment Through Description Logics Reasoning

  • Martin LeinbergerEmail author
  • Philipp Seifer
  • Tjitze Rienstra
  • Ralf Lämmel
  • Steffen Staab
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 12506)


The Shapes Constraint Language (SHACL) allows for formalizing constraints over RDF data graphs. A shape groups a set of constraints that may be fulfilled by nodes in the RDF graph. We investigate the problem of containment between SHACL shapes. One shape is contained in a second shape if every graph node meeting the constraints of the first shape also meets the constraints of the second. To decide shape containment, we map SHACL shape graphs into description logic axioms such that shape containment can be answered by description logic reasoning. We identify several, increasingly tight syntactic restrictions of SHACL for which this approach becomes sound and complete.



The authors gratefully acknowledge the financial support of project LISeQ (LA 2672/1-1) by the German Research Foundation (DFG).


  1. 1.
    Abbas, A., Genevès, P., Roisin, C., Layaïda, N.: SPARQL query containment with ShEx constraints. In: Kirikova, M., Nørvåg, K., Papadopoulos, G.A. (eds.) ADBIS 2017. LNCS, vol. 10509, pp. 343–356. Springer, Cham (2017). Scholar
  2. 2.
    Akhtar, W., Cortés-Calabuig, Á., Paredaens, J.: Constraints in RDF. In: Schewe, K.-D., Thalheim, B. (eds.) SDKB 2010. LNCS, vol. 6834, pp. 23–39. Springer, Heidelberg (2011). Scholar
  3. 3.
    Baader, F., Calvanese, D., McGuinness, D.L., Nardi, D., Patel-Schneider, P.F. (eds.): The Description Logic Handbook: Theory, Implementation, and Applications. Cambridge University Press, Cambridge (2003)Google Scholar
  4. 4.
    Baader, F., Horrocks, I., Lutz, C., Sattler, U.: An Introduction to Description Logic. Cambridge University Press, New York (2017)CrossRefGoogle Scholar
  5. 5.
    Beneventano, D., Bergamaschi, S., Sartori, C.: Semantic query optimization by subsumption in OODB. In: Proceedings of the Flexible Query-Answering Systems (FQAS), pp. 167–187. Roskilde University (1996)Google Scholar
  6. 6.
    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
  7. 7.
    Calvanese, D.: Finite model reasoning in description logics. In: Proceedings of the KR, pp. 292–303. Morgan Kaufmann (1996)Google Scholar
  8. 8.
    Chaudhuri, S., Vardi, M.: Optimization of real conjunctive queries. In: Proceedings of the PODS, pp. 59–70. ACM (1993)Google Scholar
  9. 9.
    Corman, J., Florenzano, F., Reutter, J.L., Savković, O.: Validating Shacl constraints over a Sparql endpoint. In: Ghidini, C., Hartig, O., Maleshkova, M., Svátek, V., Cruz, I., Hogan, A., Song, J., Lefrançois, M., Gandon, F. (eds.) ISWC 2019. LNCS, vol. 11778, pp. 145–163. Springer, Cham (2019). Scholar
  10. 10.
    Corman, J., Reutter, J.L., Savković, O.: Semantics and validation of recursive SHACL. In: Vrandečić, D., Bontcheva, K., Suárez-Figueroa, M.C., Presutti, V., Celino, I., Sabou, M., Kaffee, L.-A., Simperl, E. (eds.) ISWC 2018. LNCS, vol. 11136, pp. 318–336. Springer, Cham (2018). Scholar
  11. 11.
    Donini, F.M., Nardi, D., Rosati, R.: Description logics of minimal knowledge and negation as failure. ACM TOCL 3(2), 177–225 (2002)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Fischer, P.M., Lausen, G., Schätzle, A., Schmidt, M.: RDF constraint checking. In: Proceedings of the EDBT/ICDT, pp. 205–212. (2015)Google Scholar
  13. 13.
    Grandi, F.: On expressive description logics with composition of roles in number restrictions. In: Baaz, M., Voronkov, A. (eds.) LPAR 2002. LNCS (LNAI), vol. 2514, pp. 202–215. Springer, Heidelberg (2002). Scholar
  14. 14.
    Kazakov, Y.: RIQ and SROIQ are harder than SHOIQ. In: Proceedings of the KR, pp. 274–284. AAAI Press (2008)Google Scholar
  15. 15.
    Klug, A.: On conjunctive queries containing inequalities. J. ACM 35, 146–160 (1988)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Leinberger, M., Seifer, P., Schon, C., Lämmel, R., Staab, S.: Type checking program code using SHACL. In: Ghidini, C., Hartig, O., Maleshkova, M., Svátek, V., Cruz, I., Hogan, A., Song, J., Lefrançois, M., Gandon, F. (eds.) ISWC 2019. LNCS, vol. 11778, pp. 399–417. Springer, Cham (2019). Scholar
  17. 17.
    Lutz, C., Areces, C., Horrocks, I., Sattler, U.: Keys, nominals, and concrete domains. J. Artif. Intell. Res. 23, 667–726 (2004)MathSciNetzbMATHGoogle Scholar
  18. 18.
    Motik, B., Horrocks, I., Sattler, U.: Adding integrity constraints to OWL. In: Proceedings of the OWLED. CEUR Workshop Proceedings, vol. 258. (2007)Google Scholar
  19. 19.
    Pareti, P., Konstantinidis, G., Magavero, F., Norman, T.J.: SHACL satisfiability and containment. In: Proceedings of the ISWC. LNCS. Springer (2020)Google Scholar
  20. 20.
    Patel-Schneider, P.F., Franconi, E.: Ontology constraints in incomplete and complete data. In: Cudré-Mauroux, P., Heflin, J., Sirin, E., Tudorache, T., Euzenat, J., Hauswirth, M., Parreira, J.X., Hendler, J., Schreiber, G., Bernstein, A., Blomqvist, E. (eds.) ISWC 2012. LNCS, vol. 7649, pp. 444–459. Springer, Heidelberg (2012). Scholar
  21. 21.
    Rudolph, S.: Foundations of description logics. In: Polleres, A., et al. (eds.) Reasoning Web 2011. LNCS, vol. 6848, pp. 76–136. Springer, Heidelberg (2011). Scholar
  22. 22.
    Staworko, S., Wieczorek, P.: Containment of shape expression schemas for RDF. In: Proceedings of the PODS, pp. 303–319. ACM (2019)Google Scholar
  23. 23.
    Tao, J., Sirin, E., Bao, J., McGuinness, D.L.: Integrity constraints in OWL. In: Proceedings of the AAAI. AAAI Press (2010)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.Institute for Web Science and Technologies, University of Koblenz-LandauKoblenzGermany
  2. 2.The Software Languages TeamUniversity of Koblenz-LandauKoblenzGermany
  3. 3.Institute for Parallel and Distributed SystemsUniversity of StuttgartStuttgartGermany
  4. 4.Web and Internet Science Research Group, University of SouthamptonSouthamptonEngland

Personalised recommendations