public class DumpOps
{
public static void dump(Dataset ds)
{
DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;
NodeTupleTable nodeTupleTableTriples = dsg.getTripleTable().getNodeTupleTable() ;
NodeTupleTable nodeTupleTableQuads = dsg.getQuadTable().getNodeTupleTable() ;
if ( nodeTupleTableTriples.getNodeTable() != nodeTupleTableQuads.getNodeTable() )
throw new CmdException("Different node tables for triples and quads") ;
NodeTable nodeTable = nodeTupleTableTriples.getNodeTable() ;
// V special.
Set<NodeTable> dumpedNodeTables = new HashSet<NodeTable> () ;
if ( true )
{
System.out.print("## Node Table\n") ;
dumpNodeTable(nodeTupleTableTriples.getNodeTable(), dumpedNodeTables) ;
dumpNodeTable(nodeTupleTableQuads.getNodeTable(), dumpedNodeTables) ;
}
if ( false )
{
System.out.print("## Triple Table\n") ;
dumpNodeTupleTable(nodeTupleTableTriples.getTupleTable()) ;
System.out.print("## Quad Table\n") ;
dumpNodeTupleTable(nodeTupleTableQuads.getTupleTable()) ;
}
// Indexes.
if ( true )
{
dumpTupleIndexes(nodeTupleTableTriples.getTupleTable().getIndexes()) ;
dumpTupleIndexes(nodeTupleTableQuads.getTupleTable().getIndexes()) ;
}
// Prefixes
if ( true )
{
System.out.print("## Prefix Table\n") ;
DatasetPrefixesTDB prefixes = dsg.getPrefixes() ;
NodeTupleTable pntt = prefixes.getNodeTupleTable() ;
if ( ! dumpedNodeTables.contains(pntt.getNodeTable()))
{
dumpNodeTable(pntt.getNodeTable(), dumpedNodeTables) ;