• No results found

Graph-based composite change specification

7.2 Graph-based specification of a composite change

7.2.2 Graph-based composite change specification

Usage of graph-based transformation for the representation of atomic ontology changes has been suggested in the past [Mitra et al., 2000, Shaban-Nejad et al., 2011, De Leen- heer et al., 2007]. In [De Leenheer et al., 2007], the authors adopt the idea of utilizing

Class Object Property Individual instanceOf domainOf rangeOf Data Property domainOf rangeOf XSD:Datatype subclassOf

Figure 7.1: Type graph for ontology entity relationships

PhD_Student hasSupervisor John instanceOf hasFirstName rangeOf XSD:String subClassof rangeOf Faculty Student domainOf domainOf

Figure 7.2: Typed ontology subgraph

a graph transformation approach for software evolution and applied it to ontology evo- lution. Similar to our work, they construct a metamodel for the domain ontologies in a form of type graph and domain ontologies itself are represented as typed graphs. The ontology changes are represented using graph transformation rules in AGG - a general purpose graph transformation tool. In [Shaban-Nejad et al., 2011], the authors present a graph-oriented double pushout (DPO) formalization and evolution of bio-ontologies. The authors made use of a rule-based hierarchical distributed graph transformation ap- proach. In this case, the DPO approach has been extended from flat to hierarchical graphs [Drewes et al., 2002] where transformation rules can be applied on a hierarchical level.

approach, but adapt it to our needs. The DPO approach allows us to specify the graph transformation rules and gluing conditions (discussed below), for an applied composite ontology change, in a form of pairs of graph morphisms (L←− Kl −→ R) – Figure 7.3.r First, we describe the core DPO approach following Ehrig et al. [Ehrig et al., 1973].

m1 m2 m3 g l h r pushout (1) pushout (2) (3) (1) (2) (1) (2) (3) (1) (2) (3) (3) (1) (2) (4) (3) (1) (2) (4) (3) (1) (2) (4)

G

D

H

L

K

R

Figure 7.3: Double-pushout approach for graph transformation

Referenced and ontology subgraphs. The DPO approach is called “double pushout” as the complete transformation of an input ontology subgraph G into a target ontology subgraph H is translated into two types of changes, i.e. exclusion and inclusion change operations. The DPO approach uses a graph homomorphism approach where L, K and R represent the referenced subgraphs and G, D and H represent the ontology input subgraphs. If the match m1 finds an occurrence of L in a given ontology subgraph G, then G=⇒ D denotes the derivation where l is applied to G leading to a derived graphl,m1 D (Figure 7.3). Similarly, if the match m2 finds an occurrence of K in derived ontology subgraph D, then D r,m=⇒ H denotes the derivation where r is applied to D leading to2 the output subgraph H.

The graph L is the referenced input subgraph representing items (i.e. ontology nodes or edges) that must exist in the ontology input subgraph G for the application of the composite change. In other words, graph G represents the initial state of the ontology,

i.e. the preconditions to be satisfied by the input ontology subgraph. The graph R is the referenced output subgraph representing the items that must exist in the resulting target ontology subgraph H, after the application of a composite change. In other words, graph H represents the final state of the ontology, i.e. the postconditions to be satisfied by the output ontology subgraph. The referenced graph K represents the “gluing graph” (L ∩ R), also known as interface graph, representing the graph items that must be read during the transformation but are not consumed, i.e. representing the intermediate state after the application of exclusion type atomic change operations.

Note, the graph transformation here represents the transformation of an input ontol- ogy subgraph into a target ontology subgraph. Each node here represents an ontology entity; whereas the set of graph nodes of change log subgraph (discussed in Chapter 6), are mentioned here in the form of productions (discussed below).

Graph transformation rules. The graph transformation rules, also known as produc- tions (p), refer to the change operations being applied to the subgraphs during the two pushouts. It defines the correspondence between the source and the target subgraph de- termining what is to be deleted, preserved or constructed. For example in Figure 7.3, the first production (represented as l ) refers to the exclusion change operations of pushout 1 that deletes certain items (ontology nodes or edges) from the reference input subgraph L. The second production (represented as r ) refers to the inclusion change operations of pushout 2 that adds certain items (ontology nodes or edges) into the reference gluing graph K. The productions representing the changes being applied to the input ontology subgraph G are known as co-productions and are given as g and h in Figure 7.3.

Match (m). In order to apply production l to the ontology graph, first we need to identify the occurrence of subgraph L in the ontology graph, called a “match”. For example, m1: L −→ G for a production l is a graph homomorphism, i.e. each ontology node/edge of subgraph L is mapped to a distinct ontology node/edge in subgraph G in

such a way that graphical structure and labels are preserved [Corradini et al., 1996]. The context gluing graph D is obtained by deleting all items (ontology nodes and edges) from the subgraph G which have a match (image) in the subgraph L but not in subgraph K - pushout 1. Intuitively, we can say that if a match m1 finds an occurrence of subgraph L in a given ontology subgraph G, then Gl,m1

=⇒ D represent the derivation (co-production) g where l is applied to G leading to a derived graph D. Informally, the subgraph D is achieved by replacing the occurrence of L in G by K. Similarly in pushout 2, the subgraph H is obtained by inserting distinct items (ontology nodes and edges) of subgraph R that do not have any match (image) in subgraph K (h = Dr,m2

=⇒ H).

Gluing conditions. The possible conflicts in the graph matching step are resolved by applying certain matching constraints, known as “gluing conditions”. A gluing condition consists of two parts, i.e. a dangling condition and an identification condition. The dangling condition (Cd) ensures that the graph D, obtained by applying the production l, contains no “dangling” edge, i.e. an edge without a source or a target node. For example, if an ontology node v is deleted from graph G, all the edges that contain ontology node v as a source or target node, will also be deleted. The identification condition (Ci) ensures that every item of graph G that has to be deleted by the application of production l, must have only one distinct match in the graph L, i.e. a 1:1 matching. Thus, we can say that the items from the left-hand side graph L may only be identified in resultant graph R if they also belong to the gluing graph (i.e. preserved items) [Heckel et al., 2002].