orgdata.add(new TripleImpl(kondalor, type, companyType));
orgdata.add(new TripleImpl(kondalor, name, new PlainLiteralImpl("Kondalor Ges.m.b.H.")));
orgdata.add(new TripleImpl(tim, worksFor, kondalor));
//now get the union graph
Graph data = provider.getGraph(UNION_GRAPH_NAME);
Assert.assertNotNull(data);
//CLEREZZA-714: getTriples need to correctly return the UnionGraph
data = (Graph)provider.getTriples(UNION_GRAPH_NAME);
Assert.assertNotNull(data);
//NOTE: Jena TDB does not support getSize for the union graph
// int expectedTripleCount = persons.size()+orgdata.size();
// Assert.assertEquals("Uniongraph has "+data.size()
// +" triples (expected "+expectedTripleCount+")",
// expectedTripleCount, data.size());
Iterator<Triple> it = data.filter(null, type, companyType);
Set<UriRef> expected = new HashSet<UriRef>(Arrays.asList(talinor,kondalor));
while(it.hasNext()){
NonLiteral subject = it.next().getSubject();
Assert.assertTrue("Unexpected "+subject, expected.remove(subject));
}
Assert.assertTrue("Missing "+expected, expected.isEmpty());
it = data.filter(null, type, personType);
expected = new HashSet<UriRef>(Arrays.asList(john,tim));
while(it.hasNext()){
NonLiteral subject = it.next().getSubject();
Assert.assertTrue("Unexpected "+subject, expected.remove(subject));
}