Validating Shacl Constraints over a Sparql Endpoint

  • Julien CormanEmail author
  • Fernando Florenzano
  • Juan L. Reutter
  • Ognjen Savković
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11778)


shacl (Shapes Constraint Language) is a specification for describing and validating RDF graphs that has recently become a W3C recommendation. While the language is gaining traction in the industry, algorithms for shacl constraint validation are still at an early stage. A first challenge comes from the fact that RDF graphs are often exposed as sparql endpoints, and therefore only accessible via queries. Another difficulty is the absence of guidelines about the way recursive constraints should be handled. In this paper, we provide algorithms for validating a graph against a shacl schema, which can be executed over a sparql endpoint. We first investigate the possibility of validating a graph through a single query for non-recursive constraints. Then for the recursive case, since the problem has been shown to be NP-hard, we propose a strategy that consists in evaluating a small number of sparql queries over the endpoint, and using the answers to build a set of propositional formulas that are passed to a SAT solver. Finally, we show that the process can be optimized when dealing with recursive but tractable fragments of shacl, without the need for an external solver. We also present a proof-of-concept evaluation of this last approach.


  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
    Source code and experiment’s material.
  7. 7.
  8. 8.
  9. 9.
    Boneva, I., Labra Gayo, J.E., Prud’hommeaux, E.G.: Semantics and validation of shapes schemas for RDF. In: ISWC 2017Google 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.
    Corman, J., Reutter, J.L., Savković, O.: Semantics and validation of recursive SHACL (extended version). Technical report KRDB18-1, Free University Bozen-Bolzano (2018). Scholar
  12. 12.
    Corman, J., Reutter, J.L., Savković, O.: A tractable notion of stratification for SHACL. In: ISWC 2018Google Scholar
  13. 13.
    Kontokostas, D., et al.: Test-driven evaluation of linked data quality. In: WWW (2014)Google Scholar
  14. 14.
    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
  15. 15.
    Reutter, J.L., Soto, A., Vrgoč, D.: Recursion in SPARQL. In: Arenas, M., et al. (eds.) ISWC 2015. LNCS, vol. 9366, pp. 19–35. Springer, Cham (2015). Scholar
  16. 16.
    Staworko, S., Boneva, I., Labra Gayo, J.E., Hym, S., Prud’hommeaux, E.G., Solbrig, H.: Complexity and expressiveness of ShEx for RDF. In: ICDT (2015)Google Scholar
  17. 17.
    Tao, J., Sirin, E., Bao, J., McGuinness, D.L.: Integrity constraints in owl. In: AAAI (2010)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • Julien Corman
    • 1
    Email author
  • Fernando Florenzano
    • 2
  • Juan L. Reutter
    • 2
  • Ognjen Savković
    • 1
  1. 1.Free University of Bozen-BolzanoBolzanoItaly
  2. 2.PUC Chile and IMFDSantiagoChile

Personalised recommendations