Friday, July 28, 2006

Reifying reified relationships

In our recent modeling exercises with real-world customers it became (once more) evident that reified relationships are a key requirement in many domains. Reified relationships are everywhere.

A typical solution to this is to introduce a relationship class that connects a source/subject with a target/object, so that you could attach additional attributes to the relationship objects. For example if we want to be able to attach an index to each parent-child relationship (first child, second child etc), then we can introduce an object to link parent, child and the index.

However, in many such cases it becomes very complicating and inconvenient if you need to do reasoning with such reified relationships. In many cases you want to talk about a simple relationship such as isParentOf instead of having to construct statements involving reified objects like ChildParentRelationship.
As a small exercise I have created an ontology pattern to automatically synchronize a reified relationship with a plain (object) property. I have no idea if this is useful to someone (and whether this has been shown elsewhere already), but anyway I'd like to share this idea here. An example based on this pattern is demonstrated below:

We have a generic base class reif:BinaryRelationship with properties reif:subject and reif:object. A subclass of this is reif:SynchronizedBinaryRelationship, and you can create subclasses of this, such as ChildParentRelationship. Then let's assume we have a class Person with instances, and a simple property pair hasParent and isParentOf. Now, whenever we create a reified ChildParentRelationship between A and B, we want to automatically also get the triple A hasParent B. This is expressed by connecting our relationship class with the hasParent property (OWL Full Full).

To drive this, automatic inferences can be expressed in a rule language and then used by engines such as the generic Jena rule engine. Here is the corresponding rule in Jena notation:

(?r rdf:type ?rt)
(?rt rdfs:subClassOf reif:SynchronizedBinaryRelationship)
(?r reif:subject ?s)
(?r reif:object ?o)
(?rt reif:synchronizedProperty ?p) ->
(?s ?p ?o)

A worked-out example can be found here and the generic pattern can be imported from

If you load the example file into TopBraid Composer, and set the rule engine to incremental mode and to operate on top of a Pellet inference graph, then the system will automatically infer that Holger is an instance of Parent. Note that you need to run the rules engine twice to combine Pellet with Jena and again with Pellet. A similar solution could be used for rdf:Statements as well.

Click on the screenshot to explore details.


At 7:48 AM, Anonymous Anonymous said...

What are your thoughts on the 'punning' in OWL 1.1 and how will this fit?

At 1:09 PM, Blogger Holger Knublauch said...

Interesting connection, Rinke. The term punning appears to describe that reasoning engines can (in a controlled way) prune RDF graphs to ignore certain triples. I have never been a huge fan of the common OWL DL policy to refuse reasoning with any ontology that contains the smallest chunk of OWL Full. Punning is already implemented in several reasoners, e.g. you can use the OWL Full++ ontology that I spoke about in my blog with Pellet (at least via its Jena bridge).

So definitely, a clever punning algorithm could on-the-fly not only ignore the reified relationships, but also add the derived triples, so that the ontology remains meaningful in terms of OWL DL. Rules like the one I described could be used to specify punning rules.


Post a Comment

<< Home