Reification aims at giving properties to another properties. For example, suppose we would like to add the property ModifiedBy for each property of our ontology where we save the last user that modified this property, this is possible by Statement reification. Statement Reification converts a statement to an individual with a unique URI and that can has its own properties.
Although Reification is too important when working with ontologies, Jena [1] still has a bug when statements are reified. We recently found this bug which was reported to the Jena bug list [2].
Here we can see how reification is lost after merging more than one ontModel:
OntModel subModel,superModel;
subModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
OntClass bookClass = subModel.createClass("foo:Book");
DatatypeProperty hasTitleProperty = subModel.createDatatypeProperty("foo:hasTitle");
DatatypeProperty hasLocator = subModel.createDatatypeProperty("foo:hasLocator");
hasTitleProperty.setDomain(bookClass);
Individual book1 = subModel.createIndividual(bookClass);
book1.addProperty(hasTitleProperty, "Title1");
StmtIterator stmtIt =subModel.listStatements(book1,hasTitleProperty,"Title1");
while(stmtIt.hasNext())
{
Statement propertyStatement = stmtIt.next();
ReifiedStatement reifiedStatement=
propertyStatement.createReifiedStatement();
reifiedStatement.addProperty(hasLocator, "10");
}
System.out.println("Number of reified statements before adding it to a Model :"+subModel.listReifiedStatements().toList().size());
superModel = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
superModel.addSubModel(subModel);
System.out.println("Number of reified statements after adding it to a Model:"+superModel.listReifiedStatements().toList().size());
The obtained result is :
Number of reified statements before adding it to a Model :1 Number of reified statements after adding it to a Model :0
|
1-http://jena.sourceforge.net/
2-http://sourceforge.net/mailarchive/forum.php?forum_name=jena-bugs&max_rows=25&style=ultimate&viewmonth=20100