// check that the models are isomorphic but ignoring all statements about
// the ontology resource:
Resource ontologyResource = ResourceFactory.createResource(ontologyUri);
model1.removeAll(ontologyResource, null, null);
model2.removeAll(ontologyResource, null, null);
// .. and now compare
assertTrue(model1.isIsomorphicWith(model2));
}