Javadocs | API Reference



The SWKMServices: The Change Service

About the Change Service:

The Change Service is responsible for determining the actual changes that should occur on an ontology or the related instances in response to a change request. Recall that in an RDF KB ontologies are represented by RDF namespaces while their instances by RDF graphspaces. The actual changes are not always the same as the requested ones, as the original change request could lead to invalidities if performed straightforwardly. In short, given a change request, the change service attempts to apply it to the target name or graph space in a straightforward way; if this naive application leads to an RDF KB that is meaningless, invalid or does not obey the RDF formation rules, then additional updates (called side-effects) are added to the original request to guarantee validity.

As an example, consider the removal of an ontology class shown in Figure 6.1. In that case, the removal of class B would render all associations of this class with neighbouring classes invalid. In such cases, the change service needs to determine additional change operations (side-effects) to be executed along with the original change request which would restore the validity of the KB. In our example, one such set of side-effects would be to remove all invalid associations. In addition, the implicit subsumption relation between A and C that exists (implicitly, as a consequence of the other subsumptions) in the original RDF KB, need not be lost, so it is reinstated in the result, this time in an explicit manner; this is another type of side-effect, which guarantees that only information relevant to the update is lost during the change.


Figure 6.1: Change service - removal of a class

The main input to this service is an RDF KB and a change request. The RDF KB is specified using any, arbitrarily large, collection of name and/or graph spaces. The change request could affect any of the RDF triples in this collection. However, the side-effects of the request could potentially affect triples in other, depended or depending name or graph spaces; as a result, in order for the change request to be processed in a correct way, all the depended and depending name and graph spaces should be taken into account. Therefore, the RDF KB in this case is the union of all the triples that appear in all the name or graph spaces that are directly or indirectly depending on (or are dependants of) the given ones.

Having said that, the caller of the service is given the option to restrict the considered KB, as well as the changes and their side-effects to happen in the given collection of name or graph spaces, plus, of course, those name or graph spaces that the members of this collection depend on; it should be clear that this option may not give the best possible results, as certain side-effects may not be computed.

A simple update can be either a removal or an addition of a specific RDF triple in the RDF KB. Such simple updates can be arbitrarily combined in the same update request, to form a more complicated request; thus, in principle, an update request can be an arbitrarily large set of primitive additions and removals. For example, a simple update request would be "Remove Class B", whereas a complex update request would be "Remove Class B; Remove A IsA C; Add property P with range A and domain C".

The output of the service is of the same form, i.e., a set of change operations (additions and removals), capturing all the effects and side-effects of the original change request upon the target KB (actual changes). In the example of Figure 1, the output would contain the deletion of B (direct effect), the deletion of the two IsAs (side-effect) and the explicit addition of the previously implicit IsA (side-effect). These effects and side-effects are returned tothe caller, in order to be visualized and either accepted or rejected.

The set of effects and side-effects that is produced in the output has been designed to satisfy certain properties. Firstly, the output update request should have no side-effects of its own, i.e., the straightforward application of the service's output upon the original KB should always result to a valid KB. This is necessary in order for the output update request to be easily implementable without further post-processing.

Secondly, the original change request should be part of the output, i.e., no operation belonging to the input should be ignored. This is intuitively necessary, as the user wants his update request to be part of the actual changes executed. However, there are two exceptions to this rule. The first is technical and related to the operations of the input change that encode void requests (e.g., a request to add a triple that is already present in the KB); as far as the output change is concerned, it makes no difference whether such void requests will be included or not, so, for efficiency reasons, the resulting set of effects and side-effects is filtered out. Secondly, it could be the case that a change request is infeasible, i.e., that the operation is such that it is not possible to implement it without rendering the KB invalid, regardless of what side-effects we choose to use; in such cases, the update request is rejected in its entirety (an exception is returned by the service). An example of an infeasible operation would be "Remove Class B; Add an IsA between A and B"; such an operation is infeasible, because the addition of the IsA presupposes the existence of class B, so the operation of removing class B cannot be executed together with the addition of the IsA.

Notice that, in many cases, there may be more than one possible actual changes (i.e., side-effects) that satisfy the above properties; in such cases, the service will select the action that has the minimal possible impact upon the original RDF KB, without negating its validity. In other words, the result of the change should be "as close as possible" to the original KB, according to the "Principle of Minimal Change" [Gar92], i.e., the actual change should have the "mildest" possible effects and side-effects upon the original KB. One possible manifestation of this principle can be found in Figure 1, in which case itcaused the explicit addition of the subsumption relation between A and C, to avoid unnecessary loss of information.

The impact of a change upon an RDF KB is measured by means of a preference ordering, which allows the service to determine the most plausible out of the different options for side-effects that restore the KB's validity (i.e., the one with the minimal impact) by comparing the impact of different sorts of update operations (side-effects) upon the RDF KB. Therefore, this preference ordering is a critical parameter that affects the determination of the actual change, thus implicitly allowing us to fine-tune the behaviour of the service (i.e., the returned side-effects). One such preference ordering is currently built-in into the current implementation of the service, but its modular design allows for alternative preference ordering can be used in the place of default one..

As already mentioned, an update request can contain any number of simple operations (additions or removals of triples). It should be emphasized that there is no particular order of execution of these simple updates, i.e., the entire update request is treated as a whole, in a transactional and deterministic manner, and, while searching for the minimal impact of such an update request, we consider the impact of the entire request, rather than the impact of each change operation separately. Notice that the selected (minimal) set of side-effects computed in this manner may be different from the one we would get if we processed each update operation separately.

In order for the system to guarantee the described behaviour in a consistent and deterministic manner, the service implementation is backed up by a formal theory which is described in detail in [KFAC07]. Based on this theory we have developed a general-purpose algorithm that has been proved to exhibit the described behaviour for any kind of update request (simple or complex).

This general-purpose algorithm is backed up by a set of special-purpose algorithms which calculate the proper effects and side-effects for simple operations only; this way, we are able to provide faster, special-purpose implementations of our general-purpose algorithm, which are applicable only for simple update requests (thus trading generality for performance). The special-purpose algorithms exhibit the same behaviour as the general-purpose one, but are no substitute for it; recall that there is an infinite number of possible update requests, so this effort is inherently incomplete, and we will necessarily haveto resort to the general-purpose algorithm for certain update requests. The process of selecting the proper algorithm (special-purpose or general-purpose) to use for a particular update request is transparent to the user: the service determines whether the given update request is supported by a special-purpose algorithm and adapts the execution sequence accordingly.


Figure 6.2: The high-level view of the Change Service

Figure 2 shows the general architecture of the web service. As shown in the figure, the change service exposes a single service which is used to apply an update request upon an RDF KB. The corresponding programming interface may be found  here.


Last modified: September 22, 2008


Printer Friendly Format