java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena.TdbUtil

public class TdbUtil extends Object
TDB util for generating and inspecting TDB datasets.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.ontology.OntModel
    bulkLoadToTdbOntModel(String tdblocation, String url, org.apache.jena.ontology.OntModelSpec spec)
     
    static void
    createTDB(String url, String tdblocation)
     
    static org.apache.jena.ontology.OntModel
    createTDBbackedModel(String tdblocation, org.apache.jena.rdf.model.Model m, org.apache.jena.ontology.OntModelSpec spec)
     
    (package private) static void
    forceSync(org.apache.jena.tdb.store.DatasetGraphTDB dsg)
     
    static File
    Returns a file object given a url or path as string.
    private static org.apache.jena.tdb.store.GraphTDB
    getGraphTDB(org.apache.jena.graph.Graph graph)
     
    private static org.apache.jena.tdb.store.GraphTDB
    getGraphTDB(org.apache.jena.rdf.model.Model model)
     
    static org.apache.jena.rdf.model.Model
    getModelFromTDB(String tdblocation)
     
    static org.apache.jena.ontology.OntModel
    getOntModelFromTDB(String tdblocation, org.apache.jena.ontology.OntModelSpec spec)
     
    static boolean
    isGraphBackedByTDB(org.apache.jena.graph.Graph graph)
     
    static boolean
    isModelBackedByTDB(org.apache.jena.rdf.model.Model model)
     
    static boolean
    isTDB1Dataset(File directory)
    Checks if there is at least one file in the directory denoted by this url which ends with .dat or .idn.
    static boolean
    release(org.apache.jena.graph.Graph graph)
    Release from the JVM.All caching is lost.
    static boolean
    release(org.apache.jena.rdf.model.Model model)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • TdbUtil

      public TdbUtil()
  • Method Details

    • bulkLoadToTdbOntModel

      public static org.apache.jena.ontology.OntModel bulkLoadToTdbOntModel(String tdblocation, String url, org.apache.jena.ontology.OntModelSpec spec)
    • createTDBbackedModel

      public static org.apache.jena.ontology.OntModel createTDBbackedModel(String tdblocation, org.apache.jena.rdf.model.Model m, org.apache.jena.ontology.OntModelSpec spec)
    • createTDB

      public static void createTDB(String url, String tdblocation)
    • getOntModelFromTDB

      public static org.apache.jena.ontology.OntModel getOntModelFromTDB(String tdblocation, org.apache.jena.ontology.OntModelSpec spec)
    • getModelFromTDB

      public static org.apache.jena.rdf.model.Model getModelFromTDB(String tdblocation)
    • isTDB1Dataset

      public static boolean isTDB1Dataset(File directory)
      Checks if there is at least one file in the directory denoted by this url which ends with .dat or .idn. This indicates that there is a TDB dataset. There is also the function TDBFactory#inUseLocation() but it also returns true if the directory contains one rdf file and is definitely not a TDB dataset. The definition when a directory is a TDB directory might change in the future.
      Parameters:
      directory - the directory as a File
      Returns:
      true if it is a TDB dataset e.g. contains at least of file which ends with .dat or .idn
    • getFileFromURL

      public static File getFileFromURL(String url)
      Returns a file object given a url or path as string.
      Parameters:
      url - a url or path as string
      Returns:
      the file object
    • isModelBackedByTDB

      public static boolean isModelBackedByTDB(org.apache.jena.rdf.model.Model model)
    • isGraphBackedByTDB

      public static boolean isGraphBackedByTDB(org.apache.jena.graph.Graph graph)
    • release

      public static boolean release(org.apache.jena.rdf.model.Model model)
    • release

      public static boolean release(org.apache.jena.graph.Graph graph)
      Release from the JVM.All caching is lost.
      Parameters:
      graph - the graph.
      Returns:
      true, if the release worked
    • getGraphTDB

      private static org.apache.jena.tdb.store.GraphTDB getGraphTDB(org.apache.jena.rdf.model.Model model)
    • getGraphTDB

      private static org.apache.jena.tdb.store.GraphTDB getGraphTDB(org.apache.jena.graph.Graph graph)
    • forceSync

      static void forceSync(org.apache.jena.tdb.store.DatasetGraphTDB dsg)