<!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>Dealing with Inconsistencies due to Class Disjointness in SPARQL Update</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Albin Ahmeti</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Diego Calvanese</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Axel Polleres</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vadim Savenkov</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science, Free University of Bozen-Bolzano</institution>
          ,
          <addr-line>Bolzano</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Vienna University of Economics and Business</institution>
          ,
          <addr-line>Welthandelsplatz 1, 1020 Vienna</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Vienna University of Technology</institution>
          ,
          <addr-line>Favoritenstraße 9, 1040 Vienna</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The problem of updating ontologies has received increased attention in recent years. In the approaches proposed so far, either the update language is restricted to (sets of) atomic updates, or, where the full SPARQL Update language is allowed, the TBox language is restricted to RDFS where no inconsistencies can arise. In this paper we discuss directions to overcome these limitations. Starting from a DL-Lite fragment covering RDFS and concept/class disjointness axioms, we define two semantics for SPARQL Update: under cautious semantics, inconsistencies are resolved by rejecting all updates potentially introducing conflicts; under brave semantics, instead, conflicts are overridden in favor of new information where possible. The latter approach builds upon existing work on the evolution of DL-Lite knowledge bases, setting it in the context of generic SPARQL updates.</p>
      </abstract>
      <kwd-group>
        <kwd>Update</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        This paper initiates the study of SPARQL updates in the context of potential
inconsistencies: as a minimalistic ontology language allowing for inconsistencies, we consider
¬
RDFS , an extension of RDFS [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] with class disjointness axioms of the form {
disjointWith  } from OWL [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], sometimes referred to as negative inclusions or
NIs [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], as the corresponding description logic encoding of this statement is 
As a running example, we assume a triple store 
with an RDFS
      </p>
      <p>
        encoding an educational domain, asserting a range restriction plus mutual disjointness
of the concepts like professor and student (we use Turtle syntax [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], in which dw
abbreviates OWL’s disjointWith keyword, and dom and rng respectively stand for
the domain and range keywords of RDFS).
⊑ ¬
      </p>
      <p>.
¬ ontology (TBox)
:Professor dw :Student. }</p>
      <p>
        = {:studentOf dom :Student. :studentOf rng :Professor.
Consider the following SPARQL update [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] request  in the context of the TBox  :
      </p>
      <sec id="sec-1-1">
        <title>INSERT {?X :studentOf ?Y} WHERE {?X :attendsClassOf ?Y}</title>
        <p>Consider an ABox with data on student tutors that happen to attend each other’s classes:
=
 1
:jimmy}. Here, 
{:jimmy :attendsClassOf :ann. :ann :attendsClassOf
would create two assertions :jimmy :studentOf :ann and
:ann :studentOf :jimmy. Due to the range and domain constraints in  , these
assertions result in clashes both for Jimmy and for Ann. Note that all inconsistencies</p>
        <p>assertions vs. RDF(S), where  ,  ′ denote concept (or, class) names,  ,  ′
denote role (or, property) names,  is the set of IRI constants (excl. the OWL/RDF(S) vocabulary)
and ,</p>
        <p>
          ∈  . For RDF(S), we use abbreviations (rsc, sp, dom, rng, a) as introduced in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
TBox
        </p>
        <p>RDFS¬
1.  ′ ⊑  
2.  ′ ⊑  
′ sc  .</p>
        <p>3.
′ sp  . 4. ∃ − ⊑</p>
        <p>TBox

∃
⊑</p>
        <sec id="sec-1-1-1">
          <title>RDFS¬</title>
          <p>TBox</p>
        </sec>
        <sec id="sec-1-1-2">
          <title>RDFS¬ ABox RDFS¬</title>
          <p>rng  .
dom  . 5.  ′ ⊑ ¬ 
′ dw  . 6.  ( )  a  .</p>
          <p>7.  (,  )  P  .
keep those that cause no clashes.
are in the new data, and thus we say that  is intrinsically inconsistent for the particular
ABox  1. Our solution for such updates will be to discard problematic assignments but</p>
          <p>
            Now, let  2 be the ABox {:jimmy :attendsClassOf :ann. :jimmy a
:Professor}. It is clear that after the update  , the ABox will become inconsistent,
due to the property assertion :jimmy :studentOf :ann, implying that Jimmy is
both a professor and a student which contradicts the TBox disjointness axiom. In contrast
to the previous case, the clash now is between the prior knowledge and the new data. We
propose two update semantics, extending our previous work [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ] for dealing with such
inconsistencies and provide rewriting algorithms for implementing them using the basic
constructs of the SPARQL language (e.g., making use of the UNION, MINUS, FILTER,
and OPTIONAL operators).
          </p>
          <p>In the remainder of the paper, after some short preliminaries (Sec. 2) we discuss
checking of intrinsic inconsistencies in Sec. 3, and then in Sec. 4 we present two
semantics for dealing with general inconsistencies in the context of materialized triple
stores. An overview of related work and concluding remarks can be found in Sec. 5.
2</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>We introduce basic notions about RDF graphs, RDFS¬ ontologies, and SPARQL queries.
In this paper we use RDF and DL notation interchangeably, treating RDF graphs that do
not use non-standard RDFS</p>
      <p>
        ¬ vocabulary [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] as sets of TBox and ABox assertions.
      </p>
      <p>Definition 1 (RDFS</p>
      <p>¬ ABox, TBox, triple store). We call a set 
6–7 in Table 1 an (RDF) ABox, and the union 
tions of the forms 1–5 in Table 1 an (RDFS¬) TBox, a set 
of inclusion
asserof assertions of the forms
=  ∪ 
an (RDFS¬) triple store.</p>
      <p>– each atomic concept  to a subset  ℐ of  ℐ ,
Definition 2 (Interpretation, satisfaction, model, consistency). An interpretation
⟨ ℐ , ·ℐ ⟩ consists of a non-empty set  ℐ and an interpretation function ·ℐ , which maps
? sc ?.</p>
      <p>? a ?.</p>
      <p>? a ?.
? sp ?.</p>
      <p>? ? ?.
? ? ?.</p>
      <p>? dom ?.</p>
      <p>? ? ?.
? a ?.</p>
      <p>? a ?.
? rng ?.</p>
      <p>? ? ?.</p>
      <p>? a ?, ?.</p>
      <p>
        ? dW ?.
⊥
Fig. 1. Minimal RDFS rules from [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] plus class disjointness “clash” rule from OWL2 RL [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
– each negation of atomic concept  to (¬ ℐ ) =  ℐ ∖  ℐ ,
– each atomic role  to a binary relation  ℐ over  ℐ , and
– each element of  to an element of  ℐ .
      </p>
      <p>For expressions ∃ and ∃ −, the interpretation function is defined as (∃ )ℐ = { ∈
 ℐ | ∃. (,  ) ∈  ℐ } resp. (∃ −)ℐ = { ∈  ℐ | ∃. (,  ) ∈  ℐ }. An interpretation
ℐ satisfies an inclusion assertion  1 ⊑  2 (of one of the forms 1–5 in Table 1), if
 1ℐ ⊆  2ℐ . Analogously, ℐ satisfies ABox assertions of the form  ( ), if  ℐ ∈  ℐ , and
of the form  (,  ), if ( ℐ ,  ℐ ) ∈  ℐ . An interpretation ℐ is called a model of a triple
store  (resp., a TBox  , an ABox  ), denoted ℐ | =  (resp., ℐ | =  , ℐ | =  ), if ℐ
satisfies all assertions in  (resp.,  ,  ). Finally,  is called consistent, if it does not
entail both  ( ) and ¬ ( ) for any concept  and constant  ∈  , where entailment
is defined as usual.</p>
      <p>
        As in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], we treat only restricted SPARQL queries corresponding to (unions of)
conjunctive queries without non-distinguished variables over DL ontologies:
Definition 3 (BGP, CQ, UCQ, query answer). A conjunctive query (CQ)  , or basic
graph pattern (BGP), is a set of atoms of the form 6–7 from Table 1, where now ,  ∈
 ∪  .4 A union of conjunctive queries (UCQ)  , or UNION pattern, is a set of CQs.
We denote with  ( ) (or  ( )) the set of variables from  occurring in  (resp.,  ). An
answer (under RDFS¬ Entailment) to a CQ  over a triple store  is a substitution  of
the variables in  ( ) with constants in  such that every model of  satisfies all facts in
 . We denote the set of all such answers with ansrdfs(,  ) (or simply ans(,  )). The
set of answers to a UCQ  is ⋃︀  ∈ ans(,  ).
      </p>
      <p>
        We also recall from [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], that query answering in the presence of ontologies can be
done either by rule-based pre-materialization of the ABox or by query rewriting. Let
rewrite(,  ) be the UCQ resulting from applying PerfectRef [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] (or, equivalently, the
stripped-down version from [1, Alg.1]) to a query  and let  =  ∪  be a triple
store. Furthermore, let mat( ) be the triple store obtained from exhaustive application
of the inference rules in Fig. 1 on a consistent triple store  , and—analogously—let
chase(,  ) refer to “materialization” w.r.t.  applied to a CQ  . The next result transfers
from [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] to consistent RDFS¬ stores.
      </p>
      <p>Proposition 1. Let  =  ∪  be a consistent triple store, and  a CQ. Then,
ans(,  ) = ans(rewrite(,  ),  ) = ans(, mat( )).</p>
      <p>We have used this previously to define the semantics of SPARQL update operations.
Definition 4 (SPARQL update operation, simple update of a triple store). Let
  and   be BGPs, and   a BGP or UNION pattern. Then an update operation
 (  ,   ,   ) has the form</p>
      <p>DELETE</p>
      <p>INSERT</p>
      <p>WHERE  
Let  =  ∪  be a triple store. Then the simple update of  w.r.t.  (  ,   ,   )
is defined as   (  ,  ,  ) = ( ∖   ) ∪   , where   = ⋃︀  ∈ans(  , ) gr (   ),
  = ⋃︀  ∈ans(  , ) gr (   ), and gr ( ) denotes the set of ground triples in pattern  .
4  is a countably infinite set of variables (written as ’?’-prefixed alphanumeric strings).</p>
      <p>For the sake of readability of the algorithms, we assume that all update operations
 (  ,   ,   ) in this paper contain no constants in the BGPs   and   , and that all
property assertions (? p ? ) in   have distinct variables ? and ? . Enhancing our
results to updates with constants and variable equalities in   and   is not difficult, but
requires distinguishing special cases: e.g., instead of replacing the variable  in a pattern
 by  , the expression  FILTER( =  ) can be used in the case when  is a constant;
instead of  ( ) MINUS  for a variable  ,  FILTER NOT EXISTS  should be used
for ground  .</p>
      <p>
        We call a triple store or (ABox) materialized if in each state it always guarantees
 ∖ = mat( )∖ mat( ). In the present paper, we will always focus on “materialization
preserving” semantics for SPARQL update operations, which we dubbed Sem2mat in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
and which preserves a materialized triple store. We recall the intuition behind Sem2mat,
given an update  = (  ,   ,   ): (i) delete the instantiations of   plus all their
causes; (ii) insert the instantiations of   plus all their effects.
      </p>
      <p>
        Definition 5 (Sem2mat [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). Let  (  ,   ,   ) be an update operation. Then
 S(e m 2m, at ,  ) =   (  caus,  ef ,{  }{  fvars})
Here, given a pattern  ,  caus = flatten (rewrite(,  ));  ef = chase(,  ) and
 fvars = {? a rdfs:Resource |? ∈  ( caus) ∖  ( )}, where flatten (·) computes the
set of all triples occurring in the UCQ  (,  ), which in our case allows us to
obtain all possible “causes” of each atom in   , and “?v a rdfs:Resource” is a
shortcut for a pattern that binds ? to any  ∈  occurring in  .
      </p>
      <p>
        We refer to [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for further details, but stress that as such, Sem2mat is not able to detect
or deal with inconsistencies arising from   and  . In what follows, we will discuss how
this can be remedied.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Checking Consistency of a SPARQL Update</title>
      <p>
        Within previous work on the evolution of DL-Lite knowledge bases [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], updates given in
the form of pairs of ABoxes   ,   have been studied. However, whereas such update
might be viewed to fit straightforwardly to the corresponding   ,   in Def. 4, in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
it is assumed that   is consistent with the TBox, and thus one only needs to consider
how to deal with inconsistencies between the update and the old state of the knowledge
base. This a priori assumption may be insufficient for SPARQL updates though, where
concrete values for inserted triples are obtained from variable bindings in the WHERE
clause, and depending on the bindings, the update can be either consistent or not. This is
demonstrated by the update  from Sec. 1 which, when applied to the ABox  4, results
in an inconsistent set   of insertions . We call this intrinsic inconsistency of an update
relative to a triple store  =  ∪  .
      </p>
      <p>Definition 6. Let  be a triple store. The update  is said to be intrinsically consistent
w.r.t.  if the set of new assertions   from Def. 4 generated by applying  to  , taken in
isolation from the ABox of  , does not contradict the TBox of  . Otherwise, the update
is said to be intrinsically inconsistent w.r.t.  .</p>
      <p>Algorithm 1: constructing a SPARQL ASK query to check intrinsic inconsistency
(for the definition of</p>
      <p>ef , cf. Def. 5)
Output: A SPARQL ASK query returning  
// contains clashes in itself, i.e., is inconsistent for any triple store</p>
      <p>
        UNION {{   1[? ↦→? ]} . {   2[? ↦→? ]}} for a fresh ?
2
3 else
old state of the knowledge base, illustrated by the ABox  2 from Sec. 1. This latter case
can be addressed by adopting an update policy that prefers newer assertions in case of
conflicts, as studied in the context of DL-Lite KB evolutions [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which we will discuss
in Sec. 4 below. Intrinsic inconsistencies however are harder to deal with, since there
is no cue which assertion should be discarded in order to avoid the inconsistency. Our
proposal here is thus to discard all mutually inconsistent pairs of insertions.
      </p>
      <p>We first present an algorithm for checking intrinsic inconsistency by means of
SPARQL ASK queries and then a safe rewriting algorithm. This rewriting is based on an
observation that clashing triples can be introduced by a combination of two bindings of
variables in the WHERE clause, as the example in the Sec. 1 (the ABox  1) illustrates.
To handle such cases, two copies of the WHERE clause   are created by the rewriting
in Algorithms 1 and 2, for each pair of disjoint concepts according to the TBox of the
triple store. These algorithms use notation described in Rem. 1 below.
just a substitution of ? by ? in  . Finally,  
Remark 1. Our rewriting algorithms rely on producing fresh copies of the WHERE
clause. Assume  ,  1,  2, . . . to be substitutions replacing each variable in a given
formula with a distinct fresh one. For a substitution  , we also define  [ ] resp.   [ ] to
be an extension of  , renaming each variable at positions not affected by  with a distinct
fresh one. For instance, let 
be a triple (?
:studentOf ? ). Now,  
makes a
variable disjoint copy of  : ? 1 :studentOf ? 1 for fresh ? 1, ? 1.  [? ↦→? ] is
[? ↦→? ] results in ?
:studentOf
? 2 for fresh ? 2. We assume that all occurrences of  
[ ] stand for syntactically the
same query, but that  
in</p>
      <p>( 1) ∩ 
by the parameterizing substitution  .</p>
      <p>[ 1] and</p>
      <p>[ 2], for distinct  1 and  2, can only have variables
( 2) in common. That is, the choice of fresh variables is defined
variable renamings as in Rem. 1 and ? is a fresh variable.</p>
      <p>Now, the possibility of unifying two variables ? and ? in   on a given triple store
can be tested with the query {   1[?</p>
      <p>↦→? ]}{   2[? ↦→? ]} where  1 and  2 are</p>
      <p>In order to check the intrinsic consistency of an update, this condition should be
evaluated for every pair of variables of   , the unification of which leads to a clash. A
SPARQL ASK query based on this idea is produced by Alg. 1. Note that it suffices to
2
5
6
7
Algorithm 2: Safe rewriting safe( )</p>
      <p>Output: SPARQL update safe( )
all those which are implied by  .
check only triples of the form {?</p>
      <p>a ? } at line 5 of Alg. 1, since disjointness conditions
can only be formulated for concepts, according to the syntax in Table 1. Furthermore,
since we are taking the facts in</p>
      <p>ef extended by all facts implied by  , at line 6 of
Alg. 1 it suffices to check the disjointness conditions explicitly mentioned in  and not
Example 1. Consider the update  from Sec. 1, in which the INSERT clause   can
create clashing triples. To identify potential clashes, Alg. 1 first applies the
inference rule for the range constraint, and computes  
a :Professor}. Now both variables ?,
?
ef
= {?</p>
      <p>a :Student . ?
occur in the triples of type (6) from
the safe rewriting safe(·) in Alg. 2, removing all variable bindings that participate in a
clash between different triples of   . Let   be a WHERE clause, in which the variables
?
and ?</p>
      <p>should not be unified to avoid clashes. With  1,  2 being “fresh” variable
to eliminate unsafe bindings that send ?</p>
      <p>and ? to a same value.
renamings as in Rem. 1, Alg. 2 uses the union of    1[? ↦→? ] and    2[? ↦→? ]
Example 2. Alg. 2 extends the WHERE clause of the update  from Sec. 1 as follows:
INSERT{?X :studentOf ?Y} WHERE{?X :attendsClassOf ?Y</p>
      <p>MINUS{{?X1 :attendsClassOf ?X} UNION {?Y :attendsClassOf ?Y2}}}
Note that the safe rewriting can make the update void. For instance, safe( ) has
no effect on the ABox  1 from Sec. 1, since there is no cue, which of :jimmy
:attendsClassOf :ann, :ann :attendsClassOf :jimmy needs to be
dismissed to avoid the clash. However, if we extend this ABox with assertions both
satisfying the WHERE clause of  and not causing undesirable variable unifications, safe( )
as a result of safe( ).
would make insertions based on such bindings. For instance, adding the fact :bob
:attendsClassOf :alice to  1 would assert :bob :studentOf :alice</p>
      <p>A rationale for using MINUS rather than FILTER NOT EXISTS in Alg. 2 (and also
in a rewriting in forthcoming Sec. 4) can be illustrated by an update in which variables
in the INSERT and DELETE clauses are bound in different branches of a UNION:
DELETE {?V a :Professor} INSERT {?X :studentOf ?Y}</p>
      <p>WHERE {{?X :attendsClassOf ?Y} UNION {?V :attendsClassOf ?W}}
A safe rewriting of this update (abbreviating :attendsClassOf as :aCo) is
DELETE {?V a :Professor} INSERT {?X :studentOf ?Y}
WHERE { {{?X :aCo ?Y} UNION {?V :aCo ?W}}</p>
      <p>MINUS{ {{?X1 :aCo ?X} UNION {?V1 :aCo ?W1}}</p>
      <p>UNION {{?Y :aCo ?Y2} UNION {?V2 :aCo ?W2}} } }
It can be verified that with FILTER NOT EXISTS in place of MINUS this update makes
no insertions on all triple stores: the branches {?V1 :aCo ?W1} and {?V2 :aCo
?W2} are satisfied whenever {?X :aCo ?Y} is, making FILTER NOT EXISTS
evaluate to False whenever {?X :aCo ?Y} holds.</p>
      <p>We conclude this section by formalizing the intuition of update safety. For a triple
store 
and an update 
= (  ,   ,   ), let J  K

ings computed by the query “ SELECT ? 1, . . . , ?  WHERE   ” over  , where
? 1, . . . , ?  are the variables occurring in   or in   .
 denote the set of variable
bindThen, the following properties hold for an arbitrary RDFS¬ triple store 
Theorem 1. Let  be a TBox, let  be a SPARQL update (  ,   ,   ), and let query  
and update safe( ) = (  ,   ,   ′ ) result from applying Alg. 1 resp. Alg. 2 to  and  .
=  ∪ 
:
(1)   ( ) = True iff ∃,  ′ ∈ J  K
(2) J  K

 ∖ J  ′  = { ∈ J  K | ∃ ′ ∈ J  K</p>
      <p>K
 s.t.  (  ) ∧  ′(  ) ∧  | = ⊥</p>
      <p>;
 s.t.  (  ) ∧  ′(  ) ∧  | = ⊥}.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Materialization Preserving Update Semantics</title>
      <p>In this section we discuss resolution of inconsistencies between triples already in the
triple store and newly inserted triples. Our baseline requirement for each update
semantics is formulated as the following property.
triple store.</p>
      <p>Definition 7 (Consistency-preserving). Let  be a triple store and  (  ,   ,   ) an
update. A materialization preserving update semantics Sem is called consistency
preSem
serving in RDFS¬ if the evaluation of update  , i.e.,   (  ,  ,  ), results in a consistent</p>
      <p>Our two consistency preserving semantics are respectively called brave and cautious.
The brave semantics always gives priority to newly inserted triples by discarding all
pre-existing information that contradicts the update. The cautious semantics is exactly
the opposite, discarding inserts that are inconsistent with facts already present in the
triple store; i.e., the cautious semantics never deletes facts unless explicitly required by
the DELETE clause of the SPARQL update.</p>
      <p>Algorithm 3: Brave semantics Sembmraavte
1   ′ :=   caus;</p>
      <p>Input: Materialized triple store 
Output:   (  ,  ,  )</p>
      <p>Sembmraavte
2 foreach triple pattern (? a  ) in   ef do
3
4
5
6 return   (  ′ , ef ,{  }</p>
      <p>fvars)
if (?</p>
      <p>a  ′) ∈/   ′ then
  ′ :=   ′ . {?</p>
      <p>a  ′}caus
foreach  ′ s.t. 
⊑ ¬
 ′ ∈  or  ′ ⊑ ¬</p>
      <p>∈  do</p>
      <p>, SPARQL update  (  ,   ,   )</p>
      <p>Both semantics rely upon incremental update semantics Sem2mat , introduced in
Sec. 2, which we aim to extend to take into account class disjointness. Note that for the
present section we assume updates to be intrinsically consistent, which can be checked or
enforced beforehand in a preprocessing step by the safe rewriting discussed in Sec. 3. In
this section, we lift our definition of update operation to include also updates (  ,   ,   )
with   produced by the safe rewriting Alg. 2 from some update satisfying Def. 4. What
remains to be defined is the handling of clashes between newly inserted triples and triples
already present in the triple store.</p>
      <p>The intuitions of our semantics for a SPARQL update  (  ,   ,   ) in the context
of an RDFS</p>
      <p>¬ TBox are as follows:
– brave semantics Sembmraavte: (i) delete all instantiations of   and their causes, plus
all the non-deleted triples in</p>
      <p>clashing with instantiations of triples in   to be
inserted, again also including the causes of these triples; (ii) insert the instantiations
of   plus all their effects.
– cautious semantics Semcmauatt : (i) delete all instantiations of   and their causes;
(ii) insert all instantiations of   plus all their effects, unless they clash with some
non-deleted triples in  : in this latter case, perform neither deletions nor insertions.
For a SPARQL update  , we will define rewritings of  implementing the above
semantics, which can be shown to be materialization preserving and consistency preserving.
4.1</p>
      <p>
        Brave Semantics
The rewriting in Alg. 3 implements the brave update semantics Sembmraavte; it can be viewed
as combining the idea of FastEvol [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] with Sem2mat to handle inconsistencies by giving
priority to triples that ought to be inserted, and deleting all those triples from the store
that clash with the new ones.
      </p>
      <p>The DELETE clause   ′ of the rewritten update is initialized with the set   of
triples from the input update  . Rewriting ensures that also all “causes” of deleted
facts are removed from the store, since otherwise deleted triples will be re-inserted by
materialization. To this end, line 1 of Alg. 3 adds to   ′ all facts from which   can be
derived. Then, for each triple implied by   (that is, for each triple in  
computes clashing patterns and adds them to the DELETE clause  
ef ) the algorithm
′ , along with their
causes. Note that it suffices to only consider disjointness assertions that are syntactically
contained in 
is materialized.</p>
      <p>(and not all that are implied by  ), since we assume that the triple store
Finally, the WHERE clause of the rewritten update is extended to satisfy the syntactic
triple store, computing its new materialized and consistent state.
by the part  
restriction that all variables in   ′ must have matches in the WHERE clause: bindings of
“fresh” variables introduced to   ′ by eventual domain or range constraints are provided
fvars, cf. Def. 5 and Ex. 3 below. The rewritten update is evaluated over the
Example 3. Ex. 2 in Sec. 3 provided a safe rewriting safe( ) of the update  from Sec. 1.
According to Alg. 3, this safe update is rewritten to:
DELETE {?X a :Professor . ?X1 :studentOf ?X .</p>
      <p>?Y a :Student . ?Y :studentOf ?Y1}

property assertions implying clashes need to be deleted, and the respective triples in   ′
contain fresh variables ?</p>
      <p>1 and ? 1. These variables have to be bound in the WHERE
clause, and therefore  fvars adds two optional clauses to</p>
      <p>computationally reasonable implementation of the concept  fvars from Def. 5.
of safe( ), which is a
Theorem 2. Alg. 3, given a SPARQL update  and a consistent materialized triple store
, computes a new consistent and materialized state w.r.t. brave semantics.
Unlike Sembmraavte, its cautious version Semcmauatt always gives priority to triples that are
already present in the triple store, and dismisses any inserts that are inconsistent with it.
We implement this semantics as follows: (i) the DELETE command does not generate
inconsistencies and thus is assumed to be always possible; (ii) the update is actually
executed only if the triples introduced by the INSERT clause do not clash with state of
the triple graph after all deletions have been applied.</p>
      <p>Cautious semantics thus treats insertions and deletions asymmetrically: the former
depend on the latter but not the other way round. The rationale is that deletions never
cause inconsistencies and can remove clashes between the old and the new data.</p>
      <p>As in the case of brave semantics, cautious semantics is implemented using rewriting,
presented in Alg. 4. First, the algorithm issues an ASK query to check that no clashes
will be generated by the INSERT clause, provided that the DELETE part of the update
is executed. If no clashes are expected, in which case the ASK query returns False, the
brave update from the previous section is applied.
concepts  ′ that are explicitly mentioned as disjoint with</p>
      <p>For a safe update 
each triple pattern {?
= (  ,   ,   ), the ASK query is generated as follows. For
a  } among the effects of   , at line 3 Alg. 4 enumerates all
in  . As in the case of
brave semantics, this syntactic check is sufficient due to the assumption that the update
is applied to a materialized store; by the same reason also no property assertions need to
be taken into account.</p>
      <p>Algorithm 4: Cautious semantics Semcmauatt</p>
      <p>Input: Materialized triple store  =  ∪  , SPARQL update  (  ,   ,   )</p>
      <p>Semcmauatt</p>
      <p>Output:   (  ,  ,  )
1  := { FILTER(False)} // neutral element w.r.t. union
2 foreach (? a  ) ∈   ef do
3 foreach  ′ s.t.  ⊑ ¬ ′ ∈  or  ′ ⊑ ¬ ∈  do
4  −′ := { FILTER(False)}
5 foreach (? a  ′) ∈   caus do
6  −′ :=  −′ UNION {   [? ↦→? ]}
 :=</p>
      <p>UNION {{? a  ′} MINUS { −′ }}
7
12
8  := ASK WHERE {{  }.{ }};
9 if  ( ) then
10 return 
11 else</p>
      <p>Sembmraavte
return   (  ,  ,  )</p>
      <p>For each concept  ′ disjoint from  , we need to check that a triple matching the
pattern {? a  ′} is in the store  and will not be deleted by  . Deletion happens if
there is a pattern {? a  ′} ∈   caus such that the variable ? can be bound to the same
value as ? in the WHERE clause   . Line 6 of Alg. 4 produces such a check, using
a copy of   , in which the variable ? is replaced by ? and all other variables are
replaced with distinct fresh ones. Since there can be several such triple patterns in   caus,
testing for clash elimination via the DELETE clause requires a disjunctive graph pattern
 −′ constructed at line 6 and combined with {? a  ′} using MINUS at line 7.</p>
      <p>Finally, the resulting pattern is appended to the list  of clash checks using UNION .
As a result, {  }.{ } queries for triples that are not deleted by  and clash with an
instantiation of some class membership assertion {? a  } ∈   ef .</p>
      <p>Theorem 3. Alg. 4, given a SPARQL update  and a consistent materialized triple store
 =  ∪  , computes a new consistent and materialized state w.r.t. cautious semantics.
Example 4. Alg. 4 rewrites the safe update safe( ) from Ex. 2 as follows:
ASK WHERE{{?X :attendsClassOf ?Y</p>
      <p>MINUS{{?X1 :attendsClassOf ?X} UNION {?Y :attendsClassOf ?Y2}}}
.{{?Y a :Student} UNION {?X a :Professor}}}
Now, consider an update  ′ having both INSERT and DELETE clauses:
DELETE {?Y a :Professor} INSERT{?X a :Student}
WHERE {?X :attendsClassOf ?Y}
The update  ′ inserts a single class membership fact and thus is always intrinsically
consistent. The ASK query in Alg. 4 takes the DELETE clause of  ′ into account:</p>
      <sec id="sec-4-1">
        <title>ASK WHERE {{?X :attendsClassOf ?Y} .{{?X a :Professor} MINUS {?Z :attendsClassOf ?X }}}</title>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Discussion and Conclusions</title>
      <p>
        In this paper, we have taken a step further from our previous work, in combining SPARQL
Update and RDFS entailment by also adding class/concept disjointness as a first step
towards dealing with inconsistencies in the context of SPARQL Update. As discussed
throughout the paper, previous approaches to handle inconsistencies in DL KB evolution
(e.g., [
        <xref ref-type="bibr" rid="ref4 ref5 ref9">4, 5, 9</xref>
        ]) have assumed that the set of ABox assertions to be inserted is intrinsically
consistent w.r.t. the TBox, and thus inconsistencies are treated only w.r.t. the old state
of the knowledge base. As we have shown, this assumption is not trivially verifiable in
the context of SPARQL updates, where DELETE/INSERT atoms are instantiated by
a WHERE clause, and clashing triples could be instantiated within the same INSERT
operation. We have addressed this problem by providing means to check whether a
SPARQL update is intrinsically consistent and defining a safe rewriting that removes
intrinsic clashes during inserts on-the-fly.
      </p>
      <p>
        Next, taken that the problem of intrinsic consistency is solved, we have demonstrated
how to extend the approach of [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] to SPARQL updates. We have defined a materialization
and consistency preserving rewriting for SPARQL updates that essentially combines the
ideas of [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and our previous work on SPARQL updates under RDFS for materialized
triple stores [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], dealing with clashes due to class disjointness axioms in a brave manner.
That is, we overwrite inconsistent information in the triple store in favor of information
being inserted. Alternatively, we have also defined a dual consistency-preserving update
semantics that on the contrary discards insertions that would lead to inconsistencies.
      </p>
      <p>
        Besides practical evaluation of the proposed algorithms, we plan to further extend
our work towards increasing coverage of more expressive logics and OWL profiles,
namely additional axioms from OWL 2 RL or OWL 2 QL [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Also, it could be useful
to investigate further semantics, allowing for compromises between fully discarding the
inconsistent old data and refusing the entire update due to clashes, and lift our methods
to work with stores that are not fully materialized.
      </p>
      <p>
        The consideration of negative information is an important issue also in other related
works on knowledge base updates: for instance, the seminal work on database view
maintenance by Gupta et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is also used in the context of materialized views using
Datalog rules with stratified negation. Likewise, let us mention the work of Winslett [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]
on formula-based semantics to updates, where negation is also considered.
Acknowledgements. This work was supported by the Vienna Science and Technology
Fund (WWTF), project ICT12-SEE, and EU IP project Optique (Scalable End-user
Access to Big Data), grant agreement n. FP7-318338.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Ahmeti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Updating RDFS aboxes and tboxes in SPARQL</article-title>
          .
          <source>In: Proc. of the 13th Int. Semantic Web Conf. (ISWC). Lecture Notes in Computer Science</source>
          , vol.
          <volume>8796</volume>
          , pp.
          <fpage>441</fpage>
          -
          <lpage>456</lpage>
          . Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Beckett</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prud</surname>
          </string-name>
          'hommeaux, E.,
          <string-name>
            <surname>Carothers</surname>
          </string-name>
          , G.:
          <article-title>RDF 1.1 Turtle - Terse RDF Triple Language</article-title>
          .
          <source>W3C Recommendation, World Wide Web Consortium (Feb</source>
          <year>2014</year>
          ), available at http://www.w3.org/TR/turtle/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Tractable reasoning and efficient query answering in description logics: The DL-Lite family</article-title>
          .
          <source>J. of Automated Reasoning</source>
          <volume>39</volume>
          (
          <issue>3</issue>
          ),
          <fpage>385</fpage>
          -
          <lpage>429</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kharlamov</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nutt</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zheleznyakov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Evolution of DL-Lite knowledge bases</article-title>
          .
          <source>In: Proc. of the 9th Int. Semantic Web Conf. (ISWC). Lecture Notes in Computer Science</source>
          , vol.
          <volume>6496</volume>
          , pp.
          <fpage>112</fpage>
          -
          <lpage>128</lpage>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. De Giacomo,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Lenzerini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Poggi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Rosati</surname>
          </string-name>
          , R.:
          <article-title>On instance-level update and erasure in description logic ontologies</article-title>
          .
          <source>J. of Logic and Computation</source>
          <volume>19</volume>
          (
          <issue>5</issue>
          ),
          <fpage>745</fpage>
          -
          <lpage>770</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Gearon</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Passant</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>SPARQL 1.1 update. W3C Recommendation, World Wide Web Consortium (Mar</source>
          <year>2013</year>
          ), available at http://www.w3.org/TR/ sparql11-update/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mumick</surname>
            ,
            <given-names>I.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Subrahmanian</surname>
            ,
            <given-names>V.S.:</given-names>
          </string-name>
          <article-title>Maintaining views incrementally</article-title>
          .
          <source>In: Proc. of the ACM SIGMOD Int. Conf. on Management of Data</source>
          . pp.
          <fpage>157</fpage>
          -
          <lpage>166</lpage>
          (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Hayes</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <source>: RDF 1.1 semantics. W3C Recommendation, World Wide Web Consortium (Feb</source>
          <year>2014</year>
          ), available at http://www.w3.org/TR/rdf11-mt/
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milicic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Updating description logic ABoxes</article-title>
          . In: Doherty,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Mylopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Welty</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.A</surname>
          </string-name>
          . (eds.)
          <source>Proc. of the 10th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR)</source>
          . pp.
          <fpage>46</fpage>
          -
          <lpage>56</lpage>
          . AAAI Press (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fokoue</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>OWL 2 Web Ontology Language profiles (second edition)</article-title>
          .
          <source>W3C Recommendation, World Wide Web Consortium (Dec</source>
          <year>2012</year>
          ), available at http://www.w3.org/TR/owl2-profiles/
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Muñoz</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pérez</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gutiérrez</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Minimal deductive systems for RDF</article-title>
          .
          <source>In: Proc. of the 4th European Semantic Web Conf. (ESWC). Lecture Notes in Computer Science</source>
          , vol.
          <volume>4519</volume>
          , pp.
          <fpage>53</fpage>
          -
          <lpage>67</lpage>
          . Springer (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hogan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Delbru</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Umbrich</surname>
            ,
            <given-names>J.: RDFS</given-names>
          </string-name>
          &amp;
          <article-title>OWL reasoning for linked data</article-title>
          .
          <source>In: Reasoning Web. Semantic Technologies for Intelligent Data Access - 9th Int. Summer School Tutorial Lectures (RW), Lecture Notes in Computer Science</source>
          , vol.
          <volume>8067</volume>
          , pp.
          <fpage>91</fpage>
          -
          <lpage>149</lpage>
          . Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Winslett</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          : Updating Logical Databases. Cambridge University Press (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>