Abstract
We show how a subpart of OWL ontologies and Semantic Web Rule Language (SWRL) rules can be represented as bigraphs and bigraphical reaction rules. While OWL allows for defining a static ontology and SWRL allows for inferring and adding more information to an ontology, we show that the bigraphical representation of ontologies and rules naturally allows for more general dynamic changes and modification of ontologies. We describe how the representation is implemented in BigRED, a recently developed Eclipse-based bigraphical editing tool allowing to simulate and perform state exploration in the defined systems using the BigMC bigraph model checker which is integrated in the BigRED editor. We discuss the potential uses of the approach for model-driven design and analysis of context-aware systems, and propose a first naive method to deal with the frame and ramification problems in the bigraphical ontology.
Keywords
- Model Checker
- Resource Description Framework
- Operative Node
- Reaction Rule
- Resource Description Framework Graph
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This research work is supported by the Jingling Genie project, funded by the Danish Council for Strategic Research in Denmark (Grant No. 2106-08-0046), 2009–2013.
We show how a subpart of OWL ontologies and Semantic Web Rule Language (SWRL) rules can be represented as bigraphs and bigraphical reaction rules. While OWL allows for defining a static ontology and SWRL allows for inferring and adding more information to an ontology, we show that the bigraphical representation of ontologies and rules naturally allows for more general dynamic changes and modification of ontologies. We describe how the representation is implemented in BigRED, a recently developed Eclipse-based bigraphical editing tool allowing to simulate and perform state exploration in the defined systems using the BigMC bigraph model checker which is integrated in the BigRED editor. We discuss the potential uses of the approach for model-driven design and analysis of context-aware systems, and propose a first naive method to deal with the frame and ramification problems in the bigraphical ontology.
1 Introduction
In theWang, Wusheng Hildebrandt, Thomas T. present paper we describe how dynamic OWL ontologies and SWRL semantic web rules can be represented as bigraphical reactive systems [19, 20]. The work is a step towards an operational formalization of context-aware systems (CAS) that at the same time supports representation and reasoning about a dynamically changing context model and the context-aware agents and services of interest.
In CAS, services and agents adapt to perform the most appropriate behavior based on context information [35]. For instance, context information could inform services about the current user and her current tasks, and provide the services for which she is authorized and which are most relevant when performing the current task. Since proposed by Schilit and Theimer in 1994 [31], CAS have been widely studied, and a great number of context-aware applications have been developed or are under research (see e.g. [36, 37]).
Representation of context information and context-aware behavior are essential parts of work in CAS. Different variations of process calculi [27, 34, 39] and amended coloured Petri net [4] have been introduced and studied for reasoning about context-aware behavior in CAS. However, these models typically have a rather simplistic representation of the context information.
We believe it is critical to have a more general context model that can naturally accommodate a variety of features and relationships between context information as well as adaptations to the model during runtime, as a response to e.g., changes in user needs or changes in knowledge about the context.
Probably the most common examples of general context models are key-value pairs [30] and OWL ontologies [9, 17]. An ontology is defined as an “explicit specification of a conceptualization” [8], and OWL (Web Ontology Language) is the ontology language endorsed by the World Wide Web Consortium (W3C) [22, 23]. An OWL model is built by defining \(classes\) (or \(concepts\)) for sets of \(individuals\) (or \(instances\)), and using \(properties\) to relate individuals to individuals (i.e., \(object\) \(properties\)) or individuals to XML Schema type values (i.e., \(datatype properties\)) [40]. Some advanced relationships are also allowed in OWL, e.g., class disjointness and property cardinalities [22].
The Semantic Web Rule Language (SWRL) [13] provides a way to infer and add more information to an ontology, but not to remove or alter knowledge. Several technologies for dynamic ontologies, such as ontology evolution and ontology revision, have been studied in the past few years. Some researches focus on ontology evolution in particular fields, e.g., multimedia interpretation [5]. Different ways to work out ontology revision have been studied, such as providing multiple versions of ontologies [12]. Removal or alteration of knowledge in a context model may violate previously inferred facts. This is well-known as non-monotonic reasoning [41], used for e.g., common sense reasoning, and leads to the frame and ramification problems [1, 16, 18]. Intuitively, the frame problem is to identify what does \(not\) change when an update is made to the knowledge base [32], and the ramification problem is that changes can have indirect consequences.
While reasonable solutions of modelling context and modelling context-aware behavior have been proposed on their own, only recently formalizations have been provided [2, 24] that at the same time encompass and support reasoning about the dynamically changing context model and the context-aware behavior of the services and agents interacting with the services. The two approaches both utilize Bigraphical Reactive Systems (BRS), introduced by Robin Milner in 2001 as a meta-model [19, 20] in which to formalize modelling languages for reactive systems. The short term goal was to provide a meta-model in which the existing formal models for reactive, concurrent systems could be naturally expressed. The long term goal was indeed to provide a foundation for ubiquitous computing systems which would require not only formalizations of existing formal models for concurrent systems, but also formalizations of context information, industrial standards, etc.
The BRS meta-model has been shown to encompass several foundational models such as CCS, \(\pi \)-calculus, Mobile Ambients [14], Petri nets [20, 38] and parts of the Business Process Execution Language (BPEL) standard [3] as BRS instances. The so-called Plato-graphical systems in [2] and the work on BigActors [24] combining bigraphs and actors have taken the first steps to achieve the long-term goal of representing CAS in BRS. The work in the present paper can be seen as a next step of making the abstract context modelling in [2] more operational, by showing how the industrial standard ontology and rule languages OWL and SWRL can be represented within BRS and how BRS and the state of the art design tools for BRS can represent and simulate dynamically changing context models.
The first technical contribution of the present paper is to demonstrate how a sub-part of OWL (named \(OWL_S\)) ontologies and SWRL inference rules can be represented as a BRS instance that leverages the close relationship between bigraphs and the graph structure of ontologies. Since OWL is a W3C standard which has been identified as a good candidate for representation and sharing of context information [9, 17], and SWRL is the W3C standard for inference of knowledge from OWL models, we believe that this is a very relevant contribution towards the long term goal of providing a foundation for ubiquitous computing. The second technical contribution is a demonstration of how the formalization can be extended to support dynamic updates in a consistent way, avoiding the frame problem and also solving the ramification problem (both of them are introduced in the next section). The presentation utilizes the recently developed BRS tools, the Eclipse-based BigRED editing tool [7]Footnote 1, and the BigMC [26] model checker which has been integrated in BigRED.
The rest of the paper is structured as follows. In Sect. 2 we first introduce the subpart of Web Ontology Language \(OWL_S\), the Semantic Web Rule Language and Bigraphical Reactive System, together with the frame and ramification problems, using a motivating example for CAS. We then show in Sect. 3 how \(OWL_S\), SWRL and dynamic updates of ontologies can be represented as a bigraphical reactive system instance. Finally we conclude and give pointers to future work in Sect. 4.
2 Preliminaries
In this section, a subpart of Web Ontology Language \(OWL_S\), the Semantic Web Rule Language SWRL, the Bigraphical Reactive System BRS, non-monotonic reasoning, and the frame and ramification problems are introduced using a motivating example for CAS.
2.1 \(OWL_S\) and SWRL by Example
An OWL ontology defines classes for sets of individuals and uses properties to relate individuals to individuals (i.e., object properties) or individuals to XML Schema type values (i.e., datatype properties). The OWL ontology is developed as a vocabulary extension of W3C Resource Description Framework (RDF) [22]. An OWL ontology can thus be expressed as a set of RDF triples [29]. To keep the exposition simple in the present paper, we constrain values to strings and concentrate on a subpart of OWL language named \(OWL_S\) defined abstractly as follows.
Definition 1
(\(OWL_S\)) An \(OWL_S\) ontology is a tuple
where
-
\(C\) is a finite set of (names of) user-defined classes,
-
\(P=\{rdfs:subClassOf, rdfs:subPropertyOf, rdf:type\}\uplus Prop\), where \(rdfs:subClassOf\), \(rdfs:subPropertyOf\) and \(rdf:type\) are predefined predicates and \(Prop=Prop_O \uplus Prop_D\), where \(Prop_O\) and \(Prop_D\) are a finite set of user-defined object and datatype properties respectively.
-
\(I\) is a finite set of (names of) individuals,
-
\(V\) is a finite set of (string) values (assumed distinct from \(C\), \(P\) and \(I\)) and
-
\(R\subseteq (C\times \{rdfs:subClassOf\} \times C) \cup (I \times \{rdf:type\} \times C) \cup (Prop \times \{rdfs:subPropertyOf\}\times Prop) \cup (I \times Prop_O \times I) \cup (I \times Prop_D \times V)\) represents the RDF triple relationships.
For a triple \((sub,pred,obj)\in R\) we refer to the three components \(sub\), \(pred\) and \(obj\) as the subject, predicate and object respectively.
Please note that in \(OWL_S\) (as in OWL) one class can have several super-classes and the subclass relation can in fact be cyclic, which implies equivalence of classes. Similarly, one property can extend several super-properties, and one individual can belong to several classes simultaneously. An \(OWL_S\) ontology is also an OWL ontology, and thus an OWL 2 ontology.
As running example we use an ontology defining a context model for a simple CAS named TalkingBadge [10, 11], in which users have assigned badges, that have Bluetooth antennas and can be detected and located by sensors in a number of zones. The tuple representation of the ontology is defined as follows:
-
\(C=\{Person,Badge,Place,Zone\}\),
-
\(Prop=\{hasA,hasABadge,hasOccupation,locatedIn\}\),
-
\(I=\{Thomas,ZoneA,ZoneB,ZoneC,BadgeThomas\}\),
-
\(V=\{Professor\}\),
-
and \(R=\{(Zone,rdfs:subClassOf,Place),(ZoneA,rdf:type,Zone), (Z-oneB,rdf:type,Zone),(ZoneC,rdf:type,Zone),(Thomas,rdf:type,Pe-rson),(Thomas,hasOccupation,Professor),(BadgeThomas,rdf:type,Badge), (Thomas,hasABadge,BadgeThomas),(hasABadge,rdfs:sub-PropertyOf,hasA),(BadgeThomas,locatedIn,ZoneC)\}\)
Figure 1 below shows the ontology viewed as an RDF graph. However, note that it does not show the subPropertyOf relation but instead the relation derived from the rule that a sub-property relation implies the super-property relation. Also, it includes the “top” OWL class Thing, which is not explicitly given in the ontology above.
The ontology has four user-defined classes: Person, Badge, Place, and Zone, and Zone is a subclass of Place, which is implicitly a subclass of Thing like Person and Badge. The rdf:type relationship indicates which class an individual belongs to. The model thus has individuals representing three zones, ZoneA, ZoneB and ZoneC, one person, Thomas, and one badge, BadgeThomas. The person Thomas has the object property Thomas hasABadge BadgeThomas and the datatype property Thomas hasOccupation Professor. Finally, there is an example of the RDF subPropertyOf relation, hasABadge rdfs:subPropertyOf hasA.
Using SWRL we can infer derived knowledge. For instance, we can identify the location of a person by where his badge has been detected, and provide personalized context-aware services according to the position, and possibly other context information related to the person.
An SWRL rule that utilizes that the owner of the badge is in the same place as the badge to infer the location of a person can be written as follows:
SWRL rules can be applied to ontologies using rule engines such as the Jess rule engine [15] in Protègè [28], and indeed after applying the SWRL rule above, the OWL model shows that Thomas is in ZoneC.
If we only need to infer and add new relationships to the existing knowledge, SWRL works well. However, one sometimes needs to delete or modify a relationship, such as changing the location of BadgeThomas from ZoneC to ZoneB. SWRL cannot express the deletion nor the modification of existing information, and for good reason: If information is changed, knowledge that has been inferred previously may cease to be valid.
2.2 BRS by Example
A Bigraphical Reactive System instance is a graph rewriting model for a specific kind of graphs called bigraphs. A bigraph consists of two graphs (explaining the name bigraph), referred to as the place graph and the link graph. A key feature of bigraphs is that they can be composed (and decomposed), allowing to define bigraphs compositionally from smaller bigraphs.
In the center of Fig. 2 there is a bigraph representing the example ontology in Sect. 2.1 (however, note that this is only for illustration and not the representation of ontologies we define later). The place graph and the link graph are shown to the left of the bigraph. To the right is given an example of a decomposition of the bigraph in two smaller bigraphs, to be explained below.
The place graph is a finite set of nodes, labelled by so-called controls (such as ZoneA and BadgeThomas in Fig. 2) and topologically ordered by a nesting relation. We use different shapes of nodes to distinguish different controls in the graphical representation. In other words, the place graph is (a set of) labelled finite trees, similar to the nesting of elements in an XML document, which can be used to represent syntax trees of programming and modelling languages but also physical or logical localities. The link graph consists of a finite set of ports, a finite set of names and a set of (hyper) edges connecting the ports and names. The two graphs are glued together by locating the ports on the nodes of the place graph, shown as the small dots on the nodes of BadgeThomas and Thomas in Fig. 2. Thinking of the analogy between the place graph and nested elements of an XML document, the ports of the link graph thus corresponds intuitively to the attributes of the XML elements, and names linked to ports the values of attributes.
The link graph in this way makes it possible to describe (hyper) relations between nodes across and independently of the nesting structure of the place graph, which can be used to model shared names/references within programming languages or shared knowledge among individuals in the physical world.
The place graph has zero or more roots (top nodes) which are referred to as regions and represented as dashed boxes, and zero or more holes among the leaves, represented as grey boxes. The set of names in the link graph is partioned in two sets, the set of outer names and the set of inner names. An outer name can be connected to at most one edge of the link graph, and inner names must be connected to an edge.
The place graph of the bigraph in Fig. 2 has a single region indicated by the dashed box and no holes. The link graph has no outer names nor inner names. In the decomposition to the right, the top bigraph has a single hole (indexed 0) and single inner name \(a\), and the bottom bigraph has a single region and a single outer name \(a\).
In general, if a place graph \(G_P\) has \(n\) holes and \(G_P'\) has \(n\) regions, they can be composed forming the place graph \(G_P\circ G_P'\) defined as the graph obtained by replacing the \(i\)th hole of \(G_P\) by the contents of the \(i\)th region of \(G_P'\).
If a link graph \(G_L\) has inner names \(X\) and \(G_L'\) has outer names \(X\), they can be composed forming the link graph \(G_L\circ G_L'\) defined as the graph obtained by joining the graphs by taking the union of ports and edges, removing the inner names of \(G_L\) and outer names of \(G_L'\) and identifying an edge connected to an outername \(x\) of \(G_L'\) to the edge connected to the inner name \(x\) of \(G_L\).
The reader can verify that the two bigraphs to the right in Fig. 2 can be composed and the composition is the bigraph in the center. Note that only the nesting matters in the place graph, so it makes no difference that the badge is to the left of Thomas in the center bigraph and the badge is to the right of the hole (in which Thomas is placed) in the top bigraph in the decomposition.
For self-containment we include the formal definition of pure bigraphs here. A complete introduction to bigraphs is given in [21]. We follow [21] and regard a finite ordinal \(n\in \omega \) as a set \(\{0,\ldots ,n-1\}\).
Definition 2
(Pure bigraph) Let \(\varSigma =(C_\varSigma ,ar_\varSigma )\) be a signature defining a finite set \(C_\varSigma \) of controls and an arity \(ar_\varSigma :C_\varSigma \rightarrow \omega \) assigning for each control \(c\in C_\varSigma \) a finite ordinal determining its number of ports.
For finite ordinals \(m\) and \(n\) dermining respectively the number of holes and regions and finite sets \(X\) and \(Y\) of respectively inner names (drawn below regions and connected to a unique edge) and outer names (drawn above regions and connected to at most one edge), a pure bigraph over the signature \(\varSigma \) with type \(\langle m, X\rangle \rightarrow \langle n, Y \rangle \) is then a tuple \((V, E, ctrl, prnt, link)\) where
-
\(V\) is a set of (place graph) nodes,
-
\(E\) is a set of (link graph) edges,
-
\(ctrl:V\rightarrow C_\varSigma \) is a control map,
-
\(prnt:m \uplus V\rightarrow V \uplus n\) is a (place graph) parent map,
-
\(link:P\uplus X\rightarrow Y \uplus E\) defines the link graph with \(P=\biguplus _{v\in V}ar_\varSigma (ctrl(v))\) being the set of ports.
Composition is used in the definition of parametric rewrite rules and could be used for compositional definition of context models. However, instead of the composition operator, we consider two derived operations, the so-called merge product and the nesting operator which is similar to the usual parallel composition and prefixing in process calculi. Indeed, Perrone proposed in [25] a Bigraphical Meta-Calculus (BMC) allowing an instance of pure BRS to be defined process algebraically as an instance of BMC. Following [25], we define a subpart of the BMC syntax that will be used in this paper.
Definition 3
(Subpart of the BMC syntax) For a signature \(\varSigma =(C_\varSigma ,ar_\varSigma )\), the process terms \(P\) representing bigraphs are defined by the grammar
where \(c\in C_\varSigma \) and \(\overline{x}\) is a sequence of \(ar_\varSigma (c)\) names.
The \(nil\) process denotes the bigraph with a single region and no place graph nodes, holes or link graph edges. The indexed hole
denotes a bigraph with a single region containing a single hole. The parallel composition \(P\mid P'\) denotes the merge product of the denotation of \(P\) and \(P'\).Footnote 2 The merge product of two bigraphs with a single region joins the regions of the two bigraphs into one, and also joins identical outer names. To the left in Fig. 3 is illustrated the parallel process \(c[x,y].nil\mid c'[y].nil\). The Prefix process \(c[\overline{x}].P\) denotes the bigraph obtained by placing the contents of the single region of the denotation of \(P\) inside a place graph node with control \(c\) and \(ar_\varSigma (c)\) ports, which are linked to the corresponding outer names in \(\overline{x}\) and joined with the outer names of \(P\) as in the merge product. This is also referred to as the nesting of a bigraph with a single node with control \(c\) (and ports mapped to \(\overline{x}\)) which contains a hole and the denotation of \(P\) as exemplified to the right in Fig. 3, showing the denotation of the process \(c[x,y].c[y,z].nil\) as the nesting of \(c[x.y]\).
and \(c[y,z].nil\). Finally, the restriction \((/x)P\) keeps name \(x\) within bigraph \(P\), and thus \(x\) can not appear as an outer name of \(P\).
Although Fig. 2 shows that we could build the example ontology as a bigraph using the nesting of place graph nodes to express some of the relations, it is not as general as OWL since the place graph can not contain cycles. Instead we define a general mapping of an ontology in \(OWL_S\) to a flat bigraph \(BRS_{OWL}\), with no nesting in the place graph.
Below we present \(BRS_{OWL}\) as it is defined in the BigRED tool.
To define a BRS model language instance in the meta-model, one first gives a signature defining the set of controls labelling the nodes of the place graph, and the arity for each control, i.e., the number of ports for nodes with that control. Figure 4 below shows the controls in the signature of \(BRS_{OWL}\) for the example ontology given in Fig. 1 as defined and visualized in the BigRED tool. Each control has a (user-defined) graphical layout as a shape that allows nesting and is defined with a small polygon (and circle) editor embedded in BigRED. The small dots assigned to the border of the shape with names indicate the ports to which links of the link graph can be attached.
Below the graphical representation is given the name of the control, followed by a colon and an integer indicating the number of ports. For instance, the first control \(C\), which is used to model OWL classes, has a circle as graphical representation and a single port \(Port\_C\), which will be linked to a control providing the name of the class. Similarly, the controls \(P\) and \(I\) are used to model OWL predicates (including both predefined predicates like \(rdf:type\), \(rdfs:subClassOf\) and \(rdfs:subPropertyOf\), and user-defined properties such as object properties and datatype properties) and individuals respectively.
Finally, we utilize that the BigRED tool allows to parametrize control names with values of a certain type (i.e., the control (value:Type)), effectively defining an infinite set of controls. For instance, (Person:String) can be used to define a concrete string value, stands for the bigraphical representation of the name of the OWL class Person, and (Thomas:String) represents another String value that shows the name of a person called Thomas. For simplicity, in the examples of this paper we omit the type part of the control together with the brackets, and show the value part only. For example, we will write Person instead of (Person:String).
The full BRS representing the \(OWL_S\) ontology in Fig. 1 is shown in Fig. 5 as it is presented in BigRED. In fact, one can find that the graphical model in Figs. 1 and 5 are quite similar, except that the \(owl:Thing\) is omitted and the relations (arcs) in the RDF graph is replaced by \(P\) nodes and \((value:Type)\) nodes in the bigraphical model. We will introduce the formal transformation from an \(OWL_S\) ontology to bigraphs later.
While a bigraph defines the static model, bigraphical reaction rules represent the dynamics of the bigraph. A bigraph reaction rule is written as an arrow between two bigraphs \(R\rightarrow R'\) with the same number of regions and the same outer names, where \(R\) is called the redex and \(R'\) is called the reactum. If the redex occurs within a context that allows reaction (referred to as the active contexts), the rule can be applied and the result is that the redex is replaced by the reactum.
An example of a BRS rule is given to model the OWL rdfs:subClassOf axiom. The OWL rdfs:subClassOf axiom states that if a class \(b\) is the subclass of \(a\), then all the individuals of \(b\) are also individuals of \(a\). This axiom can be expressed in the SWRL way as follows.
Figure 6 gives a graphical expression of this axiom that has been built with BigRED. Intuitively, the rule should apply to a bigraph with two classes \(C[a]\) and \(C[b]\), and they are connected by a property \(P[b,x,a]\) named subClassOf, where the class \(C[b]\) connects with an individual \(I[i]\) by property \(P[i,y,b]\) named type. This can be expressed by the BMC process term \(C[a]\mid P[b,x,a] \mid C[b] \mid subClassOf[x]\mid I[i]\mid P[i,y,b]\mid type[y]\). The meaning of the right hand of the rule is to introduce a new type property \(P[i,z,a] \mid type[z]\) relating the individual linked to by \(i\) and the class linked to by \(a\) as shown in Fig. 6 below.
Since bigraphical reactive systems are rewriting systems, the meaning of a reaction rule is to remove the redex and replace it by the reactum. Thus to represent SWRL rules that only adds information, we need to include the redex in the reactum. The bigraphical reaction rule corresponding to the SWRL rule (expressed as an arrow between a pair of BMC processes) is thus defined as follows.
which then can react in a context \(C[a] \mid C[b] \mid I[i] \mid \)
giving rise to the reaction in Fig. 6, written as process terms:
2.3 Non-monotonic Reasoning
Non-monotonic reasoning has in particular been studied within Artificial Intelligence (AI) and so-called common sense reasoning [6, 16]. However, common sense generally involves a large set of interacted knowledge, and uncertainty and partial information sometimes exist in the knowledge because it may be expensive, time-consuming, or impossible to get complete information.
In the TalkingBadge example introduced in Sect. 2.1, if a piece of knowledge saying that BadgeThomas has been moved from ZoneC to ZoneB is added into the ontology, the former inferred knowledge that Thomas is in ZoneC will become invalid. We deal with non-monotonic reasoning and dynamically modify the bigraphical ontology model by utilizing bigraphical reaction rules.
The frame problem [16] in AI is the challenge of representing the effects of actions without having to represent explicitly a large number of intuitively obvious non-effects [33].
In the bigraphical ontology proposed in this paper, we deal with the frame problem by utilizing a split ontology, and specify which part of the knowledge should keep unchanged.
The ramification problem [18] is about the indirect effects of an action, i.e., effects that are not explicitly represented in action specifications but follow from general laws describing dependencies among the components of the world. The problem can be explained as “how to demonstrate what occurs implicitly because of an action” or “how to deal with the indirect effects of an action”. Sometimes, an action with a few direct effects may lead to several indirect changes, and brings serious problems.
In this paper we deal with the ramification problem in the bigraphical ontology simply by deleting all inferred knowledge during an update. In future work we will consider how to preserve inferred knowledge that remains valid.
3 Bigraphical Ontologies
In Sect. 3.1 below we outline how we model \(OWL_S\) ontologies as bigraphs, and in Sect. 3.2 how to model SWRL inference rules as bigraphical reaction rules. We then proceed in Sect. 3.3 to describe how dynamic updates of the ontologies can be modelled while preserving consistency of the knowledge base.
3.1 From OWL Ontologies to Bigraphs
Recall that an \(OWL_S\) ontology can be represented as a set of RDF triples of the form \((subject, predicate, object)\subseteq (Class\times \{rdfs:subClassOf\} \times Class) \cup (Individual \times \{rdf:type\} \times Class) \cup (Property \times \{rdfs:subPropertyOf\}\times Property) \cup (Individual \times ObjectProperty \times Individual) \cup (Individual \times DatatypeProperty \times Value)\) that expresses either predefined OWL predicates including \(rdf:type\), \(rdfs:subClassOf\) and \(rdfs:subPropertyOf\) or user-defined object properties and datatype properties.
We first describe informally how each component will be transferred into a bigraph, and then give the formal transformation definition.
Literal values in the OWL ontology are values of specific XML Schema types. A value value of type Type will be represented by a parametrized control (value:Type) as supported by the BigRED and BigMC tools. And thus, a string literal value Thomas (giving the name of the individual Thomas) will be mapped to the control (Thomas:String). As shown in Fig. 4 the control is represented graphically as a box and has a single port, named Port_Value, which is used to link the value to the controls in which it is used, e.g., the control of class, property and individual as described below.
Classes are represented by nodes in the place graph with a control C represented graphically in Fig. 4 by a circle. The single port (named Port_C) connects to the unique port of a node with a literal value control, i.e., of the form (value:Type), which provides the name of the class.
Properties (and axioms) are represented by nodes with control P corresponding to RDF triples, and represented graphically as a diamond in Fig. 4. The second of the three ports, named Port_P_2, is linked to a node with a (value:Type) control, providing the name of the property. The first and third port, (Port_P_1 and Port_P_3), connect similarly to (value:Type) nodes providing the name of the subject and the object respectively.
Individuals in OWL are always related to one or more classes by the property rdf:type. In the bigraphical representation, we use \(P\) nodes to link it to \(C\) nodes to identify which classes it belongs to. The only port (i.e., Port_I) is linked to a (value:Type) node, expressing the name of the individual.
In a BRS instance model, by default, any nesting of nodes and any linking of ports in the place graph is allowed. However, we often want a specific grammar (or schema as it is called for XML) that restricts how nodes with specific controls can be nested and also how ports of different controls can be linked. In our ontology BRS named \(BRS_{OWL}\) we want to restrict which ports can be linked to guarantee the typing of the relations. We also disallow nesting in the place graph (which can also be done by declaring all controls atomic).
This kind of restrictions are defined as a sorting of the BRS instance model, which is given as a set of constraints on the graph. The following constraints define the sorting for the ontology BRS named \(BRS_{OWL}\):
-
No nesting of nodes is allowed.
-
Every link has exactly one Port_Value port and at most one Port_C port, Port_P_2 port or Port_I port.
-
A Port_P_2 port is linked to a single Port_Value port.
-
A Port_P_2 port of a \(P\) node is linked to a Port_Value port of a value control \(subClassOf\) if and only if the Port_P_1 and Port_P_3 of \(P\) are both linked to a single Port_C (which could be the same).
-
If a Port_P_2 port of a \(P\) node is linked to a Port_Value port of a value control \(subPropertyOf\) if and only if the Port_P_1 and Port_P_3 of \(P\) are linked to two distinct Port_P_2 ports.
-
If a Port_P_2 port of a \(P\) node is linked to a Port_Value port of a value control \(type\) if and only if the Port_P_1 of \(P\) is linked to a single Port_I port and Port_3 of \(P\) is linked to a single Port_C port.
-
If a Port_P_2 port of a \(P\) node is linked to a Port_Value port of a value control different from \(type\), \(subClassOf\) and \(subPropertyOf\) then Port_P_1 of \(P\) is linked to a single Port_I and Port_3 of \(P\) is linked to either a single Port_I or a single Port_Value.
The first step of the bigraphical representation of ontologies is to define a map \(O2B\) from \(OWL_S\) ontologies of the form \(O=(O_C,O_P,O_I,O_V,O_R)\) as defined in Definition 1 to a BRS instance \(BRS_{OWL}\) with the signature \((C_{OWLS},ar_{OWLS})\), where \(C_{OWLS}=\{C,P,I,(value:String)\}\) and \(ar_{OWLS}(C)=ar_{OWLS}(I)=ar_\varSigma (value:String)=1\), and \(ar_\varSigma (P)=3\), as shown in the BigRED layout in Fig. 4. We first use the BMC syntactical representation to define a bigraph \(O2B'(O)\) where all edges are mapped to outer names and writing \(\Pi _{i\in \{1,2,\ldots n\}} P_i\) for \(P_1 \mid P_2 \mid \cdots P_n\). We then define \(O2B(O)\) as the bigraph obtained by removing all outer names in \(O2B'(O)\). For simplicity we assume classes, instances and values are disjoint names and that all properties are used at least once. It is not difficult to define a representation of the general case, but the sorting and naming of links becomes a bit more complex.
Definition 4
(Transformation from \(OWL_S\) ontology to bigraphs) Given an \(OWL_S\) ontology \(O=(O_C,O_P,O_I,O_V,O_R)\) define the corresponding bigraph \(O2B'(O)= [[O_C]] \mid [[O_I]] \mid [[O_V]] \mid [[O_R]]\) where
-
\([[O_C]]= \Pi _{c\in O_C} C[c] \mid c[c]\)
-
\([[O_I]]= \Pi _{i\in I_C} I[i] \mid i[i]\)
-
\([[O_V]] = \Pi _{v\in O_V} v:String[v]\)
-
\([[O_R]]= \Pi _ {(x,p,x')\in O_R} p[(x,p,x')] \mid P[x,(x,p,x'),x'] \)
where \((x,p,x')\) is regarded as the unique name constructed from \(x\), \(p\) and \(x'\) linking the property control for the property \(p\) relating \(x\) to \(x'\) to its name control. Finally, define \(O2B(O)=(/X)O2B'(O)\) for \(X=O_C\cup I_C\cup O_R\cup O_V\).
It is straightforward to verify that the resulting bigraph satisfies the sorting.
For the map in the other direction, we first show that if a bigraph \(G\) in \(BRS_{OWL}\) satisfies the sorting constraints (and again we for simplicity assume that classes, individuals and values are disjoint) then it can be defined as a bigraph of the form
for some disjoint sets \(O_C\), \(O_P\), \(I_C\), \(O_V\) and \(O_R\) and \(X=O_C\cup O_V\cup I_C\cup O_R\). The corresponding \(OWL_S\) ontology \(B2O(G)\) is then defined to be the tuple \((O_C,\{p\mid (x,p,x')\in O_R\}, O_I,O_V,O_R)\).
Proposition 1
For the maps \(O2B\!:\!OWL_s \rightarrow BRS_{OWL}\) and \(B2O\!\!:BRS_{OWL} \rightarrow OWL_s\) and any ontology \(O\) in \(OWL_S\) it holds that \(B2O(O2B(O))=O\).
3.2 SWRL Representation
An SWRL inference rule is usually written as \(A \Rightarrow B\).
The left hand side, \(A\), is called the \(antecedent\) and \(B\) is called the \(consequent\). Both \(A\) and \(B\) are conjunctions of \(atoms\). An atom, which corresponds to an RDF triple, is of the form \(predicate(subject, object)\).
We now proceed to show how an SWRL rule can be represented as a bigraphical reaction rule. Intuitively, the redex will correspond to the antecedent \(A\), while the reactum will be a bigraph representing both the antecedent and the consequent \(B\). The reason that we include also the antecedent in the reactum is that the bigraph reaction will remove the redex and replace it by the reactum.
Definition 5
(Transfer SWRL rule to bigraphical reaction rule) For a SWRL rule \(R\): \(A \Rightarrow B\), the representation with bigraphical reaction rule \(O2B(R)\) is \(O2B(A)\rightarrow O2B(A)\mid O2B(B)\).
For instance, the rule in (1) for inferring the location of a person from the location of his associate badge in the example in Sect. 2.1 is represented as the bigraphical rule \(ANT \rightarrow ANT \mid CON\) where
The predicate part of the atom is expressed using the merge product of the P node that represents the property and the corresponding (value:Type) nodes that express the name of the property, as well as the corresponding nodes that represent the subject or object.
For the antecedent, we again combine each of the transformed atoms that conjunct with each other in the SWRL rule by using merge product. In the reactum we then take the merge production of the antecedent and the consequent.
As already indicated in Sect. 3.1, we express the axiom rules in OWL in a similar way. For instance, the axiom expressing that rdfs:subClassOf shown in the SWRL syntax in (2) is represented as the rule in (3).
Similarly, the axiom that rdfs:subPropertyOf means that a property contains all the relationship that its subproperties have is expressed as
Correctness for Inference Rules. We can now extend the definition of correctness to cover inference rules. Intuitively, an inference rule for the ontology represents adding new triples into existing triples. We will write \(O\rightarrow _{R} O'\) for the application of rule \(R\) (axiom or user-defined rule) to the ontology \(O\), resulting in the updated ontology model \(O'\). We write \(B\rightarrow _{O2B(R)} B'\) for the application of the corresponding reaction rule to a bigraph \(B\).
The correctness of the rule representation is then stated as follows.
Proposition 2
For an ontology \(O\) in \(OWL_S\) it holds that
-
1.
\(O\rightarrow _R O'\) implies \(O2B(O)\rightarrow _{O2B(R)} B'\) for some \(B'\)
-
2.
\(O2B(O)\rightarrow _{O2B(R)} B'\) implies \(O\rightarrow _R O'\) and \(B2O(B')=O'\)
The combination of the two parts of the proposition ensures that an inference can be matched by a corresponding reaction in the bigraphical representation and vice versa.
3.3 Dynamic Ontologies as BRS
We now show how to represent dynamic changes and formalize it in the bigraphical reactive system. The motivating example is that we want to be able to represent that a badge changes location by destructively updating the ontology describing the context. The challenge is that such destructive updates may make some of the previously inferred knowledge inconsistent.
In our example, if BadgeThomas moves from ZoneC to ZoneB and we had previously inferred the knowledge that the location of Thomas is in ZoneC, it will now become false and should be deleted from the model. This is the non-monotonic reasoning described in Sect. 2.3, and we will also deal with the frame and ramification problems below.
Instead of maintaining a single ontology, we maintain a pair \((O_{base},O_{inf})\) of (partial) ontologies (each represented as a sequence of RDF triples), referred to as a split ontology, as shown in Fig. 7. The first component, \(O_{base}\) represents the current base ontology that is the initialized ontology built by domain experts together with the series of dynamic changes that apply to the initialized ontology till now. In our example, \(O_{base}\) would be the ontology in Fig. 1 when the model starts to work (i.e., the initialized ontology, since no dynamic changes have been applied on the initialized model yet). The second component \(O_{inf}\) will hold all inferred triples since last dynamic change, e.g., the triple \(<\mathsf {Thomas},\mathsf {locatedIn},\mathsf {ZoneC}>\) in the example above.
Thus, when inferring knowledge we evaluate the antecedent of a rule to the union of the two ontologies, but only add the consequent to the \(O_{inf}\) ontology.
Now when the base ontology is updated, we simply delete the entire inferred ontology \(O_{inf}\), recorded as a transition \((O_{base},O_{inf})\rightarrow _{D}(O'_{base},\emptyset )\), where \(D\) is a dynamic update (e.g., the movement of the badge). The \(O_{base}\) part of the ontology will become \(O'_{base}\), i.e., the initialized ontology accompanied with the dynamic changes.
To represent dynamic ontologies in our BRS model, we extend the signature of \(BRS_{OWL}\) with two new controls Base:0 and Operative:0. We represent the pair \((O_{base},O_{inf})\) as in the bigraph. That is, the base ontology is nested within the Base node, and all inferred knowledge together with the base are nested inside the Operative node. The reason for not nesting only inferred knowledge inside the Operative node is that we cannot apply the redex to the union of the two parts of the bigraph as we assumed for the ontology. We thus also extend the sorting to require that there must be one and exact one Base and Operative node (and at the top level) in the model.
To place new knowledge inside the Operative node we modify the encoding of reaction rules such that they only apply to knowledge inside the Operative node and place new properties inside the Operative node, and keep the Base node unchanged. The frame problem is dealt with in this way. For instance, rule \(ANT \rightarrow ANT | CON\) will be changed to \(ANTDY \rightarrow CONDY\), where
When a dynamic change takes place in the model, the rule will work on the base model, and the content of the Operative node will be replaced by the revised base model, i.e.,
We can now finally model dynamic changes of the base model as reaction rules, that makes the change and also deletes all the previously inferred knowledge. This is how we deal with the ramification problem. One may argue that to delete all the inferred knowledge during an update is much too expensive since we have to infer again from the very beginning. However, the given strategy can be used as a reference for future, more efficient strategies. The bigraphical formalization can then be used to facilitate proving other strategies to be equivalent to the one given in this paper.
The correctness of the dynamic change representation is stated as follows.
Proposition 3
For a split ontology \((O_{base},O_{inf})\) in \(OWL_S\) and dynamic or static rule \(R\) it holds that
-
1.
\((O_{base},O_{inf})\rightarrow _R (O'_{base},O'_{inf})\) implies \( Base .O2B(O_{base}) | Operative .O2B(O_{base}\cup O_{inf})\rightarrow _{O2B(R)} Base .B' | Operative .B''\) for some \(B'\) and \(B''\).
-
2.
\( Base .O2B(O_{base})| Operative .O2B(O_{base}\cup O_{inf}) \rightarrow _{O2B(R)} Base .B' | Operative .B''\) implies \((O_{base},O_{inf})\rightarrow _R (O'_{base},O'_{inf})\) and \(B2O(B')=O'_{base}\) and \(B2O(B'')=O'_{base}\cup O'_{inf}\).
4 Conclusions and Future Work
We have described how a non-trivial subset of OWL ontologies and SWRL rules can be naturally represented as bigraphical reactive systems and exemplified the approach for ontologies used in CAS for representing context information. Motivated by the application for CAS we then proceeded to show how to extend the representation to allow for dynamic changes to the part of the ontology representing the context information. We avoid the frame problem with respect to the base knowledge and keep the inferred knowledge consistent by separating base knowledge from inferred knowledge in so-called split ontologies. We solve the ramification problem by conservatively deleting all inferred knowledge during an update. The bigraphical representation has been implemented and visualized in BigRED, a recently developed eclipse-based bigraphical editing tool, and simulated using the integrated BigMC bigraph model checker.
We currently work on defining more efficient solutions to the ramification problem, and extending the modelling to include also the behavior of real CAS developed in the Genie research project, and derive implementations and test cases for implemented systems from the models. Here we can benefit from the generality of bigraphical reactive systems and their ability to embed process languages. Finally, we plan to investigate how to use the BigMC model checker not only for simulation but for verifying interesting properties of the modelled systems.
Notes
- 1.
Big Red is available from http://bigraph.org/papers/gcm2012/.
- 2.
To be well defined, the indexes of holes in \(P\) and \(P'\) must be unique, since the order of the holes in the resulting bigraph is given by the order of the indexes.
References
Aukaszewicz, W.: Non-monotonic Reasoning: Formalization of Commonsense Reasoning. Ellis Horwood, New York (1990)
Birkedal, L., Debois, S., Elsborg, E., Hildebrandt, T., Niss, H.: Bigraphical models of context-aware systems. In: Aceto, L., Ingólfsdóttir, A. (eds.) FOSSACS 2006. LNCS, vol. 3921, pp. 187–201. Springer, Heidelberg (2006)
Bundgaard, M., Glenstrup, A.J., Hildebrandt, T., Højsgaard, E., Niss, H.: Formalizing higher-order mobile embedded business processes with binding bigraphs. In: Lea, D., Zavattaro, G. (eds.) COORDINATION 2008. LNCS, vol. 5052, pp. 83–99. Springer, Heidelberg (2008)
Byung, K.: Modeling and generating context-aware agent-based applications with amended colored petri nets. Expert Syst. Appl. 27(4), 609–621 (2004)
Castano, S., Peraldi, I.S.E., Ferrara, A., Karkaletsis, V., Kaya, A., Möller, R., Montanelli, S., Petasis, G., Wessel, M.: Multimedia interpretation for dynamic ontology evolution. J. Logic Comput. 19(5), 859–897 (2009)
Davis, E.: Common sense reasoning. In: Shapiro, E. (ed.) Encyclopedia of Artificial Intelligence, pp. l288–l294. Wiley, Chichester (1992)
Faithfull, A., Perrone, G., Hildebrandt, T.: Big red: a development envronment for bigraphs. In: Margaria, T., Padberg, J., Taenzer, G. (eds.) Selected Revised Papers from the 4th International Workshop on Graph Computation Models (GCM 2012), vol. 61. ECEASST (2013): http://www.easst.org/eceasst/
Gruber, T.R., et al.: Toward principles for the design of ontologies used for knowledge sharing. Int. J. Hum. Comput. Stud. 43(5), 907–928 (1995)
Gu, T., Wang, X.H., Pung, H.K., Zhang, D.Q.: An ontology-based context model in intelligent environments. In: Proceedings of Communication Networks and Distributed Systems Modeling and Simulation Conference, vol. 2004, pp. 270–275 (2004)
Hansen, J.P., Glenstrup, A.J., Wusheng, W., Weiping, L., Zhonghai, W.: Collecting location-based voice messages on a talkingbadge. In: Proceedings of the 7th Nordic Conference on Human-Computer Interaction: Making Sense Through Design, NordiCHI ’12, pp. 219–227. ACM (2012)
Hansen, J.P., Wusheng, W., Shklovski, I.: Talkingbadge demo. In: Proceedings of the 7th Nordic Conference on Human-Computer Interaction: Making Sense Through Design, NordiCHI ’12, pp. 771–772. ACM (2012)
Heflin, J., Hendler, J.A.: Dynamic ontologies on the web. In: Proceedings of the 17th National Conference on Artificial Intelligence and 12th Conference on Innovative Applications of Artificial Intelligence, pp. 443–449. AAAI Press (2000)
Horrocks, I., Patel-Schneider, P.F., Boley, H., Tabet, S., Grosof, B., Dean, M., et al.: Swrl: a semantic web rule language combining owl and ruleml. W3C Member submission, 21:79 (2004)
Jensen, O.H., Milner, R.: Bigraphs and mobile processes (revised), Technical report. University of Cambridge Computer Laboratory (2004)
Jess, the rule engine for the java platform. http://www.jessrules.com/jess/index.shtml
John, M.C., Patrick, J.H.: Some philosophical problems from the standpoint of artificial intelligence. In: Meltzer, B., Michie, D. (eds.) Machine Intelligence, vol. 4, pp. 463–502. Edinburgh University Press (1969). Reprinted in McC90
Kaltz, J.W., Ziegler, J., Lohmann, S.: Context-aware web engineering: modeling and applications. Revue d’intelligence Artificielle 19(3), 439–458 (2005)
Michael, T.: Ramification and causality. Artif. Intell. 89, 317–364 (1997)
Milner, R.: Bigraphical reactive systems. In: Larsen, K.G., Nielsen, M. (eds.) CONCUR 2001. LNCS, vol. 2154, p. 16. Springer, Heidelberg (2001)
Milner, Robin: Bigraphs for petri nets. In: Desel, Jörg, Reisig, Wolfgang, Rozenberg, Grzegorz (eds.) Lectures on Concurrency and Petri Nets. LNCS, vol. 3098, pp. 686–701. Springer, Heidelberg (2004)
Milner, R.: Pure bigraphs. Technical report UCAM-CL-TR-614, University of Cambridge (2005)
Owl web ontology language reference (2004). http://www.w3.org/TR/2004/REC-owl-ref-20040210/
Owl 2 web ontology language document overview, 2nd edn. (2012). http://www.w3.org/TR/2012/REC-owl2-overview-20121211/
Pereira, E., Kirsch, C.M., Sengupta, R., de Sousa, J.B.: Bigactors-a model for structure-aware computation. In: ACM/IEEE 4th International Conference on Cyber-Physical Systems (2013)
Perrone, G.: Domain-specific modelling languages in bigraphs. Ph.D. thesis, IT University of Copenhagen, Copenhagen (2013)
Perrone, G., Debois, S., Hildebrandt, T.T.: A model checker for bigraphs. In: ACM Symposium on Applied Computing - Software Verification and Tools Track, ACM SAC-SVT ’12 (2012)
Perrone, B., Gian, P.P.: On calculi for context-aware coordination. In: De Nicola, R., Ferrari, G.-L., Meredith, G. (eds.) COORDINATION 2004. LNCS, vol. 2949. Springer, Heidelberg (2004)
The protègè ontology editor and knowledge acquisition system (2004). http://protege.stanford.edu/
Rdf semantics (2004). http://www.w3.org/TR/2004/REC-rdf-mt-20040210/
Schilit, B.N., Adams, N., Want, R.: Context-aware computing applications. In: Proceedings of the 1st Workshop on Mobile Computing Systems and Applications, WMCSA ’94 (1994)
Schilit, B.U.I.N., Theimer, M.M.: Disseminating active map information to mobile hosts. IEEE Netw. 5, 22–32 (1994)
Shanahan, M.: Solving the Frame Problem: A Mathematical Investigation of the Common Sense Law of Inertia. MIT Press, Cambridge (1997)
Shanahan, M.: The Frame Problem. Wiley Online Library, New York (2006)
Siewe, F., Zedan, H., Cau, A.: The calculus of context-aware ambients. J. Comput. Syst. Sci. 77(4), 597–620 (2011)
Tong, M., Weiping, L., Weijie, C., Zhonghai, W.: An event driven model for context-aware service. In: Proceedings of the 2011 IEEE International Conference on Web Services, ICWS ’11, pp. 740–741. IEEE Computer Society, Washington (2011)
Tong, M., Weiping, L., Zhonghai, W., Weijie, C.: Framework of context-aware based service system. Jisuanji Xuebao (Chin. J. Comput.) 33(11), 2084–2092 (2010)
Weijie, C., Tong, M., Jie, C., Yuan, W., Jingmin, X., Weiping, L., Huiping, L.: A context-aware services development model. In: Proceedings of the 2012 International Joint Conference on Service Sciences, IJCSS ’12, pp. 194–199. IEEE (2012)
Wusheng, W., Perrone, G., Hildebrandt, T.: Petri nets in bigraphs revisited. In: 24th Nordic Workshop on Programming Theory, NWPT ’12 (2012)
Wusheng, W., Weiping, L., Zhonghai, W.: A process calculus for context-aware systems. In: Proceedings of the 10th International Conference on Services Computing, SCC ’13. IEEE (2013)
Wusheng, W., Weiping, L., Zhonghai, W., Weijie, C., Tong, M.: An ontology-based context model for building context-aware services. In: Proceedings of 2nd International Conference on Intelligent Systems, Modelling and Simulation, ISMS ’11, pp. 296–299. IEEE (2011)
Zadeh, L.A.: A theory of commonsense knowledge. In: Skala, H., Termini, S., Trillas, E. (eds.) Aspects of Vagueness. Theory and Decision Library, vol. 39, pp. 257–295. Springer, Netherlands (1984)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Science and Engineering Faculty
About this paper
Cite this paper
Wang, W., Hildebrandt, T.T. (2014). Dynamic Ontologies and Semantic Web Rules as Bigraphical Reactive Systems. In: Tuosto, E., Ouyang, C. (eds) Web Services and Formal Methods. WS-FM 2013. Lecture Notes in Computer Science(), vol 8379. Springer, Cham. https://doi.org/10.1007/978-3-319-08260-8_8
Download citation
DOI: https://doi.org/10.1007/978-3-319-08260-8_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-08259-2
Online ISBN: 978-3-319-08260-8
eBook Packages: Computer ScienceComputer Science (R0)