From: <mrp...@us...> - 2010-08-02 21:36:59
|
Revision: 3393 http://bigdata.svn.sourceforge.net/bigdata/?rev=3393&view=rev Author: mrpersonick Date: 2010-08-02 21:36:53 +0000 (Mon, 02 Aug 2010) Log Message: ----------- made the getInlineIV method public Modified Paths: -------------- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-02 17:10:15 UTC (rev 3392) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-02 21:36:53 UTC (rev 3393) @@ -2313,7 +2313,7 @@ * the inline internal value, or <code>null</code> if it cannot * be converted */ - private IV getInlineIV(Value value) { + final public IV getInlineIV(Value value) { return getLexiconConfiguration().createInlineIV(value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-08-03 15:11:16
|
Revision: 3400 http://bigdata.svn.sourceforge.net/bigdata/?rev=3400&view=rev Author: thompsonbry Date: 2010-08-03 15:11:09 +0000 (Tue, 03 Aug 2010) Log Message: ----------- Made the lexiconConfiguration an eagerly initialized and final object. Modified Paths: -------------- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-03 15:10:31 UTC (rev 3399) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-03 15:11:09 UTC (rev 3400) @@ -391,6 +391,29 @@ AbstractTripleStore.Options.INLINE_BNODES, AbstractTripleStore.Options.DEFAULT_INLINE_BNODES)); + try { + + final Class<IExtensionFactory> xfc = + determineExtensionFactoryClass(); + final IExtensionFactory xFactory = xfc.newInstance(); + + /* + * Allow the extensions to resolve their datatype URIs into + * term identifiers. + */ + xFactory.resolveDatatypes(this); + + lexiconConfiguration = new LexiconConfiguration( + inlineLiterals, inlineBNodes, xFactory); + + } catch (InstantiationException e) { + throw new IllegalArgumentException( + AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); + } catch (IllegalAccessException e) { + throw new IllegalArgumentException( + AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); + } + } } @@ -1022,7 +1045,7 @@ * numTerms-1). The inline method will respect those semantics but * then return a dense array of terms that definitely should be added * to the lexicon indices - that is, terms in the original array at - * index less than numTerms and not inlinable. + * index less than numTerms and not inlinable. MRP [BBT This is not as efficient!] */ final BigdataValue[] terms2 = addInlineTerms(terms, numTerms); final int numTerms2 = terms2.length; @@ -1252,7 +1275,7 @@ * @return * the terms that were in consideration but could not be inlined */ - private BigdataValue[] addInlineTerms(BigdataValue[] terms, int numTerms) { + private BigdataValue[] addInlineTerms(final BigdataValue[] terms, final int numTerms) { // these are the terms that will need to be indexed (not inline terms) final ArrayList<BigdataValue> terms2 = @@ -2077,7 +2100,7 @@ * The {@link ILexiconConfiguration} instance, which will determine how * terms are encoded and decoded in the key space. */ - private ILexiconConfiguration lexiconConfiguration; + private final ILexiconConfiguration lexiconConfiguration; /** * Constant for the {@link LexiconRelation} namespace component. @@ -2313,7 +2336,7 @@ * the inline internal value, or <code>null</code> if it cannot * be converted */ - final public IV getInlineIV(Value value) { + final public IV getInlineIV(final Value value) { return getLexiconConfiguration().createInlineIV(value); @@ -2629,32 +2652,32 @@ */ public ILexiconConfiguration getLexiconConfiguration() { - if (lexiconConfiguration == null) { - - try { - - final Class<IExtensionFactory> xfc = - determineExtensionFactoryClass(); - final IExtensionFactory xFactory = xfc.newInstance(); - - /* - * Allow the extensions to resolve their datatype URIs into - * term identifiers. - */ - xFactory.resolveDatatypes(this); - - lexiconConfiguration = new LexiconConfiguration( - inlineLiterals, inlineBNodes, xFactory); - - } catch (InstantiationException e) { - throw new IllegalArgumentException( - AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException( - AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); - } - - } +// if (lexiconConfiguration == null) { +// +// try { +// +// final Class<IExtensionFactory> xfc = +// determineExtensionFactoryClass(); +// final IExtensionFactory xFactory = xfc.newInstance(); +// +// /* +// * Allow the extensions to resolve their datatype URIs into +// * term identifiers. +// */ +// xFactory.resolveDatatypes(this); +// +// lexiconConfiguration = new LexiconConfiguration( +// inlineLiterals, inlineBNodes, xFactory); +// +// } catch (InstantiationException e) { +// throw new IllegalArgumentException( +// AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); +// } catch (IllegalAccessException e) { +// throw new IllegalArgumentException( +// AbstractTripleStore.Options.EXTENSION_FACTORY_CLASS, e); +// } +// +// } return lexiconConfiguration; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-08-04 20:26:10
|
Revision: 3412 http://bigdata.svn.sourceforge.net/bigdata/?rev=3412&view=rev Author: thompsonbry Date: 2010-08-04 20:26:03 +0000 (Wed, 04 Aug 2010) Log Message: ----------- Bug fix at com.bigdata.rdf.lexicon.LexiconRelation$ResolveTermTask.call(LexiconRelation.java:1899) an assert was using "==" when it should have been using equals() to compare IVs. Modified Paths: -------------- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-04 20:06:49 UTC (rev 3411) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java 2010-08-04 20:26:03 UTC (rev 3412) @@ -1896,7 +1896,7 @@ * IllegalStateException if the value somehow was assigned * the wrong term identifier (paranoia test). */ - assert value.getIV() == tid : "expecting tid=" + tid + assert value.getIV().equals(tid) : "expecting tid=" + tid + ", but found " + value.getIV(); assert (value).getValueFactory() == valueFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |