java.lang.Object
org.apache.jena.tdb2.DatabaseMgr
Operations for TDBS DatasetGraph, including admin operations
See
TDB2Factory
for creating API-level Datasets
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
backup
(org.apache.jena.sparql.core.DatasetGraph container) Create a backup for a switchable TDB database.static void
compact
(org.apache.jena.sparql.core.DatasetGraph container) Compact a dataset which must be a switchable TDB database.static void
compact
(org.apache.jena.sparql.core.DatasetGraph container, boolean shouldDeleteOld) Compact a dataset which must be a switchable TDB database.static org.apache.jena.sparql.core.DatasetGraph
connectDatasetGraph
(String location) Create or connect to a TDB2-backed datasetstatic org.apache.jena.sparql.core.DatasetGraph
connectDatasetGraph
(org.apache.jena.dboe.base.file.Location location) Create or connect to a TDB2-backed datasetstatic org.apache.jena.sparql.core.DatasetGraph
Create an in-memory TDB2-backed dataset (for testing)static boolean
isTDB2
(org.apache.jena.sparql.core.DatasetGraph datasetGraph) Return whether aDatasetGraph
is a TDB2 database.static org.apache.jena.dboe.base.file.Location
location
(org.apache.jena.sparql.core.DatasetGraph datasetGraph) Return the location of a DatasetGraph if it is backed by TDB, else null.
-
Method Details
-
connectDatasetGraph
public static org.apache.jena.sparql.core.DatasetGraph connectDatasetGraph(org.apache.jena.dboe.base.file.Location location) Create or connect to a TDB2-backed dataset -
connectDatasetGraph
Create or connect to a TDB2-backed dataset -
compact
public static void compact(org.apache.jena.sparql.core.DatasetGraph container) Compact a dataset which must be a switchable TDB database. This is the normal dataset type for on-disk TDB2 databases.Deletes old database after successful compaction if
shouldDeleteOld
istrue
.This is equivalent to a call of
compact(container, false)
(do not delete old database).- Parameters:
container
- Thiscompact(container, false)
instead.
-
compact
public static void compact(org.apache.jena.sparql.core.DatasetGraph container, boolean shouldDeleteOld) Compact a dataset which must be a switchable TDB database. This is the normal dataset type for on-disk TDB2 databases. Deletes old database after successful compaction ifshouldDeleteOld
istrue
.- Parameters:
container
-shouldDeleteOld
-
-
backup
Create a backup for a switchable TDB database. This is the normal dataset type for on-disk TDB2 databases.The backup is created in the databases folder, under "Backups".
Backup creates a consistent copy og the database. It is performed as a read-transaction and does not lock out other use of the dataset.
- Parameters:
container
-- Returns:
- File name of the backup.
-
createDatasetGraph
public static org.apache.jena.sparql.core.DatasetGraph createDatasetGraph()Create an in-memory TDB2-backed dataset (for testing) -
isTDB2
public static boolean isTDB2(org.apache.jena.sparql.core.DatasetGraph datasetGraph) Return whether aDatasetGraph
is a TDB2 database. -
location
public static org.apache.jena.dboe.base.file.Location location(org.apache.jena.sparql.core.DatasetGraph datasetGraph) Return the location of a DatasetGraph if it is backed by TDB, else null.
-