/** * Utility method dumps the statements in the store using the SPO index * (subject order). */ final public StringBuilder dumpStore() { return dumpStore(true, true, true); }
/** * <strong>DO NOT INVOKE FROM APPLICATION CODE</strong> - this method * deletes the KB instance and destroys the backing database instance. It is * used to help tear down unit tests. */ final public void __tearDownUnitTest() { if(isOpen()) destroy(); getIndexManager().destroy(); }
public Iterator<IRelation> relations() { return Collections.unmodifiableList(Arrays.asList(new IRelation[] { // getSPORelation(), // getLexiconRelation() // })).iterator(); }
final public StringBuilder dumpStore( final AbstractTripleStore resolveTerms, final boolean explicit, final boolean inferred, final boolean axioms, final boolean history, final boolean justifications) { return dumpStore(resolveTerms, explicit, inferred, axioms, history, justifications, true, getSPORelation().getPrimaryKeyOrder()); }
final BigdataValueFactory f = store.getValueFactory(); store.addTerms(new BigdataValue[]{v1,v2,v3}); }; store.addStatements(a,a.length); new SPO(v3, v2, v3, StatementEnum.Axiom),// store.getAccessPath(NULL,NULL,NULL).iterator() ); log.info("\n" + store.dumpStore()); store.__tearDownUnitTest();
@Override protected void setUp() throws Exception { tripleStore = getStore(getProperties()); lex = tripleStore.getLexiconRelation().getNamespace(); valueFactory = tripleStore.getValueFactory(); }
@Override protected void setUp() throws Exception { super.setUp(); store = getStore(getProperties()); context = new BOpContextBase(null/* fed */, store.getIndexManager()); valueFactory = store.getValueFactory(); /* * Note: This needs to be an absolute URI. */ baseURI = "http://www.bigdata.com"; }
@Override final public long getStatementCount() { return getStatementCount(null/* c */, false/* exact */); }
final public IAccessPath<ISPO> getAccessPath(final IV s, final IV p, final IV o, final IElementFilter<ISPO> filter) { return getSPORelation().getAccessPath(s, p, o, null/* c */, filter); } final public IAccessPath<ISPO> getAccessPath(final IV s, final IV p,
protected AbstractTripleStore getStore(final Properties properties) { // Note: distinct namespace for each triple store created on the federation. final String namespace = "test"+inc.incrementAndGet(); final AbstractTripleStore store = new ScaleOutTripleStore(client .getFederation(), namespace, ITx.UNISOLATED, properties); store.create(); return store; }
/** * <strong>WARNING DO NOT USE OUTSIDE OF THE UNIT TESTS: </strong> This * method is extremely inefficient for scale-out as it does one RMI per * request! * * @deprecated Not even the unit tests should be doing this. */ final public IV getIV(final Value value) { return getLexiconRelation().getIV(value); }
@Override public RDFHandler newRDFHandler() { defaultGraphURI = null != defaultGraph && buffer.getDatabase().isQuads() ? buffer.getDatabase ().getValueFactory ().createURI ( defaultGraph ) : null ; return this; }
/** * Helper method to resolve added and removed terms. */ protected IV<?,?>[] resolveTerms(final URI[] terms) throws Exception { final BigdataValueFactory vf = database.getValueFactory(); final BigdataValue[] values = new BigdataValue[terms.length]; for (int i = 0; i < terms.length; i++) { values[i] = vf.asValue(terms[i]); } database.addTerms(values); final IV<?,?>[] ivs = new IV[terms.length]; for (int i = 0; i < values.length; i++) { ivs[i] = values[i].getIV(); } return ivs; }
@Override public IAccessPath<ISPO> getAccessPath(final Resource s, final URI p, final Value o) { return getAccessPath(s, p, o, null/*c*/, null/* filter */, null/* range */); }
protected TempTripleStore createTempTripleStore() { // log.info("creating temp triple store for owl:sameAs backchainer"); // System.err.println("creating temp triple store for owl:sameAs backchainer"); final Properties props = db.getProperties(); // do not store terms props.setProperty(AbstractTripleStore.Options.LEXICON, "false"); // only store the SPO index props.setProperty(AbstractTripleStore.Options.ONE_ACCESS_PATH, "true"); // @todo MikeP : test w/ SPO bloom filter enabled and see if this improves performance. props.setProperty(AbstractTripleStore.Options.BLOOM_FILTER, "false"); return new TempTripleStore(db.getIndexManager().getTempStore(), props, db); }
/** * Report totals. * <p> * Note: these totals reflect the actual state of the database, not just * the #of triples written by this client. Therefore if there are * concurrent writers then the apparent TPS here will be higher than was * reported by the counters for just this client -- all writers on the * database will have been attributed to just this client. */ public String reportTotals() { // total run time. final long elapsed = elapsed(); final long nterms = db.getTermCount(); final long nstmts = db.getStatementCount(); final double tps = (long) (((double) nstmts) / ((double) elapsed) * 1000d); return "Database: #terms=" + nterms + ", #stmts=" + nstmts + ", rate=" + tps + " in " + elapsed + " ms."; }
/** * Return the object used to access the as-configured graph. */ private IGraphAccessor newGraphAccessor(final AbstractTripleStore kb) { /* * Use a read-only view (sampling depends on access to the BTree rather * than the ReadCommittedIndex). */ final BigdataGraphAccessor graphAccessor = new BigdataGraphAccessor( kb.getIndexManager(), kb.getNamespace(), kb .getIndexManager().getLastCommitTime()); return graphAccessor; }
/** * Constructor used to wrap an existing {@link AbstractTripleStore} * instance. * <p> * Note: Since BLZG-2041, this delegates through to the core constructor * which accepts (namespace, IIndexManager). * * @param database * The instance. */ public BigdataSail(final AbstractTripleStore database) { this(database, database.getIndexManager()); }
public IChunkedOrderedIterator<ISPO> bulkCompleteStatements( final SPO[] stmts, final int numStmts) { if (numStmts == 0) { return new EmptyChunkedIterator<ISPO>(getSPORelation() .getPrimaryKeyOrder()); } return bulkCompleteStatements(new ChunkedArrayIterator<ISPO>(numStmts, stmts, null/* keyOrder */)); }