URI p = new URIImpl("urn:rel:p");
URI q = new URIImpl("urn:rel:q");
URI nrlInverse = ForwardChainingRDFSPlusInverseInferencerConnection.NRL_InverseProperty;
URI defaultContext = null; // new Resource[0]
RepositoryConnection con = repository.getConnection();
// add p-hasInverse-q
con.add(p, nrlInverse, q, defaultContext);
assertTrue("just added p-haInv-q, should stil be there",
con.hasStatement(p, nrlInverse, q, true, defaultContext) );
assertTrue("expect inferred stmt: q-hasInv-p",
con.hasStatement(q, nrlInverse, p, true, defaultContext) );
// add (redundant) inverse stmt: q-hasInv-p
con.add(q, nrlInverse, p, defaultContext);
assertTrue("added p-haInv-q, should stil be there",
con.hasStatement(p, nrlInverse, q, true, defaultContext) );
assertTrue( con.hasStatement(p, nrlInverse, q, true, defaultContext) );
assertTrue("added q-hasInv-p, should still be there",
con.hasStatement(q, nrlInverse, p, true, defaultContext) );
}