This is an automated email from the ASF dual-hosted git repository. andy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/jena.git
commit 5cd34f8ee244dca96fe3c5912258d7638da14dea Author: Andy Seaborne <a...@apache.org> AuthorDate: Mon Jul 15 08:40:02 2024 +0100 Deprecate and rename for TDB1 --- .../java/org/apache/jena/fuseki/TestBuilder.java | 65 ++++--- .../src/main/java/org/apache/jena/tdb/TDB.java | 138 +------------- .../src/main/java/org/apache/jena/tdb1/TDB1.java | 198 +++++++++++---------- .../java/org/apache/jena/tdb1/TDB1Factory.java | 4 +- .../jena/tdb1/assembler/DatasetAssemblerTDB1.java | 4 +- .../apache/jena/tdb1/assembler/IndexAssembler.java | 4 +- .../jena/tdb1/assembler/SettingAssembler.java | 6 +- .../jena/tdb1/assembler/TDB1GraphAssembler.java | 2 +- .../assembler/{AssemblerTDB.java => VocabTDB.java} | 10 +- .../org/apache/jena/tdb1/assembler/VocabTDB1.java | 2 +- .../jena/tdb1/assembler/TestTDBAssembler.java | 4 +- .../jena/tdb1/store/AbstractStoreConnections.java | 11 +- 12 files changed, 170 insertions(+), 278 deletions(-) diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestBuilder.java b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestBuilder.java index bb513a5332..334acb74cc 100644 --- a/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestBuilder.java +++ b/jena-fuseki2/jena-fuseki-webapp/src/test/java/org/apache/jena/fuseki/TestBuilder.java @@ -27,42 +27,39 @@ import org.apache.jena.query.Dataset; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; -import org.apache.jena.tdb1.assembler.VocabTDB; +import org.apache.jena.tdb1.assembler.VocabTDB1; import org.apache.jena.vocabulary.RDF; import org.junit.Test; public class TestBuilder { - - private static final Model dsModel; - private static final Resource dsDesc1; - private static final Resource dsDesc2; - private DatasetDescriptionMap registry = new DatasetDescriptionMap(); - - @Test - public void testVerifySameDatasetObjectForSameDescription() { - - Dataset ds1 = FusekiConfig.getDataset(dsDesc1, registry); - Dataset ds2 = FusekiConfig.getDataset(dsDesc1, registry); - assertEquals(ds1, ds2); - } - - @Test - public void testVerifyDifferentDatasetObjectsForDifferentDescriptions() { - - Dataset ds1 = FusekiConfig.getDataset(dsDesc1, registry); - Dataset ds2 = FusekiConfig.getDataset(dsDesc2, registry); - assertNotEquals(ds1, ds2); - } - - static { - dsModel = ModelFactory.createDefaultModel(); - dsDesc1 = dsModel.createResource() - .addProperty(RDF.type, VocabTDB.tDatasetTDB) - .addProperty(VocabTDB.pLocation, "--mem--") - ; - dsDesc2 = dsModel.createResource() - .addProperty(RDF.type, VocabTDB.tDatasetTDB) - .addProperty(VocabTDB.pLocation, "--mem--") - ; - } + + private static final Model dsModel; + private static final Resource dsDesc1; + private static final Resource dsDesc2; + private DatasetDescriptionMap registry = new DatasetDescriptionMap(); + + static { + dsModel = ModelFactory.createDefaultModel(); + dsDesc1 = dsModel.createResource() + .addProperty(RDF.type, VocabTDB1.tDatasetTDB) + .addProperty(VocabTDB1.pLocation, "--mem--"); + dsDesc2 = dsModel.createResource() + .addProperty(RDF.type, VocabTDB1.tDatasetTDB) + .addProperty(VocabTDB1.pLocation, "--mem--"); + } + @Test + public void testVerifySameDatasetObjectForSameDescription() { + + Dataset ds1 = FusekiConfig.getDataset(dsDesc1, registry); + Dataset ds2 = FusekiConfig.getDataset(dsDesc1, registry); + assertEquals(ds1, ds2); + } + + @Test + public void testVerifyDifferentDatasetObjectsForDifferentDescriptions() { + + Dataset ds1 = FusekiConfig.getDataset(dsDesc1, registry); + Dataset ds2 = FusekiConfig.getDataset(dsDesc2, registry); + assertNotEquals(ds1, ds2); + } } diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDB.java b/jena-tdb1/src/main/java/org/apache/jena/tdb/TDB.java index 22bb208847..d785eb1f03 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDB.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb/TDB.java @@ -18,36 +18,16 @@ package org.apache.jena.tdb ; -import java.util.Iterator ; - -import org.apache.jena.atlas.iterator.Iter ; -import org.apache.jena.atlas.lib.Sync ; import org.apache.jena.atlas.lib.Version; import org.apache.jena.graph.Graph ; -import org.apache.jena.graph.Node ; -import org.apache.jena.ontology.OntModel ; -import org.apache.jena.ontology.impl.OntModelImpl ; -import org.apache.jena.query.ARQ ; import org.apache.jena.query.Dataset ; import org.apache.jena.rdf.model.Model ; -import org.apache.jena.reasoner.InfGraph ; import org.apache.jena.sparql.core.DatasetGraph ; -import org.apache.jena.sparql.engine.main.StageBuilder ; -import org.apache.jena.sparql.engine.main.StageGenerator ; import org.apache.jena.sparql.util.Context ; -import org.apache.jena.sparql.util.MappingRegistry ; import org.apache.jena.sparql.util.Symbol ; import org.apache.jena.sys.JenaSystem ; -import org.apache.jena.tdb1.assembler.AssemblerTDB; -import org.apache.jena.tdb1.modify.UpdateEngineTDB; -import org.apache.jena.tdb1.setup.DatasetBuilderStd; -import org.apache.jena.tdb1.solver.QueryEngineTDB; -import org.apache.jena.tdb1.solver.StageGeneratorDirectTDB; -import org.apache.jena.tdb1.store.DatasetGraphTDB; -import org.apache.jena.tdb1.sys.EnvTDB; +import org.apache.jena.tdb1.TDB1; import org.apache.jena.tdb1.sys.SystemTDB; -import org.apache.jena.tdb1.sys.TDBInternal; -import org.apache.jena.tdb1.transaction.DatasetGraphTransaction; import org.slf4j.Logger ; import org.slf4j.LoggerFactory ; @@ -113,10 +93,8 @@ public class TDB { */ public static final Symbol transactionJournalWriteBlockMode = SystemTDB.allocSymbol("transactionJournalWriteBlockMode") ; - public static final String tdbFaqsLink = "See https://jena.apache.org/documentation/tdb/faqs.html for more information."; - public static Context getContext() { - return ARQ.getContext() ; + return TDB1.getContext(); } /** @@ -124,7 +102,7 @@ public class TDB { * release datasets or graphs held by client code. */ public static void closedown() { - TDBInternal.reset() ; + TDB1.closedown(); } /** @@ -132,84 +110,27 @@ public class TDB { * false to silence the warning */ public static void setOptimizerWarningFlag(boolean b) { - DatasetBuilderStd.setOptimizerWarningFlag(b) ; + TDB1.setOptimizerWarningFlag(b); } /** Sync a TDB-backed Model. Do nothing if not TDB-backed. */ public static void sync(Model model) { - if ( model instanceof OntModelImpl ontModel ) { - sync(ontModel.getBaseGraph()) ; - return ; - } - // This never happens (there is only one OntModel implementation) - if ( model instanceof OntModel ontModel ) { - sync(ontModel.getBaseModel()) ; - return ; - } - - sync(model.getGraph()) ; + TDB1.sync(model); } /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */ public static void sync(Graph graph) { - if ( graph == null ) - return ; - - if ( graph instanceof InfGraph infGraph ) { - sync(infGraph.getRawGraph()) ; - return ; - } - syncObject(graph) ; + TDB1.sync(graph); } /** Sync a TDB-backed Dataset. Do nothing if not TDB-backed. */ public static void sync(Dataset dataset) { - if ( dataset == null ) - return ; - DatasetGraph ds = dataset.asDatasetGraph() ; - sync(ds) ; + TDB1.sync(dataset); } /** Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. */ public static void sync(DatasetGraph dataset) { - if ( dataset == null ) - return ; - - // Should be: SystemARQ.sync(dataset) ; - if ( dataset instanceof DatasetGraphTDB ) { - syncObject(dataset) ; - return ; - } - - if ( dataset instanceof DatasetGraphTransaction dsgtxn ) { - // This only sync if the dataset has not been used transactionally. - // Can't sync transactional datasets (it's meaningless) - dsgtxn.syncIfNotTransactional() ; - return ; - } - - // May be a general purpose dataset with TDB objects in it. - sync(dataset.getDefaultGraph()) ; - Iterator<Node> iter = dataset.listGraphNodes() ; - iter = Iter.toList(iter).iterator() ; // Avoid iterator concurrency. - for (; iter.hasNext();) { - Node n = iter.next() ; - Graph g = dataset.getGraph(n) ; - sync(g) ; - } - } - - /** - * Sync a TDB synchronizable object (model, graph, dataset). If force is - * true, synchronize as much as possible (e.g. file metadata) else make a - * reasonable attempt at synchronization but does not guarantee disk state. - * Do nothing otherwise - */ - private static void syncObject(Object object) { - if ( object == null ) - return ; - if ( object instanceof Sync syncObj ) - syncObj.sync() ; + TDB1.sync(dataset); } /** The root package name for TDB */ @@ -228,47 +149,6 @@ public class TDB { * However, calling it repeatedly is safe and low cost. */ public static void init() { - // Called at start. - if ( initialized ) { - return ; - } - - synchronized(initLock) { - if ( initialized ) { - JenaSystem.logLifecycle("TDB1.init - return") ; - return ; - } - initialized = true ; - JenaSystem.logLifecycle("TDB1.init - start") ; - EnvTDB.processGlobalSystemProperties() ; - - MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix, SystemTDB.symbolNamespace) ; - MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix1, SystemTDB.symbolNamespace) ; - AssemblerTDB.init() ; - QueryEngineTDB.register() ; - UpdateEngineTDB.register() ; - - wireIntoExecution() ; - JenaSystem.logLifecycle("TDB1.init - finish") ; - } - } - - private static void wireIntoExecution() { - // Globally change the stage generator to intercept BGP on TDB - Context cxt = ARQ.getContext() ; - StageGenerator orig = StageBuilder.chooseStageGenerator(cxt) ; - - // Wire in the TDB stage generator which will make TDB work whether - // or not the TDB executor is used. This means that datasets of mixed - // graph types inside a general purpose dataset work. - StageGenerator stageGenerator = new StageGeneratorDirectTDB(orig) ; - StageBuilder.setGenerator(ARQ.getContext(), stageGenerator) ; + TDB1.init(); } - - // Final initialization (in case any statics in this file are important). - static { - initialization2() ; - } - - private static void initialization2() {} } diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1.java index f52cf46731..a0f45b338b 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1.java @@ -16,29 +16,29 @@ * limitations under the License. */ -package org.apache.jena.tdb1 ; +package org.apache.jena.tdb1; -import java.util.Iterator ; +import java.util.Iterator; -import org.apache.jena.atlas.iterator.Iter ; -import org.apache.jena.atlas.lib.Sync ; +import org.apache.jena.atlas.iterator.Iter; +import org.apache.jena.atlas.lib.Sync; import org.apache.jena.atlas.lib.Version; -import org.apache.jena.graph.Graph ; -import org.apache.jena.graph.Node ; -import org.apache.jena.ontology.OntModel ; -import org.apache.jena.ontology.impl.OntModelImpl ; -import org.apache.jena.query.ARQ ; -import org.apache.jena.query.Dataset ; -import org.apache.jena.rdf.model.Model ; -import org.apache.jena.reasoner.InfGraph ; -import org.apache.jena.sparql.core.DatasetGraph ; -import org.apache.jena.sparql.engine.main.StageBuilder ; -import org.apache.jena.sparql.engine.main.StageGenerator ; -import org.apache.jena.sparql.util.Context ; -import org.apache.jena.sparql.util.MappingRegistry ; -import org.apache.jena.sparql.util.Symbol ; -import org.apache.jena.sys.JenaSystem ; -import org.apache.jena.tdb1.assembler.AssemblerTDB; +import org.apache.jena.graph.Graph; +import org.apache.jena.graph.Node; +import org.apache.jena.ontology.OntModel; +import org.apache.jena.ontology.impl.OntModelImpl; +import org.apache.jena.query.ARQ; +import org.apache.jena.query.Dataset; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.reasoner.InfGraph; +import org.apache.jena.sparql.core.DatasetGraph; +import org.apache.jena.sparql.engine.main.StageBuilder; +import org.apache.jena.sparql.engine.main.StageGenerator; +import org.apache.jena.sparql.util.Context; +import org.apache.jena.sparql.util.MappingRegistry; +import org.apache.jena.sparql.util.Symbol; +import org.apache.jena.sys.JenaSystem; +import org.apache.jena.tdb1.assembler.VocabTDB1; import org.apache.jena.tdb1.modify.UpdateEngineTDB; import org.apache.jena.tdb1.setup.DatasetBuilderStd; import org.apache.jena.tdb1.solver.QueryEngineTDB; @@ -48,8 +48,8 @@ import org.apache.jena.tdb1.sys.EnvTDB; import org.apache.jena.tdb1.sys.SystemTDB; import org.apache.jena.tdb1.sys.TDBInternal; import org.apache.jena.tdb1.transaction.DatasetGraphTransaction; -import org.slf4j.Logger ; -import org.slf4j.LoggerFactory ; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TDB1 { @@ -62,12 +62,12 @@ public class TDB1 { // The best order is: // Initialization controls // All calculated constants - // static { JenaSystem.init() ; } - private static final Object initLock = new Object() ; - private static volatile boolean initialized = false ; + // static { JenaSystem.init(); } + private static final Object initLock = new Object(); + private static volatile boolean initialized = false; /** IRI for TDB */ - public static final String tdbIRI = "http://jena.hpl.hp.com/#tdb" ; + public static final String tdbIRI = "http://jena.hpl.hp.com/#tdb"; /** Root of TDB-defined parameter names */ public static final String tdbParamNS = SystemTDB.symbolNamespace; @@ -76,27 +76,27 @@ public class TDB1 { public static final String tdbSymbolPrefix = SystemTDB.tdbSymbolPrefix; // Internal logging - private static final Logger log = LoggerFactory.getLogger(TDB1.class) ; + private static final Logger log = LoggerFactory.getLogger(TDB1.class); /** Logger for loading information */ - public static final String logLoaderName = "org.apache.jena.tdb.loader" ; + public static final String logLoaderName = "org.apache.jena.tdb.loader"; /** Logger for loading information */ - public static final Logger logLoader = LoggerFactory.getLogger(logLoaderName) ; + public static final Logger logLoader = LoggerFactory.getLogger(logLoaderName); /** Logger for general information */ - public static final String logInfoName = "org.apache.jena.info" ; + public static final String logInfoName = "org.apache.jena.info"; /** Logger for general information */ - public static final Logger logInfo = LoggerFactory.getLogger(logInfoName) ; + public static final Logger logInfo = LoggerFactory.getLogger(logInfoName); // /** Logger for execution information */ - // public static final String logExecName = "org.apache.jena.tdb.exec" ; + // public static final String logExecName = "org.apache.jena.tdb.exec"; // /** Logger for execution information */ - // public static final Logger logExec = LoggerFactory.getLogger(logExecName) ; + // public static final Logger logExec = LoggerFactory.getLogger(logExecName); - public final static String namespace = "http://jena.hpl.hp.com/2008/tdb#" ; + public final static String namespace = "http://jena.hpl.hp.com/2008/tdb#"; /** Symbol to use the union of named graphs as the default graph of a query */ - public static final Symbol symUnionDefaultGraph = SystemTDB.allocSymbol("unionDefaultGraph") ; + public static final Symbol symUnionDefaultGraph = SystemTDB.allocSymbol("unionDefaultGraph"); /** * A String enum Symbol that specifies the type of temporary storage for @@ -106,12 +106,12 @@ public class TDB1 { * "direct" = Process heap memory <br> * "mapped" = Memory mapped temporary file <br> */ - public static final Symbol transactionJournalWriteBlockMode = SystemTDB.allocSymbol("transactionJournalWriteBlockMode") ; + public static final Symbol transactionJournalWriteBlockMode = SystemTDB.allocSymbol("transactionJournalWriteBlockMode"); public static final String tdbFaqsLink = "See https://jena.apache.org/documentation/tdb/faqs.html for more information."; public static Context getContext() { - return ARQ.getContext() ; + return ARQ.getContext(); } /** @@ -119,7 +119,7 @@ public class TDB1 { * release datasets or graphs held by client code. */ public static void closedown() { - TDBInternal.reset() ; + TDBInternal.reset(); } /** @@ -127,70 +127,86 @@ public class TDB1 { * false to silence the warning */ public static void setOptimizerWarningFlag(boolean b) { - DatasetBuilderStd.setOptimizerWarningFlag(b) ; + DatasetBuilderStd.setOptimizerWarningFlag(b); } - /** Sync a TDB-backed Model. Do nothing if not TDB-backed. */ + /** + * Sync a TDB-backed Model. Do nothing if not TDB-backed. + * @deprecated Use transactions. + */ + @Deprecated(forRemoval = true) public static void sync(Model model) { if ( model instanceof OntModelImpl ontModel ) { - sync(ontModel.getBaseGraph()) ; - return ; + sync(ontModel.getBaseGraph()); + return; } // This never happens (there is only one OntModel implementation) if ( model instanceof OntModel ontModel ) { - sync(ontModel.getBaseModel()) ; - return ; + sync(ontModel.getBaseModel()); + return; } - sync(model.getGraph()) ; + sync(model.getGraph()); } - /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */ + /** + * Sync a TDB-backed Graph. Do nothing if not TDB-backed. + * @deprecated Use transactions. + */ + @Deprecated(forRemoval = true) public static void sync(Graph graph) { if ( graph == null ) - return ; + return; if ( graph instanceof InfGraph infGraph ) { - sync(infGraph.getRawGraph()) ; - return ; + sync(infGraph.getRawGraph()); + return; } - syncObject(graph) ; + syncObject(graph); } - /** Sync a TDB-backed Dataset. Do nothing if not TDB-backed. */ + /** + * Sync a TDB-backed Dataset. Do nothing if not TDB-backed. + * @deprecated Use transactions. + */ + @Deprecated(forRemoval = true) public static void sync(Dataset dataset) { if ( dataset == null ) - return ; - DatasetGraph ds = dataset.asDatasetGraph() ; - sync(ds) ; + return; + DatasetGraph ds = dataset.asDatasetGraph(); + sync(ds); } - /** Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. */ + /** + * Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. + * @deprecated Use transactions. + */ + @Deprecated(forRemoval = true) public static void sync(DatasetGraph dataset) { if ( dataset == null ) - return ; + return; - // Should be: SystemARQ.sync(dataset) ; + // Should be: SystemARQ.sync(dataset); if ( dataset instanceof DatasetGraphTDB ) { - syncObject(dataset) ; - return ; + syncObject(dataset); + return; } if ( dataset instanceof DatasetGraphTransaction dsgtxn ) { // This only sync if the dataset has not been used transactionally. // Can't sync transactional datasets (it's meaningless) - dsgtxn.syncIfNotTransactional() ; - return ; + dsgtxn.syncIfNotTransactional(); + return; } // May be a general purpose dataset with TDB objects in it. - sync(dataset.getDefaultGraph()) ; - Iterator<Node> iter = dataset.listGraphNodes() ; - iter = Iter.toList(iter).iterator() ; // Avoid iterator concurrency. + sync(dataset.getDefaultGraph()); + Iterator<Node> iter = dataset.listGraphNodes(); + iter = Iter.toList(iter).iterator(); // Avoid iterator concurrency. for (; iter.hasNext();) { - Node n = iter.next() ; - Graph g = dataset.getGraph(n) ; - sync(g) ; + Node n = iter.next(); + Graph g = dataset.getGraph(n); + sync(g); } } @@ -202,14 +218,14 @@ public class TDB1 { */ private static void syncObject(Object object) { if ( object == null ) - return ; + return; if ( object instanceof Sync syncObj ) - syncObj.sync() ; + syncObj.sync(); } /** The root package name for TDB */ - public static final String PATH = "org.apache.jena.tdb" ; - public static final String NAME = "TDB1" ; + public static final String PATH = "org.apache.jena.tdb"; + public static final String NAME = "TDB1"; /** The full name of the current TDB version */ public static final String VERSION = Version.versionForClass(TDB1.class).orElse("<development>"); @@ -223,44 +239,44 @@ public class TDB1 { public static void init() { // Called at start. if ( initialized ) { - return ; + return; } synchronized(initLock) { if ( initialized ) { - JenaSystem.logLifecycle("TDB1.init - return") ; - return ; + JenaSystem.logLifecycle("TDB1.init - return"); + return; } - initialized = true ; - JenaSystem.logLifecycle("TDB1.init - start") ; - EnvTDB.processGlobalSystemProperties() ; - - MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix, SystemTDB.symbolNamespace) ; - MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix1, SystemTDB.symbolNamespace) ; - AssemblerTDB.init() ; - QueryEngineTDB.register() ; - UpdateEngineTDB.register() ; - - wireIntoExecution() ; - JenaSystem.logLifecycle("TDB1.init - finish") ; + initialized = true; + JenaSystem.logLifecycle("TDB1.init - start"); + EnvTDB.processGlobalSystemProperties(); + + MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix, SystemTDB.symbolNamespace); + MappingRegistry.addPrefixMapping(SystemTDB.tdbSymbolPrefix1, SystemTDB.symbolNamespace); + VocabTDB1.init(); + QueryEngineTDB.register(); + UpdateEngineTDB.register(); + + wireIntoExecution(); + JenaSystem.logLifecycle("TDB1.init - finish"); } } private static void wireIntoExecution() { // Globally change the stage generator to intercept BGP on TDB - Context cxt = ARQ.getContext() ; - StageGenerator orig = StageBuilder.chooseStageGenerator(cxt) ; + Context cxt = ARQ.getContext(); + StageGenerator orig = StageBuilder.chooseStageGenerator(cxt); // Wire in the TDB stage generator which will make TDB work whether // or not the TDB executor is used. This means that datasets of mixed // graph types inside a general purpose dataset work. - StageGenerator stageGenerator = new StageGeneratorDirectTDB(orig) ; - StageBuilder.setGenerator(ARQ.getContext(), stageGenerator) ; + StageGenerator stageGenerator = new StageGeneratorDirectTDB(orig); + StageBuilder.setGenerator(ARQ.getContext(), stageGenerator); } // Final initialization (in case any statics in this file are important). static { - initialization2() ; + initialization2(); } private static void initialization2() {} diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1Factory.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1Factory.java index d0fd416510..f981d9bf53 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1Factory.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/TDB1Factory.java @@ -26,7 +26,7 @@ import org.apache.jena.query.DatasetFactory ; import org.apache.jena.sparql.core.DatasetGraph ; import org.apache.jena.sparql.core.assembler.AssemblerUtils ; import org.apache.jena.sys.JenaSystem ; -import org.apache.jena.tdb1.assembler.VocabTDB; +import org.apache.jena.tdb1.assembler.VocabTDB1; import org.apache.jena.tdb1.base.file.Location; import org.apache.jena.tdb1.setup.StoreParams; import org.apache.jena.tdb1.store.DatasetGraphTDB; @@ -44,7 +44,7 @@ public class TDB1Factory /** Read the file and assembler a dataset */ public static Dataset assembleDataset(String assemblerFile) { - return (Dataset)AssemblerUtils.build(assemblerFile, VocabTDB.tDatasetTDB); + return (Dataset)AssemblerUtils.build(assemblerFile, VocabTDB1.tDatasetTDB); } /** Create or connect to a TDB-backed dataset */ diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/DatasetAssemblerTDB1.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/DatasetAssemblerTDB1.java index de5a7e9fd8..24663d2179 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/DatasetAssemblerTDB1.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/DatasetAssemblerTDB1.java @@ -20,8 +20,8 @@ package org.apache.jena.tdb1.assembler; import static org.apache.jena.sparql.util.graph.GraphUtils.exactlyOneProperty ; import static org.apache.jena.sparql.util.graph.GraphUtils.getStringValue ; -import static org.apache.jena.tdb1.assembler.VocabTDB.pLocation; -import static org.apache.jena.tdb1.assembler.VocabTDB.pUnionDefaultGraph; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pLocation; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pUnionDefaultGraph; import org.apache.jena.assembler.Assembler ; import org.apache.jena.assembler.exceptions.AssemblerException ; diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/IndexAssembler.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/IndexAssembler.java index bcd894e610..521762866b 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/IndexAssembler.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/IndexAssembler.java @@ -20,8 +20,8 @@ package org.apache.jena.tdb1.assembler; import static org.apache.jena.sparql.util.graph.GraphUtils.exactlyOneProperty ; import static org.apache.jena.sparql.util.graph.GraphUtils.getAsStringValue ; -import static org.apache.jena.tdb1.assembler.VocabTDB.pDescription; -import static org.apache.jena.tdb1.assembler.VocabTDB.pFile; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pDescription; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pFile; import java.util.Locale ; diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/SettingAssembler.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/SettingAssembler.java index a230e0fc42..b6439a124b 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/SettingAssembler.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/SettingAssembler.java @@ -20,9 +20,9 @@ package org.apache.jena.tdb1.assembler; import static org.apache.jena.sparql.util.graph.GraphUtils.getAsStringValue ; import static org.apache.jena.sparql.util.graph.GraphUtils.getResourceValue ; -import static org.apache.jena.tdb1.assembler.VocabTDB.pName; -import static org.apache.jena.tdb1.assembler.VocabTDB.pSetting; -import static org.apache.jena.tdb1.assembler.VocabTDB.pValue; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pName; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pSetting; +import static org.apache.jena.tdb1.assembler.VocabTDB1.pValue; import org.apache.jena.assembler.Assembler ; import org.apache.jena.assembler.Mode ; diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/TDB1GraphAssembler.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/TDB1GraphAssembler.java index f4e02b3ad9..d6fca757b3 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/TDB1GraphAssembler.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/TDB1GraphAssembler.java @@ -21,7 +21,7 @@ package org.apache.jena.tdb1.assembler; import static org.apache.jena.sparql.util.graph.GraphUtils.getAsStringValue ; import static org.apache.jena.sparql.util.graph.GraphUtils.getResourceValue ; import static org.apache.jena.sparql.util.graph.GraphUtils.getStringValue ; -import static org.apache.jena.tdb1.assembler.VocabTDB.*; +import static org.apache.jena.tdb1.assembler.VocabTDB1.*; import org.apache.jena.assembler.Assembler ; import org.apache.jena.assembler.Mode ; diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/AssemblerTDB.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB.java similarity index 88% rename from jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/AssemblerTDB.java rename to jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB.java index 70a90c8bc9..fd38681b6e 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/AssemblerTDB.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB.java @@ -18,10 +18,8 @@ package org.apache.jena.tdb1.assembler; -public class AssemblerTDB -{ - public static void init() - { - VocabTDB.init(); - } +/** @deprecated Use {@link VocabTDB1} */ +@Deprecated(forRemoval = true) +public class VocabTDB extends VocabTDB1 { + } diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB1.java b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB1.java index c922940ae0..b226fb4424 100644 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB1.java +++ b/jena-tdb1/src/main/java/org/apache/jena/tdb1/assembler/VocabTDB1.java @@ -24,7 +24,7 @@ import org.apache.jena.sparql.core.assembler.AssemblerUtils ; import org.apache.jena.system.Vocab; import org.apache.jena.tdb1.TDB1; -public class VocabTDB +public class VocabTDB1 { private static final String NS = TDB1.namespace ; diff --git a/jena-tdb1/src/test/java/org/apache/jena/tdb1/assembler/TestTDBAssembler.java b/jena-tdb1/src/test/java/org/apache/jena/tdb1/assembler/TestTDBAssembler.java index 4e1bdeb18d..d07ced94b7 100644 --- a/jena-tdb1/src/test/java/org/apache/jena/tdb1/assembler/TestTDBAssembler.java +++ b/jena-tdb1/src/test/java/org/apache/jena/tdb1/assembler/TestTDBAssembler.java @@ -65,7 +65,7 @@ public class TestTDBAssembler @Test public void createDatasetDirect() { - createTest(dirAssem+"/tdb-dataset.ttl", VocabTDB.tDatasetTDB) ; + createTest(dirAssem+"/tdb-dataset.ttl", VocabTDB1.tDatasetTDB) ; } @Test public void createDatasetEmbed() @@ -127,7 +127,7 @@ public class TestTDBAssembler private static void testGraph(String assemblerFile, boolean named) { Object thing = null ; - try { thing = AssemblerUtils.build( assemblerFile, VocabTDB.tGraphTDB) ; } + try { thing = AssemblerUtils.build( assemblerFile, VocabTDB1.tGraphTDB) ; } catch (AssemblerException e) { e.getCause().printStackTrace(System.err) ; diff --git a/jena-tdb1/src/test/java/org/apache/jena/tdb1/store/AbstractStoreConnections.java b/jena-tdb1/src/test/java/org/apache/jena/tdb1/store/AbstractStoreConnections.java index b3138e6827..221db5e11e 100644 --- a/jena-tdb1/src/test/java/org/apache/jena/tdb1/store/AbstractStoreConnections.java +++ b/jena-tdb1/src/test/java/org/apache/jena/tdb1/store/AbstractStoreConnections.java @@ -44,17 +44,17 @@ import org.junit.Test ; public abstract class AbstractStoreConnections { // Subclass to give direct and mapped versions. - + // Per-test unique-ish. static int count = 0 ; long x = System.currentTimeMillis()+(count++) ; - + Quad q = SSE.parseQuad("(<g> <s> <p> '000-"+x+"') ") ; Quad q1 = SSE.parseQuad("(<g> <s> <p> '111-"+x+"')") ; Quad q2 = SSE.parseQuad("(<g> <s> <p> '222-"+x+"')") ; Quad q3 = SSE.parseQuad("(<g> <s> <p> '333-"+x+"')") ; Quad q4 = SSE.parseQuad("(<g> <s> <p> '444-"+x+"')") ; - + String DIR = null ; @Before public void before() @@ -63,7 +63,7 @@ public abstract class AbstractStoreConnections DIR = ConfigTest.getCleanDir() ; } - @After public void after() {} + @After public void after() {} protected StoreConnection getStoreConnection() { return StoreConnection.make(DIR) ; @@ -180,6 +180,7 @@ public abstract class AbstractStoreConnections dsgTxn2.end() ; } + @SuppressWarnings("removal") @Test public void store_7() { // No transaction, plain update, then transaction. @@ -237,6 +238,6 @@ public abstract class AbstractStoreConnections assertEquals(nonTxnData ? 2 : 1, m.size()) ; ds.end() ; } - + }