Graph aSourceGraph = new GraphImpl();
aSourceGraph.addAll(aGraph);
aSourceGraph.addAll(RdfGenerator.asRdf(aJoe));
aSourceGraph.addAll(RdfGenerator.asRdf(aJane));
TestPerson aPerson = RdfGenerator.fromRdf(TestPerson.class, aBob.getRdfId(), new TestDataSource(aSourceGraph));
assertEquals(aBob, aPerson);
// now lets test the round trip w/ the added trick of a circular dependency
aBob.setSpouse(aJane);
aGraph = RdfGenerator.asRdf(aBob);
// this is the set of data that would normally be in the database
aSourceGraph = new GraphImpl();
aSourceGraph.addAll(aGraph);
aSourceGraph.addAll(RdfGenerator.asRdf(aJoe));
aSourceGraph.addAll(RdfGenerator.asRdf(aJane));
aPerson = RdfGenerator.fromRdf(TestPerson.class, aBob.getRdfId(), new TestDataSource(aSourceGraph));
// should still be equal, should have re-used Jane
assertEquals(aBob, aPerson);
}
catch (Exception e) {