/** * Efficiently resolves/adds term identifiers for the buffered * {@link BigdataValue}s. * <p> * If {@link #readOnly}), then the term identifier for unknown values * will remain {@link IRawTripleStore#NULL}. */ protected void processBufferedValues() { if (INFO) log.info("nvalues=" + nvalues); db.getLexiconRelation().addTerms(valueBuffer, nvalues, readOnly); }
/** * Default configuration - verify that BLOBS index exists. */ public void test_blobsSupport_defaultConfiguration() { final AbstractTripleStore store = getStore(); try { final IIndex blobsIndex = store.getLexiconRelation().getBlobsIndex(); assertNotNull(blobsIndex); assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), Integer.valueOf(AbstractTripleStore.Options.DEFAULT_BLOBS_THRESHOLD).intValue()); } finally { store.__tearDownUnitTest(); } }
try { a = new Term2IdWriteTask(getTerm2IdIndex(), readOnly, storeBlankNodes, termIdBitsToReverse, numTerms, terms, stats).call(); tasks.add(new ReverseIndexWriterTask(getId2TermIndex(), valueFactory, a, ndistinct, storeBlankNodes)); tasks.add(new FullTextIndexWriterTask(getSearchEngine(), final List<Future<Long>> futures = getExecutorService() .invokeAll(tasks);
/** * Overridden to use local cache of the index reference. */ @Override public IIndex getIndex(final IKeyOrder<? extends BigdataValue> keyOrder) { if (keyOrder == LexiconKeyOrder.ID2TERM) { return getId2TermIndex(); } else if (keyOrder == LexiconKeyOrder.TERM2ID) { return getTerm2IdIndex(); } else if (keyOrder == LexiconKeyOrder.BLOBS) { return getBlobsIndex(); } else { throw new AssertionError("keyOrder=" + keyOrder); } }
/** * Dump the lexicon. * * @param r * The lexicon relation. * * @return The dump. */ static public Appendable dump(final LexiconRelation r) { final StringWriter w = new StringWriter(// 100 * Bytes.kilobyte32// initialCapacity ); w.append(r.getLexiconConfiguration().toString()); w.append("\n"); dump(r.getContainer(), w, true/*showEntries*/); return w.getBuffer(); }
IV iv = getInlineIV(value); if (iv != null) return iv; iv = getTermId(value);
public void rebuildTextIndex(final boolean forceCreate) { if (getTimestamp() != ITx.UNISOLATED) throw new UnsupportedOperationException("Unisolated connection required to rebuild full text index"); IValueCentricTextIndexer<?> oldTextIndexer = getSearchEngine(); textIndexer = getSearchEngine(); textIndexer = getSearchEngine(); updateTextIndexConfiguration(global, getContainerNamespace()); updateTextIndexConfiguration(global, getNamespace()); final IIndex terms = getId2TermIndex(); final IIndex terms = getBlobsIndex();
assertNotNull(store.getLexiconRelation().getSearchEngine()); store.getLexiconRelation().buildSubjectCentricTextIndex(); assertNotNull(store.getLexiconRelation().getSubjectCentricSearchEngine());
this.textIndex = Boolean.parseBoolean(getProperty( AbstractTripleStore.Options.TEXT_INDEX, AbstractTripleStore.Options.DEFAULT_TEXT_INDEX)); this.storeBlankNodes = Boolean.parseBoolean(getProperty( AbstractTripleStore.Options.STORE_BLANK_NODES, AbstractTripleStore.Options.DEFAULT_STORE_BLANK_NODES)); blobsThreshold = Integer.parseInt(getProperty( AbstractTripleStore.Options.BLOBS_THRESHOLD, AbstractTripleStore.Options.DEFAULT_BLOBS_THRESHOLD)); termIdBitsToReverse = Integer.parseInt(getProperty( AbstractTripleStore.Options.TERMID_BITS_TO_REVERSE, defaultValue)); set.add(getFQN(LexiconKeyOrder.TERM2ID)); set.add(getFQN(LexiconKeyOrder.ID2TERM)); set.add(getFQN(LexiconKeyOrder.BLOBS)); set.add(getNamespace() + "." + FullTextIndex.NAME_SEARCH); final Class<BigdataValueFactory> vfc = determineValueFactoryClass(); final Method gi = vfc.getMethod("getInstance", String.class); this.valueFactory = (BigdataValueFactory) gi.invoke(null, namespace); final int termCacheCapacity = Integer.parseInt(getProperty( AbstractTripleStore.Options.TERM_CACHE_CAPACITY, AbstractTripleStore.Options.DEFAULT_TERM_CACHE_CAPACITY));
IValueCentricTextIndexer<?> searchEngine = cxn.getTripleStore().getLexiconRelation().getSearchEngine(); assertEquals(1, searchEngine.count(query("1"))); assertEquals(1, searchEngine.count(query("2")));
store.getLexiconRelation().getSubjectCentricSearchEngine() : store.getLexiconRelation().getSearchEngine());
public void buildSubjectCentricTextIndex() { if (getTimestamp() != ITx.UNISOLATED) throw new UnsupportedOperationException(); throw new UnsupportedOperationException(); final ISubjectCentricTextIndexer<?> textIndexer = getSubjectCentricSearchEngine(); final IIndex spoNdx = getContainer().getSPORelation().getPrimaryIndex(); textIndexer.index(s, getTerms(literals).values().iterator()); textIndexer.index(s, getTerms(literals).values().iterator());
handleSid((SidIV) iv, ivs, unrequestedSidTerms); final BigdataValue value = _getTermId(iv); final ExecutorService service = getExecutorService(); tasks.add(new BatchResolveTermIVsTask(service, getId2TermIndex(), termIVs, ret, termCache, valueFactory, termsChunksSize)); tasks.add(new BatchResolveBlobIVsTask(service, getBlobsIndex(), blobIVs, ret, termCache, valueFactory, blobsChunkSize)); final List<Future<Void>> futures = getExecutorService() .invokeAll(tasks); cacheTerms((SidIV<?>) iv, ret);
public V asValue(final LexiconRelation lex) throws UnsupportedOperationException { V v = getValueCache(); if (v == null) { final BigdataValueFactory f = lex.getValueFactory(); v = (V) lex.getContainer().getVocabulary().asValue(this); v.setIV(this); setValue(v); } return v; }
@Override public String getLexiconNamespace() { return db.getLexiconRelation().getNamespace(); }
assertNotNull(foundLexiconRelation.getContainerNamespace()); foundLexiconRelation.getContainerNamespace().equals( store.getNamespace()); assertNotNull(foundLexiconRelation.getContainer()); assertTrue(foundStore == foundLexiconRelation.getContainer());
final AbstractTripleStore store) { final IIndex t2id = store.getLexiconRelation().getTerm2IdIndex(); final IIndex id2t = store.getLexiconRelation().getId2TermIndex();
/** * Attempt to convert the value to an inline internal value. If the caller * provides a {@link BigdataValue} and this method is successful, then the * {@link IV} will be set as a side-effect on the {@link BigdataValue}. * * @param value * The value to convert * * @return The inline internal value, or <code>null</code> if it cannot be * converted * * @see ILexiconConfiguration#createInlineIV(Value) */ @SuppressWarnings("rawtypes") final public IV getInlineIV(final Value value) { return getLexiconConfiguration().createInlineIV(value); }
.reverseInstance(r.getNamespace(), ITx.UNISOLATED, termvar, new Constant<IV>(expected.getIV())); final IKeyOrder<BigdataValue> keyOrder = r.getKeyOrder(predicate); final IAccessPath<BigdataValue> ap = r.newAccessPath( store.getIndexManager(), predicate, keyOrder);
@Override public boolean isValid(final Object obj) { /* * Assigns the IV as a side effect iff the RDF Value can * be inlined according to the governing lexicon * configuration and returns true iff the value CAN NOT * be inlined. Thus, inlining is done as a side effect * while the caller sees only those Values which need to * be written onto the TERM2ID/BLOBS index. */ return r.getInlineIV((Value) obj) == null; } }), chunkSize, BigdataValue.class);