Class TdbUtil
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena.TdbUtil
TDB util for generating and inspecting TDB datasets.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.ontology.OntModel
bulkLoadToTdbOntModel
(String tdblocation, String url, org.apache.jena.ontology.OntModelSpec spec) static void
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
getFileFromURL
(String url) 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)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
TdbUtil
public TdbUtil()
-
-
Method Details
-
bulkLoadToTdbOntModel
-
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
-
getOntModelFromTDB
public static org.apache.jena.ontology.OntModel getOntModelFromTDB(String tdblocation, org.apache.jena.ontology.OntModelSpec spec) -
getModelFromTDB
-
isTDB1Dataset
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
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)
-