/** * 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); }
/** * 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); }
/** * 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(); }
/** * 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(); }
private LiteralImpl getLargeLiteral(final AbstractTripleStore store) { final int len = store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(); final StringBuilder sb = new StringBuilder(len); final String[] tokens = new String[] { "apple", "mary", "john", "barley", "mellow", "pudding", "fries", "peal", "gadzooks" }; for (int i = 0; sb.length() < len; i++) { sb.append(tokens[(i % tokens.length)]); sb.append(" "); } final String s = sb.toString(); if (log.isInfoEnabled()) log.info("length(s)=" + s.length()); return new LiteralImpl(s); }
private LiteralImpl getLargeLiteral(final AbstractTripleStore store) { final int len = store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(); final StringBuilder sb = new StringBuilder(len); final String[] tokens = new String[] { "apple", "mary", "john", "barley", "mellow", "pudding", "fries", "peal", "gadzooks" }; for (int i = 0; sb.length() < len; i++) { sb.append(tokens[(i % tokens.length)]); sb.append(" "); } final String s = sb.toString(); if (log.isInfoEnabled()) log.info("length(s)=" + s.length()); return new LiteralImpl(s); }
/** * Override configuration - BLOBS index uses a non-default threashold. */ public void test_blobsSupport_nonDefaultBlobsIndexThresholdConfiguration() { final Properties p = new Properties(getProperties()); final int overrideThreshold = Integer.valueOf(AbstractTripleStore.Options.DEFAULT_BLOBS_THRESHOLD) * 2; p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(overrideThreshold)); final AbstractTripleStore store = getStore(p); try { final IIndex blobsIndex = store.getLexiconRelation().getBlobsIndex(); assertNotNull(blobsIndex); assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), overrideThreshold); } finally { store.__tearDownUnitTest(); } }
/** * Override configuration - BLOBS index is disabled. */ public void test_blobsSupport_noBlobsIndexConfiguration() { final Properties p = new Properties(getProperties()); p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(Integer.MAX_VALUE)); final AbstractTripleStore store = getStore(p); try { try { // Note: Defined to throw an exception if the index does not exist. store.getLexiconRelation().getBlobsIndex(); fail("Expecting: " + IllegalStateException.class); } catch (IllegalStateException ex) { if (log.isInfoEnabled()) log.info("Ignoring expected exception: " + ex); } assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), Integer.MAX_VALUE); } finally { store.__tearDownUnitTest(); } }
/** * Override configuration - BLOBS index uses a non-default threashold. */ public void test_blobsSupport_nonDefaultBlobsIndexThresholdConfiguration() { final Properties p = new Properties(getProperties()); final int overrideThreshold = Integer.valueOf(AbstractTripleStore.Options.DEFAULT_BLOBS_THRESHOLD) * 2; p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(overrideThreshold)); final AbstractTripleStore store = getStore(p); try { final IIndex blobsIndex = store.getLexiconRelation().getBlobsIndex(); assertNotNull(blobsIndex); assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), overrideThreshold); } finally { store.__tearDownUnitTest(); } }
/** * Override configuration - BLOBS index is disabled. */ public void test_blobsSupport_noBlobsIndexConfiguration() { final Properties p = new Properties(getProperties()); p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(Integer.MAX_VALUE)); final AbstractTripleStore store = getStore(p); try { try { // Note: Defined to throw an exception if the index does not exist. store.getLexiconRelation().getBlobsIndex(); fail("Expecting: " + IllegalStateException.class); } catch (IllegalStateException ex) { if (log.isInfoEnabled()) log.info("Ignoring expected exception: " + ex); } assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), Integer.MAX_VALUE); } finally { store.__tearDownUnitTest(); } }
/** * 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(); } }
/** * Defer to the {@link ILexiconConfiguration} which has specific knowledge * of how to generate an RDF value from this general purpose extension IV. * <p> * {@inheritDoc} */ @SuppressWarnings( { "unchecked", "rawtypes" }) public V asValue(final LexiconRelation lex) { V v = getValueCache(); if (v == null) { // final BigdataValueFactory f = lex.getValueFactory(); final ILexiconConfiguration config = lex.getLexiconConfiguration(); v = setValue((V) config.asValue(this));//, f)); v.setIV(this); } return v; }
/** * Defer to the {@link ILexiconConfiguration} which has specific knowledge * of how to generate an RDF value from this general purpose extension IV. * <p> * {@inheritDoc} */ @SuppressWarnings( { "unchecked", "rawtypes" }) public V asValue(final LexiconRelation lex) { V v = getValueCache(); if (v == null) { // final BigdataValueFactory f = lex.getValueFactory(); final ILexiconConfiguration config = lex.getLexiconConfiguration(); v = setValue((V) config.asValue(this));//, f)); v.setIV(this); } return v; }
/** * 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(); } }
private LiteralImpl getLargeLiteral(final AbstractTripleStore store) { final int len = store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(); final StringBuilder sb = new StringBuilder(len); final String[] tokens = new String[] { "apple", "mary", "john", "barley", "mellow", "pudding", "fries", "peal", "gadzooks" }; for (int i = 0; sb.length() < len; i++) { sb.append(tokens[(i % tokens.length)]); sb.append(" "); } final String s = sb.toString(); if (log.isInfoEnabled()) log.info("length(s)=" + s.length()); return new LiteralImpl(s); }
private LiteralImpl getLargeLiteral(final AbstractTripleStore store) { final int len = store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(); final StringBuilder sb = new StringBuilder(len); final String[] tokens = new String[] { "apple", "mary", "john", "barley", "mellow", "pudding", "fries", "peal", "gadzooks" }; for (int i = 0; sb.length() < len; i++) { sb.append(tokens[(i % tokens.length)]); sb.append(" "); } final String s = sb.toString(); if (log.isInfoEnabled()) log.info("length(s)=" + s.length()); return new LiteralImpl(s); }
/** * Override configuration - BLOBS index uses a non-default threashold. */ public void test_blobsSupport_nonDefaultBlobsIndexThresholdConfiguration() { final Properties p = new Properties(getProperties()); final int overrideThreshold = Integer.valueOf(AbstractTripleStore.Options.DEFAULT_BLOBS_THRESHOLD) * 2; p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(overrideThreshold)); final AbstractTripleStore store = getStore(p); try { final IIndex blobsIndex = store.getLexiconRelation().getBlobsIndex(); assertNotNull(blobsIndex); assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), overrideThreshold); } finally { store.__tearDownUnitTest(); } }
/** * Override configuration - BLOBS index is disabled. */ public void test_blobsSupport_noBlobsIndexConfiguration() { final Properties p = new Properties(getProperties()); p.setProperty(AbstractTripleStore.Options.BLOBS_THRESHOLD, Integer.toString(Integer.MAX_VALUE)); final AbstractTripleStore store = getStore(p); try { try { // Note: Defined to throw an exception if the index does not exist. store.getLexiconRelation().getBlobsIndex(); fail("Expecting: " + IllegalStateException.class); } catch (IllegalStateException ex) { if (log.isInfoEnabled()) log.info("Ignoring expected exception: " + ex); } assertEquals(store.getLexiconRelation().getLexiconConfiguration().getBlobsThreshold(), Integer.MAX_VALUE); } finally { store.__tearDownUnitTest(); } }
/** * 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(); } }
final String localName = lex.getLexiconConfiguration() .getInlineURILocalNameFromDelegate(namespace, delegateIV);