protected AbstractTripleStore getStore(final Properties properties) { final String namespace = "kb"; // create/re-open journal. final Journal journal = new Journal(properties); final LocalTripleStore lts = new LocalTripleStore(journal, namespace, ITx.UNISOLATED, properties); lts.create(); return lts; }
@Override synchronized public void abort() { super.abort(); // discard the write sets. getIndexManager().abort(); }
@Override protected AbstractTripleStore getStore(final Properties properties) { return LocalTripleStore.getInstance(properties); }
final LocalTripleStore db = new LocalTripleStore(store, "test", ITx.UNISOLATED, properties); db.create(); final BigdataValueFactory f = db.getValueFactory(); db.getLexiconRelation() .addTerms(terms, terms.length, false/* readOnly */); }; db.addStatements(stmts, stmts.length); db.commit(); log.info(db.dumpStore()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred); .newInstance()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred);
store.abort(); final BigdataValueFactory f = store.getValueFactory(); store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); store.addStatements(new SPO[] { // new SPO(s.getIV(), p.getIV(), o.getIV(), StatementEnum.Explicit) // assertTrue(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); store.abort(); assertFalse(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); store.abort(); store.__tearDownUnitTest();
/** * Creates a mocked local triple (memory) store with the given namespace, * with unisolated transactions. * * @param namespace * @return */ public static AbstractTripleStore mockTripleStore(final String namespace) { final Properties properties = new Properties(); properties.setProperty( com.bigdata.journal.Options.BUFFER_MODE,BufferMode.MemStore.name()); final Journal store = new Journal(properties); final AbstractTripleStore kb = new LocalTripleStore( store, namespace, ITx.UNISOLATED, properties); kb.create(); store.commit(); return kb; }
final File file = ((LocalTripleStore) store).getIndexManager().getFile(); return LocalTripleStore.getInstance(properties);
final LocalTripleStore db = new LocalTripleStore(store, "test", ITx.UNISOLATED, properties); db.create(); final BigdataValueFactory f = db.getValueFactory(); db.getLexiconRelation() .addTerms(terms, terms.length, false/* readOnly */); }; db.addStatements(stmts, stmts.length); db.commit(); log.info(db.dumpStore()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred); .newInstance()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred);
public void test_commit1() { final LocalTripleStore store = (LocalTripleStore) getStore(); try { final BigdataValueFactory f = store.getValueFactory(); final BigdataValue s = f.createURI("http://www.bigdata.com/s"); final BigdataValue p = f.createURI("http://www.bigdata.com/p"); final BigdataValue o = f.createURI("http://www.bigdata.com/o"); final BigdataValue[] values = new BigdataValue[]{s,p,o}; store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); assertFalse(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); // add the statement. store.addStatements(new SPO[] { // new SPO(s.getIV(), p.getIV(), o.getIV(), StatementEnum.Explicit) // },// 1); assertTrue(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); } finally { store.__tearDownUnitTest(); } }
/** * Creates a mocked local triple (memory) store with the given namespace, * with unisolated transactions. * * @param namespace * @return */ public static AbstractTripleStore mockTripleStore(final String namespace) { final Properties properties = new Properties(); properties.setProperty( com.bigdata.journal.Options.BUFFER_MODE,BufferMode.MemStore.name()); final Journal store = new Journal(properties); final AbstractTripleStore kb = new LocalTripleStore( store, namespace, ITx.UNISOLATED, properties); kb.create(); store.commit(); return kb; }
final File file = ((LocalTripleStore) store).getIndexManager().getFile(); return LocalTripleStore.getInstance(properties);
protected AbstractTripleStore getStore(final Properties properties) { final String namespace = "kb"; // create/re-open journal. final Journal journal = new Journal(properties); final LocalTripleStore lts = new LocalTripleStore(journal, namespace, ITx.UNISOLATED, properties); lts.create(); return lts; }
final LocalTripleStore db = new LocalTripleStore(store, "test", ITx.UNISOLATED, properties); db.create(); final BigdataValueFactory f = db.getValueFactory(); db.getLexiconRelation() .addTerms(terms, terms.length, false/* readOnly */); }; db.addStatements(stmts, stmts.length); db.commit(); log.info(db.dumpStore()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred); .newInstance()); final IAccessPath<ISPO> ap = db.getSPORelation().getAccessPath( SPOKeyOrder.SPOC, pred);
store.abort(); final BigdataValueFactory f = store.getValueFactory(); store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); store.addStatements(new SPO[] { // new SPO(s.getIV(), p.getIV(), o.getIV(), StatementEnum.Explicit) // assertTrue(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); store.abort(); assertFalse(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); store.abort(); store.__tearDownUnitTest();
kb = new LocalTripleStore(jnl, namespace, Long .valueOf(ITx.UNISOLATED), properties);
final File file = ((LocalTripleStore) store).getIndexManager().getFile(); return LocalTripleStore.getInstance(properties);
@Override synchronized public void abort() { super.abort(); // discard the write sets. getIndexManager().abort(); }
@Override protected AbstractTripleStore getStore(final Properties properties) { return LocalTripleStore.getInstance( properties ); }
protected AbstractTripleStore getStore(final Properties properties) { final String namespace = "kb"; // create/re-open journal. final Journal journal = new Journal(properties); final LocalTripleStore lts = new LocalTripleStore(journal, namespace, ITx.UNISOLATED, properties); lts.create(); return lts; }
public void test_commit1() { final LocalTripleStore store = (LocalTripleStore) getStore(); try { final BigdataValueFactory f = store.getValueFactory(); final BigdataValue s = f.createURI("http://www.bigdata.com/s"); final BigdataValue p = f.createURI("http://www.bigdata.com/p"); final BigdataValue o = f.createURI("http://www.bigdata.com/o"); final BigdataValue[] values = new BigdataValue[]{s,p,o}; store.getLexiconRelation() .addTerms(values, values.length, false/* readOnly */); assertFalse(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); // add the statement. store.addStatements(new SPO[] { // new SPO(s.getIV(), p.getIV(), o.getIV(), StatementEnum.Explicit) // },// 1); assertTrue(store.hasStatement(s.getIV(), p.getIV(), o.getIV())); } finally { store.__tearDownUnitTest(); } }