SHACL Constraints with Inference Rules

  • Paolo ParetiEmail author
  • George Konstantinidis
  • Timothy J. Norman
  • Murat Şensoy
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11778)


The Shapes Constraint Language (SHACL) has been recently introduced as a W3C recommendation to define constraints that can be validated against RDF graphs. Interactions of SHACL with other Semantic Web technologies, such as ontologies or reasoners, is a matter of ongoing research. In this paper we study the interaction of a subset of SHACL with inference rules expressed in datalog. On the one hand, SHACL constraints can be used to define a “schema” for graph datasets. On the other hand, inference rules can lead to the discovery of new facts that do not match the original schema. Given a set of SHACL constraints and a set of datalog rules, we present a method to detect which constraints could be violated by the application of the inference rules on some graph instance of the schema, and update the original schema, i.e, the set of SHACL constraints, in order to capture the new facts that can be inferred. We provide theoretical and experimental results of the various components of our approach.



This work was supported by an Institutional Links grant, ID 333778, under the Newton-Katip Çelebi Fund. The grant is funded by the UK Department for Business, Energy and Industrial Strategy and the Scientific and Technological Research Council of Turkey (TUBITAK) under grant 116E918, and delivered by the British Council.


  1. 1.
    Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases: The Logical Level. Addison-Wesley Longman Publishing Co., Inc. (1995)Google Scholar
  2. 2.
    Baget, J.F., Leclère, M., Mugnier, M.L., Salvat, E.: On rules with existential variables: walking the decidability line. Artif. Intell. 175(9–10), 1620–1654 (2011)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Bassiliades, N.: SWRL2SPIN: a tool for transforming SWRL rule bases in OWL ontologies to object-oriented SPIN rules. CoRR (2018).
  4. 4.
    Benedikt, M., et al.: Benchmarking the chase. In: Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, pp. 37–52. ACM (2017)Google Scholar
  5. 5.
    Calvanese, D., et al.: Ontologies and databases: the DL-Lite approach. In: Tessaris, S., et al. (eds.) Reasoning Web 2009. LNCS, vol. 5689, pp. 255–356. Springer, Heidelberg (2009). Scholar
  6. 6.
    Ceri, S., Gottlob, G., Tanca, L.: What you always wanted to know about datalog (and never dared to ask). IEEE Trans. Knowl. Data Eng. 1(1), 146–166 (1989)CrossRefGoogle Scholar
  7. 7.
    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
  8. 8.
    Fagin, R., Kolaitis, P.G., Miller, R.J., Popa, L.: Data exchange: semantics and query answering. Theor. Comput. Sci. 336(1), 89–124 (2005)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Glimm, B., Kazakov, Y., Liebig, T., Tran, T.K., Vialard, V.: Abstraction refinement for ontology materialization. In: International Semantic Web Conference, pp. 180–195 (2014)CrossRefGoogle Scholar
  10. 10.
    Knublauch, H., Kontokostas, D.: Shapes constraint language (SHACL). In: W3C Recommendation, W3C (2017).
  11. 11.
    Kontokostas, D., et al.: Test-driven evaluation of linked data quality. In: Proceedings of the 23rd International Conference on World Wide Web, WWW 2014, pp. 747–758. ACM (2014)Google Scholar
  12. 12.
    Lefrançois, M., Cox, S., Taylor, K., Haller, A., Janowicz, K., Phuoc, D.L.: Semantic sensor network ontology. In: W3C Recommendation, W3C (2017).
  13. 13.
    Marnette, B.: Generalized schema-mappings: from termination to tractability. In: Proceedings of the Twenty-Tighth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 13–22. ACM (2009)Google Scholar
  14. 14.
    Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 16:1–16:45 (2009)CrossRefGoogle Scholar
  15. 15.
    Prud’hommeaux, E., Labra Gayo, J.E., Solbrig, H.: Shape expressions: an RDF validation and transformation language. In: Proceedings of the 10th International Conference on Semantic Systems, SEM 2014, pp. 32–40. ACM (2014)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Paolo Pareti
    • 1
    Email author
  • George Konstantinidis
    • 1
  • Timothy J. Norman
    • 1
  • Murat Şensoy
    • 2
  1. 1.University of SouthamptonSouthamptonUK
  2. 2.Özyeğin UniversityIstanbulTurkey

Personalised recommendations