Package org.apache.jena.tdb
Class TDBFactory
- java.lang.Object
-
- org.apache.jena.tdb.TDBFactory
-
public class TDBFactory extends java.lang.Object
Public factory for creating objects datasets backed by TDB storage
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Dataset
assembleDataset(java.lang.String assemblerFile)
Read the file and assembler a datasetstatic Dataset
createDataset()
Create or connect to a TDB dataset backed by an in-memory block manager.static Dataset
createDataset(java.lang.String dir)
Create or connect to a TDB-backed datasetstatic Dataset
createDataset(org.apache.jena.tdb.base.file.Location location)
Create or connect to a TDB-backed datasetstatic DatasetGraph
createDatasetGraph()
Create a TDB-backed dataset (graph-level) in memory (for testing)static DatasetGraph
createDatasetGraph(java.lang.String directory)
Create or connect to a TDB-backed dataset (graph-level)static DatasetGraph
createDatasetGraph(org.apache.jena.tdb.base.file.Location location)
Create or connect to a TDB-backed dataset (graph-level)static boolean
inUseLocation(java.lang.String 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).static boolean
inUseLocation(org.apache.jena.tdb.base.file.Location location)
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).static boolean
isTDB1(Dataset dataset)
Test whether a dataset is backed by TDB.static boolean
isTDB1(DatasetGraph datasetGraph)
Test whether a dataset is backed by TDB.static org.apache.jena.tdb.base.file.Location
location(Dataset dataset)
Return the location of a dataset if it is backed by TDB, else nullstatic org.apache.jena.tdb.base.file.Location
location(DatasetGraph datasetGraph)
Return the location of a DatasetGraph if it is backed by TDB, else nullstatic void
release(Dataset dataset)
Release from the JVM.static void
release(DatasetGraph dataset)
Release from the JVM.static void
setup(org.apache.jena.tdb.base.file.Location location, org.apache.jena.tdb.setup.StoreParams params)
Set theStoreParams
for specific Location.
-
-
-
Method Detail
-
assembleDataset
public static Dataset assembleDataset(java.lang.String assemblerFile)
Read the file and assembler a dataset
-
createDataset
public static Dataset createDataset(java.lang.String dir)
Create or connect to a TDB-backed dataset
-
createDataset
public static Dataset createDataset(org.apache.jena.tdb.base.file.Location location)
Create or connect to a TDB-backed dataset
-
createDataset
public static Dataset createDataset()
Create or connect to a TDB dataset backed by an in-memory block manager. For testing.
-
createDatasetGraph
public static DatasetGraph createDatasetGraph(java.lang.String directory)
Create or connect to a TDB-backed dataset (graph-level)
-
createDatasetGraph
public static DatasetGraph createDatasetGraph(org.apache.jena.tdb.base.file.Location location)
Create or connect to a TDB-backed dataset (graph-level)
-
createDatasetGraph
public static DatasetGraph createDatasetGraph()
Create a TDB-backed dataset (graph-level) in memory (for testing)
-
release
public static void release(Dataset dataset)
Release from the JVM. All caching is lost.
-
release
public static void release(DatasetGraph dataset)
Release from the JVM. All caching is lost.
-
isTDB1
public static boolean isTDB1(Dataset dataset)
Test whether a dataset is backed by TDB.
-
isTDB1
public static boolean isTDB1(DatasetGraph datasetGraph)
Test whether a dataset is backed by TDB.
-
location
public static org.apache.jena.tdb.base.file.Location location(Dataset dataset)
Return the location of a dataset if it is backed by TDB, else null
-
location
public static org.apache.jena.tdb.base.file.Location location(DatasetGraph datasetGraph)
Return the location of a DatasetGraph if it is backed by TDB, else null
-
inUseLocation
public static boolean inUseLocation(java.lang.String 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".
-
inUseLocation
public static boolean inUseLocation(org.apache.jena.tdb.base.file.Location location)
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".
-
setup
public static void setup(org.apache.jena.tdb.base.file.Location location, org.apache.jena.tdb.setup.StoreParams params)
Set theStoreParams
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 ofStoreParams
can reduce performance. See documentation.- Parameters:
location
- The persistent storage locationparams
- StoreParams to use- Throws:
java.lang.IllegalStateException
- If the dataset has already been setup.
-
-