ABSTRACT
SHACL (SHape Constraint Language) is a W3C recommendation for validating graph-based data against a set of constraints (called shapes). Importantly, SHACL allows to define recursive shapes, i.e. a shape may refer to itself, directly of indirectly. The recommendation left open the semantics of recursive shapes, but proposals have emerged recently to extend the official semantics to support recursion. These proposals are based on the principle of possibility (or non-contradiction): a graph is considered valid against a schema if one can assign shapes to nodes in such a way that all constraints are satisfied. This semantics is not constructive, as it does not provide guidelines about how to obtain such an assignment, and it may lead to unfounded assignments, where the only reason to assign a shape to a node is that it allows validating the graph.
In contrast, we propose in this paper a stricter, more constructive semantics for SHACL, based on stable models, which are well-known in Answer Set Programming (ASP). This semantics additionally requires a shape assignment to be properly justified by the input constraints. We further exploit the connection to logic programming, and show that SHACL constraints can be naturally represented as logic programs, and that the validation problem for a graph and a SHACL schema can be encoded as an ASP reasoning task. The proposed semantics also enjoys computationally tractable validation in the presence of constraints with stratified negation (as opposed to the previous semantics). We also extend our semantics to 3-valued stable models, which yields a more relaxed notion of validation, tolerant to certain faults in the schema or data. By exploiting a connection between 3-valued stable model semantics and the well-founded semantics for logic programs, we can use our translation into ASP to show another tractability result. Finally, we provide a preliminary evaluation of the approach, which leverages an ASP solver to perform graph validation.
- 2017. Shapes constraint language (SHACL). Technical Report. W3C. https://www.w3.org/TR/shacl/ https://www.w3.org/TR/shacl.Google Scholar
- Serge Abiteboul, Peter Buneman, and Dan Suciu. 1999. Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufmann.Google Scholar
- Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of databases. Vol. 8. Addison-Wesley Reading.Google Scholar
- Giovanni Amendola, Thomas Eiter, Michael Fink, Nicola Leone, and João Moura. 2016. Semi-equilibrium models for paracoherent answer set programs. Artificial Intelligence 234 (2016). https://doi.org/10.1016/j.artint.2016.01.011Google Scholar
- Franz Baader, Diego Calvanese, Deborah McGuinness, Daniele Nardi, and Peter Patel-Schneider. 2003. The description logic handbook: theory, implementation and applications. Cambridge university press.Google ScholarDigital Library
- Chitta Baral. 2003. Knowledge Representation, Reasoning and Declarative Problem Solving. Cambridge University Press. https://doi.org/10.1017/CBO9780511543357Google ScholarDigital Library
- Chitta R. Baral and V. S. Subrahmanian. 1993. Dualities between alternative semantics for logic programming and nonmonotonic reasoning. Journal of Automated Reasoning 10, 3 (1993). https://doi.org/10.1007/BF00881799Google ScholarCross Ref
- Iovka Boneva, Jose Emilio Labra Gayo, and Eric G Prud’hommeaux. 2017. Semantics and Validation of Shapes Schemas for RDF. In ISWC.Google Scholar
- Julien Corman, Juan L. Reutter, and Ognjen Savkovic. 2018. Semantics and Validation of Recursive SHACL. In ISWC. https://doi.org/10.1007/978-3-030-00671-6_19Google Scholar
- Evgeny Dantsin, Thomas Eiter, Georg Gottlob, and Andrei Voronkov. 2001. Complexity and Expressive Power of Logic Programming. ACM Comput. Surv. 33, 3 (2001). https://doi.org/10.1145/502807.502810Google Scholar
- Francesco M Donini, Daniele Nardi, and Riccardo Rosati. 2002. Description logics of minimal knowledge and negation as failure. ACM Transactions on Computational Logic (TOCL) 3, 2 (2002).Google ScholarDigital Library
- T. Eiter, N. Leone, and D. Saccà. 1997. On the partial semantics for disjunctive deductive databases. Annals of Mathematics and Artificial Intelligence 19, 1-2(1997). https://www.scopus.com/inward/record.uri?eid=2-s2.0-0031507404&partnerID=40&md5=5648bd890145601e17552f9acde3d5dfGoogle ScholarDigital Library
- Fajar J Ekaputra and Xiashuo Lin. 2016. SHACL4P: SHACL constraints validation within Protégé ontology editor. In ICoDSE.Google Scholar
- Wenfei Fan, Zhe Fan, Chao Tian, and Xin Luna Dong. 2015. Keys for Graphs. PVLDB 8, 12 (2015).Google Scholar
- Wenfei Fan, Yinghui Wu, and Jingbo Xu. 2016. Functional Dependencies for Graphs. In SIGMOD.Google Scholar
- Michael Gelfond and Vladimir Lifschitz. 1988. The stable model semantics for logic programming.. In ICLP/SLP, Vol. 88.Google Scholar
- Boris Motik, Ian Horrocks, and Ulrike Sattler. 2009. Bridging the gap between OWL and relational databases. Web Semantics: Science, Services and Agents on the World Wide Web 7, 2(2009).Google Scholar
- Mauricio Osorio Galindo, José R. Arrazola Ramírez, and José Luis Carballido. 2008. Logical Weak Completions of Paraconsistent Logics. Journal of Logic and Computation 18, 6 (2008). https://doi.org/10.1093/logcom/exn015 arXiv:http://oup.prod.sis.lan/logcom/article-pdf/18/6/913/6273876/exn015.pdfGoogle ScholarDigital Library
- Peter F Patel-Schneider. 2015. Using Description Logics for RDF Constraint Checking and Closed-World Recognition.. In AAAI.Google Scholar
- Peter F Patel-Schneider and Enrico Franconi. 2012. Ontology constraints in incomplete and complete data. In ISWC.Google Scholar
- Teodor Przymusinski. 1990. Well-founded Semantics Coincides with Three-valued Stable Semantics. Fundamenta Informaticae 13, 4 (1990). http://dl.acm.org/citation.cfm?id=107720.107722Google Scholar
- Teodor Przymusinski. 1991. Stable semantics for disjunctive programs. New Generation Computing 9, 3-4 (1991). https://doi.org/10.1007/BF03037171Google ScholarCross Ref
- Slawek Staworko, Iovka Boneva, Jose Emilio Labra Gayo, Samuel Hym, Eric G Prud’hommeaux, and Harold Solbrig. 2015. Complexity and Expressiveness of ShEx for RDF. In ICDT.Google Scholar
- Jiao Tao, Evren Sirin, Jie Bao, and Deborah L McGuinness. 2010. Integrity Constraints in OWL.. In AAAI.Google Scholar
- Allen Van Gelder, Kenneth A. Ross, and John S. Schlipf. 1991. The Well-founded Semantics for General Logic Programs. J. ACM 38, 3 (1991). https://doi.org/10.1145/116825.116838Google ScholarDigital Library
Index Terms
- Stable Model Semantics for Recursive SHACL
Recommendations
Towards compliance checking in reified I/O logic via SHACL
ICAIL '21: Proceedings of the Eighteenth International Conference on Artificial Intelligence and LawReified Input/Output logic [29] has been recently proposed to handle natural language meaning in Input/Output logic [17]. So far, the research in reified I/O logic has focused only on KR issues, specifically on how to use the formalism for representing ...
Expressiveness of Logic Programs under the General Stable Model Semantics
Stable model semantics had been recently generalized to non-Herbrand structures by several works, which provides a unified framework and solid logical foundations for answer set programming. This article focuses on the expressiveness of normal and ...
Satisfiability and containment of recursive SHACL
AbstractThe Shapes Constraint Language (SHACL) is the recent W3C recommendation language for validating RDF data, by verifying certain shapes on graphs. Previous work has largely focused on the validation problem, while the standard decision ...
Comments