• Keine Ergebnisse gefunden

2.4 Modal Graph Schema

2.4.1 Expressive Power

In analogy to non-modal graph schemas, the semantics of a modal graph schema might be dened as the set of its instances. We formulate this denition as a claim, rather than an actual denition because we have not yet studied the properties of our conformance relation 4m.

Claim The semantics of a modal graph schemaS is the set of instances of S, i. e.,

JSKm :={DB |DB4mS}.

Subsequently, we study the consequences of this semantics of modal graph schemas w. r. t.

expressiveness. Recall that the properties of 4 led to the denition of the semantics of (non-modal) graph schemas S. Here, we study whether the claimed semantics of modal graph schemasS,JSKm, withstands its notions.

First, observe that modal graph schemas are conservative extensions of graph schemas without modalities, in that the skeleton of a modal graph schema is a graph schema. Hence, the set of instances of a modal graph schema is a subset of the instances of its skeleton.

Proposition 2.50 LetS= (TS,Σ, ES, ES) be a modal graph schema.

(I) skeleton(S)∈JSKm and (II) JSKm⊆Jskeleton(S)K4.

Proof: We show that idTS is a modal conformance witness for skeleton(S) and S. Of course,idTS is a non-empty dual simulation betweenskeleton(S) andskeleton(S) (Propo-sition 2.33) and, as such, is a conformance witness between skeleton(S) and skeleton(S). It remains to be shown that Denition 2.47 is satised. Let(v1, v2)∈idTS, i. e., idTS(v1) = v2 =v1 withv2 ES(a)w2 (w2 ES(a)v2, resp.). As v2 =v1 (by idTS), there is of course a w1 withv1 ES(a)w1 (w1 ES(a)v1, resp.) and (w1, w2)∈idTS (asw1 =w2). Hence, idTS

is indeed a modal conformance witness forskeleton(S) andS, which justies (I).

Towards (II), we show that every instance DB of S, i. e., DB 4m S, is an instance of skeleton(S), i. e., DB 4skeleton(S). There is, by Denition 2.47, a non-empty dual simulationR between DB andskeleton(S). Thus, by Denition 2.25,R is a conformance witness forDB and skeleton(S), implyingDB4skeleton(S). q. e. d.

In Section 2.3, 4 extended to graph schemas nurtured the desired semantics of graph schemas. A modal version of graph schema renement provides us with a similar extension.

Denition 2.51 (Modal Graph Schema Renement)

Let S1 = (T1,Σ, E1, E1) and S2 = (T2,Σ, E2, E2) be two modal schema graphs. S1

renesS2, denotedS14mS2, iskeleton(S1)4skeleton(S1) by renement witnessR, such that for all(v1, v2)∈R,

1. ifv2 E2(a)w2, then there is aw1 ∈T1 withv1 E1(a)w1 and (w1, w2)∈R, and 2. ifu2E2(a)v2, then there is a u1 ∈T1 with u1 E1(a)v1 and (u1, u2)∈R.

Analogously to Denition 2.35, we callR a modal renement witness. N

Example 2.52 Consider the two graph schemas S2.17 (a) and S2.17 (b) in Figures 2.17 (a) and 2.17 (b). It holds thatS2.17 (b)4mS2.17 (a), but not vice versa. WhileS2.17 (a)only allows to mention the Publisher,S2.17 (b) requires it. Hence, an instance of type Incollection certainly is also an instance of Inproceedings, but not vice versa.

The informal outcome of Example 2.52 is grounded in the following soundness result for 4m, analogously to Lemma 2.38.

Lemma 2.53 (Soundness of 4m) Let Si = (Ti,Σ, Ei, Ei) (i = 1,2) be modal graph schemas. IfS14mS2, then every instance DB of S1 is an instance of S2.

Inproceedings

Editor editor

Title title Author author

Publisher publisher

Year year Booktitle

booktitle

Month

month

Series series

Edition edition

Type type

(a)

Incollection

Editor editor

Title title Author author

Publisher publisher

Year year Booktitle

booktitle

Month

month

Series series

Edition edition

Type type

(b)

Figure 2.17: (a) Modal Graph Schema of Inproceedings (b) Modal Graph Schema of Incollection

Proof: The proof follows the same principles as performed for Lemma 2.38. We will observe that4m is a preorder that may be prolonged to modal instances on the left.

LetDB4mS1 by modal conformance witnessR1. Furthermore,S14mS2 is witnessed byR2. SinceR1 and R2 are dual simulations (cf. Denitions 2.47 and 2.51),R1◦R2 is a dual simulation by Proposition 2.33. We show that

(i) R1◦R2 is non-empty, analogously to Lemma 2.36, and (ii) R1◦R2 is a modal conformance witness.

Towards a contradicition of (i), assume R1◦R2 is the empty dual simulation. As R1 is a modal conformance witness andR2 a modal renement witness, both dual simulations are non-empty. Hence,R1◦R2 =∅ only if for every pair(u, v)∈R1, there is no matching pair(v, w)∈R2. Let(u, v)∈R1, i. e., there is now∈T2 with(v, w)∈R2. SinceR2 6=∅, there is at least one pair, say(v0, w0)∈R2. Analogously to the proof of Lemma 2.36, we show that every node v1, reachable from v0, has a partner w1 such that (v1, w1) ∈ R2. Thus, (v, w) ∈/ R2 implies thatS1 is disconnected, contradicting the assumption that S1 is a modal graph schema.

By induction, we show that for every pathπ of S1 withv0 =first(π) andv1 =last(π), there is a nodew1 ∈T2 with(v1, w1)∈R2.

Base: For|π|= 0, we have π=v0 and (v0, w0)∈R2 (by assumption).

Hypothesis: Assume for nodesv1 ∈T1, for which a pathπ fromv0withv1=last(π)and

|π|< n(n∈N) exists, there is a w1 ∈T2, such that (v1, w1)∈R2.

Step: Letπbe a path fromv0tov1with|π|=n. Thenπ=π<n·v1with|π<n|=n−1< n. By induction hypothesis, there is aw0∈T2 forv0 =last(π<n)such that(v0, w0)∈R2. Asπis a path, either (i)v0 E1(a)v1or (ii)v1E1(a)v0. AsR2 is a modal renement witness, there is aw1∈T2 withw0 E2(a)w1 (w1 E2(a)w0, resp.) and(v1, w1)∈R2. Hence, there is aw∈T2 with(v, w)∈R2, implying R1◦R2 6=∅.

Let us now tackle (ii). Since R1◦R2 is a non-empty dual simulation, we show that every pair (u, w) ∈ R1◦R2 meets the requirements of Denition 2.51, i. e., for an edge w ES

2(a) w0 (w0 ES

2(a) w, resp.), we give a u0 ∈ ODB with u EDBa u0 (u0 EDBa u, resp.) and(u0, w0)∈R1◦R2. By construction ofR1◦R2, there is a nodev∈T1 with(u, v)∈R1

and(v, w)∈R2. As R2 is a modal renement witness, there must be a node v0 ∈T1 with v ES

1(a)v0 (v0ES

1(a)v, resp.) with(v0, w0)∈R2. AsR1 is a modal conformance witness, there is a nodeu0 ∈ODB withu EDBa u0 (u0 EDBa u, resp.) with (u0, v0) ∈R1. Thus, from (u0, v0)∈R1 and(v0, w0)∈R2,(u0, w0)∈R1◦R2, which completes the proof. q. e. d.

Thus, there is also a sound design process for modal graph schemas, similar to the one described for (non-modal) graph schemas (after Lemma 2.38 on Page 29).

Unfortunately, there are modal graph schemasSandT withJSKm⊆JTKmbutS4mT. This is a well-known problem of modal renement and every renement notion xing this problem yields at least a conp-hard renement problem [80], as opposed to the Ptime complexity of checking graph schema conformance and renement [69, 86, 93].

Example 2.54 The modal graph schemas depicted in Fig. 2.18 are adapted versions of the counterexample given by Larsen et al. [80] since the original counterexample cannot cope with the dual simulation aspect of our modal renement. LetS(a) be a modal schema according to Figure 2.18 (a) andS(b) to Figure 2.18 (b). Of course S(a)4mS(b) since in any modal renement witness R, (n, m) ∈ R. But mES

(b)(b) 6= ∅, whereas n has only a b-labeled may edge, i. e., m requires b whereas n only allows it. Nevertheless, it holds

a n b (a)

a m b

l a

(b)

Figure 2.18: Counterexample Completeness of Modal Renement, adapted from [80]

that JS(a)Km ⊆JS(b)Km because for databasesDB conforming to S(a) that do not include ab-labeled edge,DB also conforms toS(b)by exploiting the non-determinism of the edges labeled by a. Nodel perfectly simulates every node with an incominga-labeled edge but

a missing outgoing b-labeled edge.

Thus, if S 4m T for modal graph schemas S and T, this does not necessarily imply JSKm⊆JTKm. In other words, JSKm for modal graph schemas S is not the set of all in-stances of S, at least not up to4m.