Class DatabaseMgr

java.lang.Object
org.apache.jena.tdb2.DatabaseMgr

public class DatabaseMgr extends Object
Operations for TDBS DatasetGraph, including admin operations See TDB2Factory for creating API-level Datasets.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    Create or connect to a TDB2-backed dataset
    static org.apache.jena.sparql.core.DatasetGraph
    connectDatasetGraph(org.apache.jena.dboe.base.file.Location location)
    Create or connect to a TDB2-backed dataset
    static 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 a DatasetGraph 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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static org.apache.jena.sparql.core.DatasetGraph connectDatasetGraph(String location)
      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 is true.

      This is equivalent to a call of compact(container, false) (do not delete old database).

      Parameters:
      container - This compact(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 if shouldDeleteOld is true.
      Parameters:
      container -
      shouldDeleteOld -
    • backup

      public static String backup(org.apache.jena.sparql.core.DatasetGraph container)
      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 a DatasetGraph 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.