<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Reasoning about Explanations for Non-validation in SHACL (Extended Abstract)?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shqiponja Ahmetaj</string-name>
          <xref ref-type="aff" rid="aff4">4</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Robert David</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Magdalena Ortiz</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Axel Polleres</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff4">4</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bojken Shehu</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mantas Simkus</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Complexity Science Hub Vienna</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Polytechnic University of Tirana</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Semantic Web Company</institution>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Technical University of Vienna</institution>
        </aff>
        <aff id="aff4">
          <label>4</label>
          <institution>Vienna University of Economics and Business</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>The Shape Constraint Language (SHACL) is a recently standardized language for expressing constraints on RDF graphs. It is the result of industrial and academic e orts to provide solutions for checking the quality of RDF graphs and for declaratively describing (parts of) their structure. We recommend [9] for an introduction to SHACL and its close relative ShEx. Among others, the SHACL standard provides a syntax for writing down constraints, as well as describes the way RDF graphs should be validated w.r.t. a given set of SHACL constraints. However, some aspects of validation were not completely speci ed in the standard, like the semantics of validation for constraints with cyclic dependencies. To address these shortcomings, recently several formalizations of SHACL have emerged, which describe it in logic-based languages with clear semantics. E.g., some works resort to rst-order logic [6], while some use logic programming [2]. SHACL is closely related to expressive Description Logics (DLs). Such connections have already been observed in [10], where the authors reduce implication of SHACL constraints to concept subsumption in DLs. The key di erence between SHACL and DLs is that SHACL makes the closed-world assumption (CWA), while DLs use the open-world assumption (OWA). To understand the di erence, RDF graphs equipped with SHACL constraints can be thought of as DL knowledge bases in which all roles and some concept names are closed predicates in the context of DLs with closed predicates (see [8, 11]), i.e., where only some concept names are allowed to be non-closed predicates. In SHACL, the basic computational problem is to check whether a given RDF graph G validates a SHACL document (C; T ), where C is a speci cation of validation rules (constraints ) and T is a speci cation of nodes to which the validation rules should apply (targets). In order to make SHACL truly useful and widely accepted, we need automated tools that implement not only validation, which results in \yes" or \no" answers, but also support the users in their e orts Copyright c 2021 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). ? Partially supported by the Vienna Business Agency and the Austrian Science Fund (FWF) projects P30360 and P30873. Axel Polleres' work is supported by funding in the European Commission's Horizon 2020 Research Programme under Grant Agreement Number 957402.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>to understand the reasons why a given graph validates or not against a given
document. The SHACL speci cation stresses the importance of explaining
validation outcomes and introduces the notion of validation reports for this purpose.
If a graph validates a document, the standard has clear guidance how the
validation reports should look like. However, the situation is di erent when the graph
does not validate. The principles of validation reports in case of non-validation
are left largely open in the standard, which speci es little beyond requiring that
the node and constraint violated are indicated. It is not hard to see that, in
general, there may be a very large number of possible reasons for a speci c
validation target to fail, and it is far from obvious what should be presented to the
user in validation reports. This is precisely the topic of our study.</p>
      <p>
        In this work6, we advocate explanations in the style of database repairs [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
as one concrete way to provide explanations for the non-validation of SHACL
constraints. This approach is closely related to subareas of KR&amp;R like abductive
reasoning, model-based diagnosis and counterfactuals, which have received very
signi cant attention in the last decades and applied to a range of similar problems
requiring explanatory services (see, e.g., [
        <xref ref-type="bibr" rid="ref12 ref4 ref5 ref7">7, 12, 4, 5</xref>
        ]).
      </p>
      <p>The main goal of this work is to formalize the notion of explanations for
SHACL, to de ne a collection of reasoning tasks for exploring explanations, and
to characterize their computational complexity. In a nutshell, the contributions
of this paper are as follows:</p>
      <p>To explain non-validation of a SHACL document (C; T ) by an RDF graph
G, we introduce the notion of a SHACL Explanation Problem (SEP). A solution
to a SEP is a pair (A; D) that describes a collection A of facts to be added to
G and a collection D of facts to be deleted from G, so that the resulting graph
does validate the document (C; T ). We consider natural preference orders over
explanations, and study also explanations that are minimal w.r.t. set inclusion
or w.r.t. cardinality. We illustrate the use of explanations with some examples.</p>
      <p>
        We de ne a collection of inference services for reasoning about explanations
for non-validation. We start with the basic tasks of recognizing whether a given
candidate is indeed a (preferred) explanation, and deciding whether a (preferred)
explanation exists. We also de ne the problems of checking whether a given atom
is relevant (resp., necessary) as an addition or as a deletion in some explanation
(resp., all explanations). These tasks are reminiscent of basic reasoning problems
in logic-based abduction [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>We study the computational complexity of the introduced reasoning tasks
and characterize both combined and data complexity. Our results range from
tractability to completeness for the second level of the polynomial hierarchy.</p>
      <p>
        After studying the general setting, we turn our attention to non-recursive
SHACL constraints. We show that with one exception, reasoning about
explanations in the presence of non-recursive constraints does not become easier in
terms of computational complexity. The exception is the problem of recognizing
an explanation, which becomes tractable in the absence of a preference order.
6 This is an extended abstract of [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>Title Suppressed Due to Excessive Length
As a side result we show that SHACL validation in the presence of non-recursive
constraints is P-complete.</p>
      <p>Finally we consider a generalization of SEPs with restricted explanation
signatures. This useful feature allows, e.g., to specify that some classes and
properties are read-only, prohibiting deletions from them during explanations. Also
for this setting, we establish a collection of complexity results, including the case
of non-recursive constraints.</p>
      <p>Ahmetaj et al.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Ahmetaj</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , David,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Ortiz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Polleres</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Shehu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Simkus</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Reasoning about explanations for non-validation in SHACL</article-title>
          .
          <source>In: Proceedings of the 18th International Conference on Principles of Knowledge Representation and Reasoning</source>
          ,
          <string-name>
            <surname>KR</surname>
          </string-name>
          <year>2021</year>
          . To appear.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Andresel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corman</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ortiz</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reutter</surname>
            ,
            <given-names>J.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Savkovic</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Simkus</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Stable model semantics for recursive SHACL</article-title>
          .
          <source>In: Proc. of The Web Conference</source>
          <year>2020</year>
          . p.
          <volume>1570</volume>
          {
          <fpage>1580</fpage>
          . WWW '20,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2020</year>
          ). https://doi.org/10.1145/3366423.3380229, https://doi.org/10.1145/3366423.3380229
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Arenas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bertossi</surname>
            ,
            <given-names>L.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chomicki</surname>
          </string-name>
          , J.:
          <article-title>Consistent query answers in inconsistent databases</article-title>
          .
          <source>In: Proc. of PODS</source>
          . pp.
          <volume>68</volume>
          {
          <fpage>79</fpage>
          . ACM Press (
          <year>1999</year>
          ). https://doi.org/10.1145/303976.303983, https://doi.org/10.1145/303976.303983
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ortiz</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Simkus</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stefanoni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Reasoning about explanations for negative query answers in DL-Lite</article-title>
          .
          <source>J. Artif. Intell. Res</source>
          .
          <volume>48</volume>
          ,
          <issue>635</issue>
          {
          <fpage>669</fpage>
          (
          <year>2013</year>
          ). https://doi.org/10.1613/jair.3870, https://doi.org/10.1613/jair.3870
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ceylan</surname>
            ,
            <given-names>I_.I_.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukasiewicz</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malizia</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Molinaro</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vaicenavicius</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Explanations for negative query answers under existential rules</article-title>
          .
          <source>In: Proc. of KR 2020</source>
          . pp.
          <volume>223</volume>
          {
          <issue>232</issue>
          (
          <year>2020</year>
          ). https://doi.org/10.24963/kr.2020/23, https://doi.org/10.24963/kr.2020/23
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Corman</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reutter</surname>
            ,
            <given-names>J.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Savkovic</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Semantics and validation of recursive SHACL</article-title>
          .
          <source>In: Proc. of ISWC'18</source>
          . Springer (
          <year>2018</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          - 00671-6 19, https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -00671-6 19
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>The complexity of logic-based abduction</article-title>
          .
          <source>J. ACM</source>
          <volume>42</volume>
          (
          <issue>1</issue>
          ),
          <volume>3</volume>
          {
          <fpage>42</fpage>
          (
          <year>1995</year>
          ). https://doi.org/10.1145/200836.200838, https://doi.org/10.1145/200836.200838
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Franconi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <article-title>Iban~ez-Garc a</article-title>
          ,
          <string-name>
            <given-names>Y.A.</given-names>
            ,
            <surname>Seylan</surname>
          </string-name>
          ,
          <string-name>
            <surname>I.</surname>
          </string-name>
          :
          <article-title>Query answering with DBoxes is hard</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci</source>
          . (
          <year>2011</year>
          ). https://doi.org/10.1016/j.entcs.
          <year>2011</year>
          .
          <volume>10</volume>
          .007, http://dx.doi.org/10.1016/j.entcs.
          <year>2011</year>
          .
          <volume>10</volume>
          .007
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Gayo</surname>
            ,
            <given-names>J.E.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prud</surname>
          </string-name>
          'hommeaux, E.,
          <string-name>
            <surname>Boneva</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontokostas</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Validating RDF Data</article-title>
          .
          <source>Synthesis Lectures on the Semantic Web: Theory and Technology</source>
          , Morgan &amp; Claypool Publishers (
          <year>2017</year>
          ). https://doi.org/10.2200/S00786ED1V01Y201707WBE016, https://doi.org/10.2200/S00786ED1V01Y201707WBE016
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Leinberger</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seifer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rienstra</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , Lammel, R.,
          <string-name>
            <surname>Staab</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Deciding SHACL shape containment through description logics reasoning</article-title>
          .
          <source>In: Proc. of ISWC 2020. Lecture Notes in Computer Science</source>
          , vol.
          <volume>12506</volume>
          , pp.
          <volume>366</volume>
          {
          <fpage>383</fpage>
          . Springer (
          <year>2020</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -62419-4 21, https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -62419-4 21
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seylan</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Ontology-based data access with closed predicates is inherently intractable(sometimes)</article-title>
          .
          <source>IJCAI/AAAI</source>
          (
          <year>2013</year>
          ), http://www.aaai.org/ocs/index.php/IJCAI/IJCAI13/paper/view/6870
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Porter</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Handbook of knowledge representation</article-title>
          .
          <source>Elsevier</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>