Class 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 dataset
      static 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 dataset
      static Dataset createDataset​(org.apache.jena.tdb.base.file.Location location)
      Create or connect to a TDB-backed dataset
      static 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 null
      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
      static 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 the StoreParams for specific Location.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 the 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 StoreParams can reduce performance. See documentation.
        Parameters:
        location - The persistent storage location
        params - StoreParams to use
        Throws:
        java.lang.IllegalStateException - If the dataset has already been setup.