THE KNOWLEDGE REPOSITORY SERVICES API REFERENCE (version 2.0)

CHANGE IMPACT SERVICE
METHOD NAME DESCRIPTION/PRECONDITIONS/EFFECTS METHOD SIGNATURE EXCEPTIONS  THROWN
CHANGE IMPACT Description:

Estimates the outcomes of an update request upon an initial RDF KB, by calculating the minimally necessary side-effects of the original update request which, once applied upon the original RDF KB, guarantee the validity of the resulting RDF KB.

The triples contained in the RDF KB are determined by the parameters nameOrGraphspaceURIs and mode.

In particular, if mode is OFF, then the RDF KB contains all triples appearing in the collection of the input namespaces and named graphs (nameOrGraphspaceURIs), as well as all triples in all namespaces or named graphs upon which the input namespaces and named graphs (nameOrGraphspaceURIs) depend on. Therefore, the RDF KB in this case is the union of all the triples that appear in all the namespaces or named graphs that are direct or indirect dependants of the given ones.

On the other hand, if mode is ON, then the RDF KB contains, additionally, all the triples appearing in the namespaces or named graphs that depend on the input ones. Therefore, the RDF KB in this case is the union of all the triples that appear in all the namespaces or named graphs that are directly or indirectly depending on (or are dependants of) the given ones.


Preconditions:
  • The array of strings of nameGraphSpaceURI at input, contains all the different name or graph spaces that come in the triples contained in the input delta.
  • Format of the files in added and deleted is "TRIG". Triples are fully-qualified.
  • In cases that the update contains one of the following triples:
    • P rdfs:domain A
    • P rdfs:subPropertyOf R
    • A rdf:type B
    • A rdfs:subClassOf B
    (with A,B,P,R fully qualified Uris) Then at least one resource out of subject or object must have its URI contained in the update or the initial KB (unless the resources are part of RDF Schema namespace).
Effects:

After the successful execution of the operation, the output will be a pair of strings, which represent the triples that should be added to and deleted from the original namespaces and named graphs (i.e., includes both the effects of the original update request and its side-effects).

The nameOrGraphspaceURIs and the mode parameters indicate the namespaces and named graphs upon which the update request will be applied. In particular, the update request will be applied upon the namespaces and named graphs in the nameOrGraphspaceURIs parameter, plus those that they depend on, if mode is OFF, whereas it will be applied upon the full dependency closure of the namespaces and named graphs in the nameOrGraphspaceURIs parameter, if mode is ON.

These triples are ready for set-theoretic addition/removal upon the initial sets of triples and its dependents (if mode is OFF) or upon the “full dependency closure” of these initial sets of triples (if mode is ON).

The delta parameter indicates the update to be executed.

public gr.forth.ics.rdfsuite.services.Delta changeImpact(
gr.forth.ics.rdfsuite.services.Delta delta,
java.lang.String[] nameOrGraphspaceURIs,
gr.forth.ics.rdfsuite.services.ChangeImpactAnalyzer.NamespaceClosure mode,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)

The following exceptions are thrown by the service:

  • InfeasibleUpdateException: 
    when the update formed by the input delta is infeasible, i.e., there is no way to be successfully implemented upon the KB. This means that delta contains both the addition and the removal of the same element or relation (e.g., class, property, class IsA, instantiation etc), or that delta leads (has side-effects that contain) necessarily to both the addition and the removal of the same element or relation.

  • UpdatingIllegalNameSpacesException:
     when the URIs that are contained in the delta are not in the URIs contained in nameGraphSpaceURI or in the standard RDF/S Namespaces.

  • InvalidTripleException: 
    when some triple at the delta is malformed, in the sense that an update containing this particular triple (or the combination of this triple with the ones read previously) is definitely not applicable, regardless of the contents of the RDF KB. For example, that would happen for the triple A subProperty B, where A is a class).

  • NotEnoughInfoException: 
    when the update contains one of the following triples:

    • P rdfs:subPropertyOf R

    • A rdf:type B

    • A rdfs:subClassOf B

(with A,B,P,R fully qualified URIs)

and for each such triple neither the subject nor the object can be disambiguated, i.e., the service cannot determine the element type that the subject (or object) refers to.

This condition holds in order for the Change Impact mechanism to be able to decide on the actual operation that is attempted (i.e., to disambiguate the triple); to do that, it must know what type of element the subject and the object refer to. This is not clear by each of the above triples alone; for example, in the triple “A rdf:subClassOf B” the names A, B could refer to classes or metaclasses. In order for Change Impact to work, it must be known in advance whether A (or B) is a class or a metaclass.

In order for this disambiguation to take place, either the subject or the object of the triple must be contained in another, non-ambiguous triple which can be either in the delta, or in the initial KB (that nameGraphSpaceURI collection forms) or be part of the standard RDF/S namespaces.

The same is true for the triple:

    • P rdfs:domain A

(with A,P fully qualified URIs)

     but, in this case, only the subject (P) might be ambiguous.

  • NameExistsAsDifferentObjectException:
    when trying to insert a URI as an element of a certain type (e.g. a class) and this is URI is occupied by another element of a different type (e.g., a property).