use of org.apache.jena.sdb.store.TableDesc in project jena by apache.
the class sdbtuple method execPrint.
private void execPrint(String tableName) {
Store store = getStore();
TupleTable table = null;
if (tableName.equalsIgnoreCase(store.getNodeTableDesc().getTableName())) {
// A hack.
// Need to chage SQLBridge to work on Node tables directly (no special build of value getters)
TableDesc desc = new TableDesc(tableName, store.getNodeTableDesc().getNodeRefColName());
table = new TupleTable(store, desc);
} else
table = new TupleTable(store, tableName);
divider();
table.dump();
}
use of org.apache.jena.sdb.store.TableDesc in project jena by apache.
the class TestStoreUpdateBase method arityViolation.
@Test(expected = IllegalArgumentException.class)
public void arityViolation() {
TableDesc desc = store.getQuadTableDesc();
loader.startBulkUpdate();
loader.addTuple(desc, node("One"));
loader.finishBulkUpdate();
}
use of org.apache.jena.sdb.store.TableDesc in project jena by apache.
the class TestStoreUpdateBase method dupeSuppressedQ.
@Test
public void dupeSuppressedQ() {
TableDesc desc = store.getQuadTableDesc();
loader.startBulkUpdate();
loader.addTuple(desc, node("F"), node("A"), node("F"), node("G"));
loader.addTuple(desc, node("F"), node("A"), node("F"), node("G"));
loader.finishBulkUpdate();
assertEquals("Store added only one item", 1, size(desc));
assertEquals("Store added correct number of nodes", 3, size(nodeT));
loader.startBulkUpdate();
loader.addTuple(desc, node("G"), node("A"), node("F"), node("K"));
loader.finishBulkUpdate();
loader.startBulkUpdate();
loader.addTuple(desc, node("G"), node("A"), node("F"), node("K"));
loader.finishBulkUpdate();
assertEquals("Store added only one item", 2, size(desc));
assertEquals("Store added correct number of nodes", 4, size(nodeT));
}
use of org.apache.jena.sdb.store.TableDesc in project jena by apache.
the class TestStoreUpdateBase method safeRemoveAll.
@Test
public void safeRemoveAll() {
TableDesc desc = store.getTripleTableDesc();
loader.startBulkUpdate();
loader.addTuple(desc, node("A"), node("A"), node("A"));
loader.addTuple(desc, node("B"), node("B"), node("B"));
loader.finishBulkUpdate();
desc = store.getQuadTableDesc();
loader.startBulkUpdate();
loader.addTuple(desc, node("A"), node("A"), node("A"), node("A"));
loader.addTuple(desc, node("A"), node("A"), node("B"), node("A"));
loader.addTuple(desc, node("B"), node("B"), node("B"), node("B"));
loader.addTuple(desc, node("B"), node("C"), node("C"), node("C"));
loader.finishBulkUpdate();
loader.startBulkUpdate();
loader.deleteAll();
loader.finishBulkUpdate();
assertEquals("Triples all removed", 0l, store.getSize());
loader.startBulkUpdate();
loader.deleteAll(node("A"));
loader.finishBulkUpdate();
assertEquals("Quad A all removed", 0l, store.getSize(node("A")));
assertEquals("Quad B unaffected", 2l, store.getSize(node("B")));
}
use of org.apache.jena.sdb.store.TableDesc in project jena by apache.
the class TestStoreUpdateBase method mixItUp.
@Test
public void mixItUp() {
TableDesc desc1 = store.getTripleTableDesc();
TableDesc desc2 = store.getQuadTableDesc();
loader.startBulkUpdate();
loader.addTuple(desc2, node("F"), node("A"), node("F"), node("G"));
loader.addTuple(desc1, node("A"), node("F"), node("G"));
loader.finishBulkUpdate();
assertEquals("Store added to triples", 1, size(desc1));
assertEquals("Store added to quads", 1, size(desc2));
assertEquals("Store added correct number of nodes", 3, size(nodeT));
loader.startBulkUpdate();
loader.addTuple(desc2, node("G"), node("A"), node("F"), node("K"));
loader.finishBulkUpdate();
loader.startBulkUpdate();
loader.addTuple(desc1, node("G"), node("A"), node("F"));
loader.finishBulkUpdate();
assertEquals("Store added one to triples", 2, size(desc1));
assertEquals("Store added one to quads", 2, size(desc2));
assertEquals("Store added correct number of nodes", 4, size(nodeT));
loader.startBulkUpdate();
loader.addTuple(desc2, node("G"), node("A"), node("F"), node("G"));
loader.deleteTuple(desc1, node("A"), node("F"), node("G"));
loader.addTuple(desc1, node("B"), node("F"), node("G"));
loader.deleteTuple(desc2, node("G"), node("A"), node("F"), node("G"));
loader.deleteTuple(desc2, node("B"), node("A"), node("F"), node("G"));
loader.addTuple(desc1, node("B"), node("B"), node("B"));
loader.addTuple(desc2, node("B"), node("B"), node("B"), node("B"));
loader.finishBulkUpdate();
assertEquals("Store triple size correct", 3, size(desc1));
assertEquals("Store quad size correct", 3, size(desc2));
assertEquals("Store nodes node size correct", 5, size(nodeT));
}
Aggregations