Dataset dataset = TDBFactory.createDataset(dir);
Model model dataset.getNamedModel("urn:x-arq:UnionGraph");
Graph graph = model.getGraph();
int size = graph.size();
size will always report zero regardless of the amount of triples stored in the different named models of the dataset.
I think this is because com.hp.hpl.jena.tdb.store.GraphNamedTDB#countThis() would need special treatment in case of "isQuadUnionGraph(graphNode) == true"