Deleting from an RDF/OWL knowledge base

When working with an RDF/OWL knowledge base sooner or later the situation will occur that you have to delete data. In such a situation we observed a behaviour that initially seemed very strange. However, it is ultimately quite easy to explain.

Let’s consider a simpel example with one class “Person” and two object property “hasChild” and “hasParent” that are inverses of each other. Before the reasoning process we have these statements. Let’s call this set of statements S1.

del:A
  rdf:type del:Person ;
  del:hasChild del:B .
  del:B
  rdf:type del:Person .

After calculation of the inferences we find these statements:

del:A
  rdf:type de:Person ;
  rdf:type owl:Thing ;
  rdf:type rdfs:Resource ;
  owl:sameAs del:A ;
  del:hasChild del:B .
del:B
  rdf:type de:Person ;
  rdf:type owl:Thing ;
  rdf:type rdfs:Resource ;
  owl:sameAs del:B ;
  del:hasParent del:A .

We will get the same result if these were our initial statements. Let’s call them S2.

del:A
   rdf:type del:Person .
del:B
   rdf:type del:Person ;
   del:hasParent del:A .

There is no possibilty to tell if S1 or S2 were the initial statements before reasoning.

There is also a third set S3 of initial statments that will leed to the same inference result:

del:A
   rdf:type del:Person ;
   del:hasChild del:B .
del:B
   rdf:type del:Person ;
   del:hasParent del:A .

What happens if we try to delete one of the object properties? Well – that depends on the initial set of statments. Let’s try to remove a statement from this set of statements.

del:A
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:A ;
   del:hasChild del:B .
del:B
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:B ;
   del:hasParent del:A .

We want to remove the statement ( del:A del:hasChild del:B ). If S1 was our initial set of statments everything will work as expected. This will be the result:

del:A
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:A ;
del:B
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:B ;

However, if S2 was our initial set of statements nothing will happen. Both object property assertions will still be there.

del:A
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:A ;
   del:hasChild del:B .
del:B
   rdf:type de:Person ;
   rdf:type owl:Thing ;
   rdf:type rdfs:Resource ;
   owl:sameAs del:B ;
   del:hasParent del:A .

Why? The highlighted statement is a “virtual” statement. It was not part of the initial set of statements. In this case we can only remove the link between the two individuals by deleting the ( del:B del:hasChild del:A ) statement. However, it is impossible to tell which statement is the “virtual” statement. Therefore, it is quite difficult to remove information from the knowledgebase that is part of an inference rule.

Comments are closed.