Repairing SHACL Constraint Violations using Answer Set Programming. David, R., Ahmetaj, S., Šimkus, M., & Polleres, A. In Proceedings of the 21st International Semantic Web Conference (ISWC 2022), volume 13489, of Lecture Notes in Computer Science (LNCS), pages 375–391, Virtual Conference (Hangzhou, China), October, 2022. Springer.
Repairing SHACL Constraint Violations using Answer Set Programming [pdf]Paper  doi  abstract   bibtex   
The Shapes Constraint Language (SHACL) is a recent W3C recommendation for validating RDF graphs against \emphshape constraints to be checked on \emphtarget nodes of the data graph. The standard also describes the notion of \emphvalidation reports for data graphs that violate given constraints, which aims to provide feedback on how the data graph can be fixed to satisfy the constraints. Since the specification left it open to SHACL processors to define such explanations, a recent work proposed the use of explanations in the style of database \emphrepairs, where a repair is a set of additions to or deletions from the data graph so that the resulting graph validates against the constraints. In this paper, we study such repairs for non-recursive SHACL, the largest fragment of SHACL that is fully defined in the specification. We propose an algorithm to compute repairs by encoding the explanation problem – using Answer Set Programming (ASP) – into a logic program, the answer sets of which correspond to (minimal) repairs. We then study a scenario where it is not possible to simultaneously repair all the targets, which may be often the case due to overall unsatisfiability or conflicting constraints. We introduce a relaxed notion of validation, which allows to validate a (maximal) subset of the targets and adapt the ASP translation to take into account this relaxation. Our implementation in Clingo is – to the best of our knowledge – the first implementation of a repair generator for SHACL.

Downloads: 0