final BigdataBNode sid1 = f.createBNode("_S1"); StatementBuffer buf = new StatementBuffer(store, 100/* capacity */); buf.add(A, RDF.TYPE, C); buf.add(sid1, RDF.SUBJECT, A); buf.add(sid1, RDF.PREDICATE, RDF.TYPE); buf.add(sid1, RDF.OBJECT, C); buf.add(B, RDF.TYPE, C); buf.add(sid1, RDF.SUBJECT, B); buf.add(sid1, RDF.PREDICATE, RDF.TYPE); buf.add(sid1, RDF.OBJECT, C); buf.flush();
if (!assertBuffer.isEmpty()) dirty = true; assertBuffer.flush(); TempTripleStore statementStore = (TempTripleStore) assertBuffer.getStatementStore(); if (!retractBuffer.isEmpty()) dirty = true; retractBuffer.flush(); .getStatementStore(), changeLog);
final Resource c, final StatementEnum type) { if (nearCapacity()) { incrementalWrite(); } else { handleStatement(s, p, o, c, type);
assertBuffer = new StatementBuffer<Statement>(tm .newTempTripleStore(), database, bufferCapacity, queueCapacity); assertBuffer = new StatementBuffer<Statement>(database, bufferCapacity); assertBuffer.setChangeLog(changeLog); assertBuffer.setBNodeMap(bnodes);
assertBuffer.reset(); assertBuffer.getStatementStore().close(); retractBuffer.reset(); retractBuffer.getStatementStore().close();
final StatementBuffer assertionBuffer = new StatementBuffer(tm .newTempTripleStore(), store, 100/* capacity */, 10/*queueCapacity*/); assertionBuffer.add(a, rdfType, entity ); assertionBuffer.add(b, rdfType, entity ); assertionBuffer.add(a, sameAs, b ); assertionBuffer.flush(); .getStatementStore()); final StatementBuffer retractionBuffer = new StatementBuffer(tm .newTempTripleStore(), store, 100/* capacity */, 10/*queueCapacity*/); retractionBuffer.add(a, sameAs, b); retractionBuffer.flush(); .getStatementStore());
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); final URI c1 = null; // no context. buffer.add(vf.createStatement(s1, p1, o1, c1, StatementEnum.Explicit)); final URI c2 = null; buffer.add(vf.createStatement(s2, p2, o2, c2, StatementEnum.Explicit)); final URI c3 = null; buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); buffer.flush();
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity, queueCapacity); assertEquals(store, buffer.getDatabase()); assertEquals(capacity, buffer.getCapacity()); assertEquals(capacity * store.getSPOKeyArity() + 5, buffer.values.length); assertEquals(capacity, buffer.stmts.length);
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); final URI c1 = null; // no context. buffer.handleStatement(s1, p1, o1, c1, StatementEnum.Explicit); final URI c2 = null; buffer.handleStatement(s2, p2, o2, c2, StatementEnum.Explicit); final URI c3 = null; buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); assertEquals(4, buffer.numStmts); buffer.flush();
/** * Return the {@link StatementBuffer} to be used for a task. */ public StatementBuffer<S> newStatementBuffer() { return new StatementBuffer<S>(null/* statementStore */, db, bufferCapacity, 10/*queueCapacity*/); }
/** * Add an "explicit" statement to the buffer (flushes on overflow, no * context). * * @param s * @param p * @param o */ @Override public void add(final Resource s, final URI p, final Value o) { add(s, p, o, null, StatementEnum.Explicit); }
/** * * @return The #of statements visited by the parser. */ public long close() { buffer.flush(); return n; }
buffer.flush(); .assertAll((TempTripleStore) buffer.getStatementStore());
+ (baseURI != null ? "; baseURL=" + baseURI : "")); if (buffer != null && buffer.getDatabase() instanceof AbstractLocalTripleStore) { if(log.isDebugEnabled()) log.debug(((AbstractLocalTripleStore) buffer.getDatabase()) .getLocalBTreeBytesWritten(new StringBuilder()) .toString()); buffer.reset(); buffer.getStatementStore().close();
final StatementBuffer assertionBuffer = new StatementBuffer(tm .newTempTripleStore(), store, 100/* capacity */, 10/*queueCapacity*/); assertionBuffer.add(a, rdfType, entity ); assertionBuffer.add(b, rdfType, entity ); assertionBuffer.add(a, sameAs, b ); assertionBuffer.flush(); .getStatementStore()); final StatementBuffer retractionBuffer = new StatementBuffer(tm .newTempTripleStore(), store, 100/* capacity */, 10/*queueCapacity*/); retractionBuffer.add(a, sameAs, b); retractionBuffer.flush(); .getStatementStore());
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); final URI c1 = null; // no context. buffer.add(vf.createStatement(s1, p1, o1, c1, StatementEnum.Explicit)); final URI c2 = null; buffer.add(vf.createStatement(s2, p2, o2, c2, StatementEnum.Explicit)); final URI c3 = null; buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); buffer.flush();
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity, queueCapacity); assertEquals(store, buffer.getDatabase()); assertEquals(capacity, buffer.getCapacity()); assertEquals(capacity * store.getSPOKeyArity() + 5, buffer.values.length); assertEquals(capacity, buffer.stmts.length);
final StatementBuffer<Statement> buffer = new StatementBuffer<Statement>( store, capacity); final URI c1 = null; // no context. buffer.handleStatement(s1, p1, o1, c1, StatementEnum.Explicit); final URI c2 = null; buffer.handleStatement(s2, p2, o2, c2, StatementEnum.Explicit); final URI c3 = null; buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); buffer.handleStatement(s3, p3, o3, c3, StatementEnum.Explicit); assertEquals(4, buffer.numStmts); buffer.flush();
/** * Return the {@link StatementBuffer} to be used for a task. */ public StatementBuffer<S> newStatementBuffer() { return new StatementBuffer<S>(null/* statementStore */, db, bufferCapacity, 10/*queueCapacity*/); }