/** Public for testing only : create a triple table.*/ private static TripleTable createTripleTable(IndexBuilder indexBuilder, NodeTable nodeTable, Location location, String[]descs, ConcurrencyPolicy policy) { TupleIndex indexes[] = indexes(indexBuilder, indexRecordTripleFactory, location, primaryIndexTriples, descs) ; return new TripleTable(indexes, nodeTable, policy) ; }
private static void add(TripleTable table, Node s, Node p, Node o) { table.add(new Triple(s,p,o)) ; }
private static void match(TripleTable table, Node s, Node p, Node o) { Iterator<Triple> iter = table.find(s, p, o) ; assertNotNull(iter) ; assertTrue(iter.hasNext()) ; }
DestinationTripleGraph(final DatasetGraphTDB dsg, RdfImportFilter importFilter, Logger log) { this.dsg = dsg ; startedEmpty = dsg.isEmpty() ; monitor = new LoadMonitor(dsg, log, "triples", BulkLoader.DataTickPoint, BulkLoader.IndexTickPoint) ; loaderTriples = new LoaderNodeTupleTable(dsg.getTripleTable().getNodeTupleTable(), "triples", monitor) ; if(importFilter == null){ this.importFilter = NO_FILTER; } else { this.importFilter = importFilter; } this.importLog = log; }
DestinationTripleGraph(final DatasetGraphTDB dsg, RdfImportFilter importFilter, Logger log) { this.dsg = dsg ; startedEmpty = dsg.isEmpty() ; monitor = new LoadMonitor(dsg, log, "triples", BulkLoader.DataTickPoint, BulkLoader.IndexTickPoint) ; loaderTriples = new LoaderNodeTupleTable(dsg.getTripleTable().getNodeTupleTable(), "triples", monitor) ; if(importFilter == null){ this.importFilter = NO_FILTER; } else { this.importFilter = importFilter; } this.importLog = log; }
static void forceSync(DatasetGraphTDB dsg) { // Force sync - we have been bypassing DSG tables. // THIS DOES NOT WORK IF modules check for SYNC necessity. dsg.getTripleTable().getNodeTupleTable().getNodeTable().sync(); dsg.getQuadTable().getNodeTupleTable().getNodeTable().sync(); dsg.getQuadTable().getNodeTupleTable().getNodeTable().sync(); dsg.getPrefixes().getNodeTupleTable().getNodeTable().sync(); // This is not enough -- modules check whether sync needed. dsg.sync() ; } }
private static void notMatch(TripleTable table, Node s, Node p, Node o) { Iterator<Triple> iter = table.find(s, p, o) ; assertNotNull(iter) ; assertFalse(iter.hasNext()) ; }
@Test public void add1() { TripleTable table = createTripleTableMem() ; table.add(new Triple(n1,n2,n3)) ; }
static void forceSync(DatasetGraphTDB dsg) { // Force sync - we have been bypassing DSG tables. // THIS DOES NOT WORK IF modules check for SYNC necessity. dsg.getTripleTable().getNodeTupleTable().getNodeTable().sync(); dsg.getQuadTable().getNodeTupleTable().getNodeTable().sync(); dsg.getQuadTable().getNodeTupleTable().getNodeTable().sync(); dsg.getPrefixes().getNodeTupleTable().getNodeTable().sync(); // This is not enough -- modules check whether sync needed. dsg.sync() ; } }
private static void contains(TripleTable table, Node s, Node p, Node o) { Iterator<Triple> iter = table.find(s, p, o) ; assertNotNull(iter) ; assertTrue(iter.hasNext()) ; assertEquals(new Triple(s, p, o), iter.next()) ; assertFalse(iter.hasNext()) ; }