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 ba2a35fbf3d4eaf20eb1196e675c5f9a5a3b4aae Author: Andy Seaborne <[email protected]> AuthorDate: Sat Oct 25 09:35:54 2025 +0100 GH-3545: Remove package org.apache.jena.tdb --- .../src/main/java/org/apache/jena/tdb/TDB.java | 159 -------------- .../main/java/org/apache/jena/tdb/TDBBackup.java | 51 ----- .../main/java/org/apache/jena/tdb/TDBFactory.java | 214 ------------------ .../main/java/org/apache/jena/tdb/TDBLoader.java | 240 --------------------- 4 files changed, 664 deletions(-) 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 deleted file mode 100644 index d27820de43..0000000000 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDB.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.tdb ; - -import org.apache.jena.atlas.lib.Version; -import org.apache.jena.graph.Graph ; -import org.apache.jena.query.Dataset ; -import org.apache.jena.rdf.model.Model ; -import org.apache.jena.sparql.core.DatasetGraph ; -import org.apache.jena.sparql.util.Context ; -import org.apache.jena.sparql.util.Symbol ; -import org.apache.jena.sys.JenaSystem ; -import org.apache.jena.tdb1.TDB1; -import org.apache.jena.tdb1.sys.SystemTDB; -import org.slf4j.Logger ; -import org.slf4j.LoggerFactory ; - -/** - * @deprecated Migrate to TDB2 - */ -@Deprecated(forRemoval = true) -@SuppressWarnings("all") -public class TDB { - - private TDB() {} - - // Initialization statics must be first in the class to avoid - // problems with recursive initialization. Specifically, - // initLock being null because elsewhere started the initialization - // and is calling into the TDB class. - // 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 ; - - /** IRI for 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; - - /** Prefix for TDB-defined parameter names */ - public static final String tdbSymbolPrefix = SystemTDB.tdbSymbolPrefix; - - // Internal logging - private static final Logger log = LoggerFactory.getLogger(TDB.class) ; - - /** Logger for loading information */ - public static final String logLoaderName = "org.apache.jena.tdb.loader" ; - /** Logger for loading information */ - public static final Logger logLoader = LoggerFactory.getLogger(logLoaderName) ; - - /** Logger for general information */ - public static final String logInfoName = "org.apache.jena.info" ; - /** Logger for general information */ - public static final Logger logInfo = LoggerFactory.getLogger(logInfoName) ; - - // /** Logger for execution information */ - // public static final String logExecName = "org.apache.jena.tdb.exec" ; - // /** Logger for execution information */ - // public static final Logger logExec = LoggerFactory.getLogger(logExecName) ; - - 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") ; - - /** - * A String enum Symbol that specifies the type of temporary storage for - * transaction journal write blocks. - * <p> - * "mem" = Java heap memory (default) <br> - * "direct" = Process heap memory <br> - * "mapped" = Memory mapped temporary file <br> - */ - public static final Symbol transactionJournalWriteBlockMode = SystemTDB.allocSymbol("transactionJournalWriteBlockMode") ; - - public static Context getContext() { - return TDB1.getContext(); - } - - /** - * Release any and all system resources held by TDB. This does NOT close or - * release datasets or graphs held by client code. - */ - public static void closedown() { - TDB1.closedown(); - } - - /** - * Set the global flag that control the "No BGP optimizer" warning. Set to - * false to silence the warning - */ - public static void setOptimizerWarningFlag(boolean b) { - TDB1.setOptimizerWarningFlag(b); - } - - /** Sync a TDB-backed Model. Do nothing if not TDB-backed. */ - @SuppressWarnings({"deprecated", "removal"}) - public static void sync(Model model) { - TDB1.sync(model); - } - - /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */ - @SuppressWarnings({"deprecated", "removal"}) - public static void sync(Graph graph) { - TDB1.sync(graph); - } - - /** Sync a TDB-backed Dataset. Do nothing if not TDB-backed. */ - @SuppressWarnings({"deprecated", "removal"}) - public static void sync(Dataset dataset) { - TDB1.sync(dataset); - } - - /** Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. */ - @SuppressWarnings({"deprecated", "removal"}) - public static void sync(DatasetGraph dataset) { - TDB1.sync(dataset); - } - - /** The root package name for TDB */ - public static final String PATH = "org.apache.jena.tdb" ; - // The names known to ModVersion : "NAME", "VERSION", "BUILD_DATE" - - public static final String NAME = "TDB1" ; - /** The full name of the current TDB version */ - public static final String VERSION = Version.versionForClass(TDB.class).orElse("<development>"); - - static { JenaSystem.init(); } - - /** - * TDB System initialization - normally, this is not explicitly called - * because Jena system wide initialization occurs automatically. - * However, calling it repeatedly is safe and low cost. - */ - public static void init() { - TDB1.init(); - } -} diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBBackup.java b/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBBackup.java deleted file mode 100644 index 005c1f5490..0000000000 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBBackup.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.tdb; - -import java.io.OutputStream; - -import org.apache.jena.tdb1.TDB1Backup; -import org.apache.jena.tdb1.base.file.Location; - -/** - * Backup a database. - * @deprecated Migrate to TDB2 - */ -@Deprecated(forRemoval = true) -public class TDBBackup -{ - /** - * @deprecated Use - * {@link org.apache.jena.tdb1.TDB1Backup#backup(Location, String)} - */ - @Deprecated(forRemoval = true) - public static void backup(Location location, String backupfile) { - TDB1Backup.backup(location, backupfile); - } - - /** - * @deprecated Use - * {@link org.apache.jena.tdb1.TDB1Backup#backup(Location, OutputStream)} - */ - @Deprecated(forRemoval = true) - public static void backup(Location location, OutputStream backupfile) { - TDB1Backup.backup(location, backupfile); - } -} - diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBFactory.java b/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBFactory.java deleted file mode 100644 index 573103e588..0000000000 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBFactory.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.tdb; - - -import org.apache.jena.query.Dataset ; -import org.apache.jena.sparql.core.DatasetGraph ; -import org.apache.jena.sys.JenaSystem ; -import org.apache.jena.tdb1.TDB1Factory; -import org.apache.jena.tdb1.base.file.Location; -import org.apache.jena.tdb1.setup.StoreParams; - -/** Public factory for creating objects datasets backed by TDB1 storage. - * @deprecated Migrate to TDB2 - * - */ -@Deprecated(forRemoval = true) -public class TDBFactory { - static { - JenaSystem.init(); - } - - private TDBFactory() {} - - /** - * Read the file and assembler a dataset. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#assembleDataset} - */ - @Deprecated - public static Dataset assembleDataset(String assemblerFile) { - return TDB1Factory.assembleDataset(assemblerFile); - } - - /** - * Create or connect to a TDB-backed dataset. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDataset} - */ - @Deprecated - public static Dataset createDataset(String dir) { - return TDB1Factory.createDataset(dir); - } - - /** - * Create or connect to a TDB-backed dataset. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDataset(Location)} - */ - @Deprecated - public static Dataset createDataset(Location location) { - return TDB1Factory.createDataset(location); - } - - /** - * Create or connect to a TDB dataset backed by an in-memory block manager. For - * testing. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDataset()} - */ - @Deprecated - public static Dataset createDataset() { - return TDB1Factory.createDataset(); - } - - /** - * Create or connect to a TDB-backed dataset (graph-level). - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDatasetGraph(String)} - */ - @Deprecated - public static DatasetGraph createDatasetGraph(String directory) { - return TDB1Factory.createDatasetGraph(directory); - } - - /** - * Create or connect to a TDB-backed dataset (graph-level). - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDatasetGraph(Location)} - */ - @Deprecated - public static DatasetGraph createDatasetGraph(Location location) { - return TDB1Factory.createDatasetGraph(location); - } - - /** - * Create a TDB-backed dataset (graph-level) in memory (for testing). - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#createDatasetGraph()} - */ - @Deprecated - public static DatasetGraph createDatasetGraph() { - return TDB1Factory.createDatasetGraph(); - } - - /** - * Release from the JVM. All caching is lost. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#release(Dataset)} - */ - @Deprecated - public static void release(Dataset dataset) { - TDB1Factory.release(dataset); - } - - /** - * Release from the JVM. All caching is lost. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#release(DatasetGraph)} - */ - @Deprecated - public static void release(DatasetGraph dataset) { - TDB1Factory.release(dataset); - } - - /** - * Test whether a dataset is backed by TDB. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#isTDB1(Dataset)} - */ - @Deprecated - public static boolean isTDB1(Dataset dataset) { - return TDB1Factory.isTDB1(dataset); - } - - /** - * Test whether a dataset is backed by TDB. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#isTDB1(DatasetGraph)} - */ - @Deprecated - public static boolean isTDB1(DatasetGraph datasetGraph) { - return TDB1Factory.isTDB1(datasetGraph); - } - - /** - * Return the location of a dataset if it is backed by TDB, else null. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#location(Dataset)} - */ - @Deprecated - public static Location location(Dataset dataset) { - return TDB1Factory.location(dataset); - } - - /** - * Return the location of a DatasetGraph if it is backed by TDB, else null. - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#location(DatasetGraph)} - */ - @Deprecated - public static Location location(DatasetGraph datasetGraph) { - return TDB1Factory.location(datasetGraph); - } - - /** - * Test whether a location already has a TDB database or whether a call to - * TDBFactory will cause a new, fresh TDB database to be created (pragmatic - * tests). The directory may be empty, or not exist. Existing databases return - * "true". - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#inUseLocation(String)} - */ - @Deprecated - public static boolean inUseLocation(String directory) { - return TDB1Factory.inUseLocation(directory); - } - - /** - * Test whether a location already has a TDB database or whether a call to - * TDBFactory will cause a new, fresh TDB database to be created (pragmatic - * tests). The directory may be empty, or not exist. Existing databases return - * "true". - * - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#inUseLocation(Location)} - */ - @Deprecated - public static boolean inUseLocation(Location location) { - return TDB1Factory.inUseLocation(location); - } - - /** - * Set the {@link StoreParams} for specific Location. This call must only be - * called before a dataset from Location is created. This operation should be - * used with care; bad choices of {@link StoreParams} can reduce performance. - * <a href="http://jena.apache.org/documentation/tdb/store-parameters.html">See - * documentation</a>. - * - * @param location The persistent storage location - * @param params StoreParams to use - * @throws IllegalStateException If the dataset has already been setup. - * @deprecated Use {@link org.apache.jena.tdb1.TDB1Factory#setup} - */ - @Deprecated - public static void setup(Location location, StoreParams params) { - TDB1Factory.setup(location, params); - } -} diff --git a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBLoader.java b/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBLoader.java deleted file mode 100644 index 24b2eeac59..0000000000 --- a/jena-tdb1/src/main/java/org/apache/jena/tdb/TDBLoader.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.tdb; - -import java.io.InputStream ; -import java.util.List ; - -import org.apache.jena.rdf.model.Model ; -import org.apache.jena.riot.Lang; -import org.apache.jena.tdb1.TDB1Loader; -import org.apache.jena.tdb1.store.DatasetGraphTDB; -import org.apache.jena.tdb1.store.GraphTDB; - -/** Public interface to the loader functionality. - * The bulk loader is not transactional. - * - * @deprecated Migrate to TDB2 - */ -@Deprecated(forRemoval = true) -public class TDBLoader -{ - /** Load the contents of URL into a dataset. - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(DatasetGraphTDB dataset, String url) { - load(dataset, url, false); - } - - /** - * Load the contents of URL into a dataset. - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(DatasetGraphTDB dataset, String url, boolean showProgress) { - load(dataset, List.of(url), showProgress, true); - } - - /** - * Load the contents of URL into a dataset. - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(DatasetGraphTDB dataset, List<String> urls) { - load(dataset, urls, false, true); - } - - /** - * Load the contents of URL into a dataset. - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(DatasetGraphTDB dataset, List<String> urls, boolean showProgress, boolean generateStats) { - TDB1Loader.load(dataset, urls, showProgress, generateStats); - } - - /** Load a dataset from an input stream which must be in N-Quads form - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(DatasetGraphTDB dataset, InputStream input, Lang lang, boolean showProgress, boolean generateStats) { - TDB1Loader.load(dataset, input, lang, showProgress, generateStats); - } - - /** Load the contents of URL into a graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(GraphTDB graph, String url) { - load(graph, url, false); - } - - /** Load the contents of URL into a graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(GraphTDB graph, String url, boolean showProgress) { - load(graph, List.of(url), showProgress); - } - - /** Load the contents of URL into a graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void load(GraphTDB graph, List<String> urls) { - load(graph, urls, false); - } - - /** Load the contents of URL into a graph */ - @Deprecated - public static void load(GraphTDB graph, List<String> urls, boolean showProgress) { - TDB1Loader.load(graph, urls, showProgress); - } - - /** - * Load the contents of URL into a model - may not be as efficient as bulk - * loading into a TDB graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void loadModel(Model model, String url) { - TDB1Loader.loadModel(model, url); - } - - /** - * Load the contents of URL into a model - may not be as efficient as bulk - * loading into a TDB graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void loadModel(Model model, String url, boolean showProgress) { - TDB1Loader.loadModel(model, url, showProgress); - } - - /** - * Load the contents of a list of URLs into a model - may not be as efficient as - * bulk loading into a TDB graph - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public static void loadModel(Model model, List<String> urls, boolean showProgress) { - TDB1Loader.loadModel(model, urls, showProgress); - } - - // ---- The class itself. - - // ---- The class itself. - - private final TDB1Loader tdb1loader; - @Deprecated - public TDBLoader() { - this.tdb1loader = new TDB1Loader(); - } - - /** Load a graph from a URL - assumes URL names a triples format document - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public void loadGraph(GraphTDB graph, String url) { - tdb1loader.loadGraph(graph, List.of(url)); - } - - /** - * Load a graph from a list of URL - assumes the URLs name triples format - * documents - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public void loadGraph(GraphTDB graph, List<String> urls) { - tdb1loader.loadGraph(graph, urls); - } - - /** - * Load a graph from a list of URL - assumes the URLs name triples format - * documents - */ - @Deprecated - public void loadGraph(GraphTDB graph, InputStream in) { - tdb1loader.loadGraph(graph, in); - } - - /** Load a dataset from a URL - assumes URL names a quads format - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public void loadDataset(DatasetGraphTDB dataset, String url) { - tdb1loader.loadDataset(dataset, List.of(url)); - } - - /** - * Load a dataset from a list of URL - assumes the URLs name quads format - * documents - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public void loadDataset(DatasetGraphTDB dataset, List<String> urls) { - // Triples languages are quads languages so no test for quad-ness needed. - tdb1loader.loadDataset(dataset, urls); - } - - /** Load a dataset from an input stream - * @deprecated Use {@link TDB1Loader} - */ - @Deprecated - public void loadDataset(DatasetGraphTDB dataset, InputStream input, Lang lang) { - tdb1loader.loadDataset(dataset, input, lang); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public boolean getChecking() { - return tdb1loader.getChecking(); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public void setChecking(boolean checking) { - tdb1loader.setChecking(checking); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public boolean getShowProgress() { - return tdb1loader.getShowProgress(); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public void setShowProgress(boolean showProgress) { - tdb1loader.setChecking(showProgress); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public boolean getGenerateStats() { - return tdb1loader.getGenerateStats(); - } - - /** @deprecated Use {@link TDB1Loader} */ - @Deprecated - public void setGenerateStats(boolean generateStats) { - tdb1loader.setGenerateStats(generateStats); - } -}
