TDB is a RDF storage of Jena.
The application obtain a model or RDF dataset from TDB, navigate or use it for other model or dataset.
2 ways to specify data source:
see Jena TDB API without Assembler
the assembler syntax and sematic see under 5 assembler: a DSL
load data into an empty dataset fastly, using cmd utitilies: tdbloader
USE transaction DEEPLY, it's guaranteed.
TDB support caching in different levels, from RDF terms to disk block.
When not using transaction, should call synchronization explicitly:
Dataset dataset = ... ;
TDB.sync(dataset) ;
scripts located in JENA_HOME/bin
// assembler file
--desc=assembler.ttl
--tdb=assembler.ttl
// directory
--loc=DIRECTORY
--location=DIRECTORY
if not specified, --desc=tdb.ttl default is set.
tdbloader
Bulk loader and index builder.
tdbloader2
Bulk loader and index builder. Faster than tdbloader but only works on Linux and Mac OS/X since it relies on some Unix system utilities.
Restriction: This bulk loader can only be used to create a database. It may overwrite existing data. It only accepts the --loc argument and a list of files to load.
tdbquery
Invoke a SPARQL query on a store.
Use --time for timing information.
tdbdump
Dump the store in N-Quads format.
tdbstats
Produce a statistics for the dataset.
// use directory to specify datasource
Dataset dataset = TDBFactory.createDataset(directoryPathStr);
dataset.begin(ReadWrite.READ) ;
try {
...
//dataset.abort();// abort transaction
} finally {
dataset.commit();
//dataset.end(); // same as commit()
}
dataset.begin(ReadWrite.WRITE) ;
try {
...
dataset.commit();
} finally {
dataset.end();
}
see Jena TDB 101 Java API without Assembler for a running example.
2 methods:
see Jena TDB assembler
An RDF dataset is composed of 1 unnamed default graph, and 0+ named graphs. Here graph is same as graph is SPARQL vocabulary.
A RDF data set use an individual O.S. directory for storage.
The default graph is held as a single graph, while the named graphs are held in a set of indexes.
SPARQL query is fully supported in named graphs of TDB backed datasets.
2 special graph name
TODO
TODO
Apache Jena TDB
Using TDB from Java through the API
Command line utilities
Transactions
Assemblers for Graphs and Datasets
Datasets and Named Graphs
Dynamic Datasets: Query a subset of the named graphs
Quad filtering: Hide information in the dataset
The TDB Optimizer
TDB Configuration
Value Canonicalization
TDB Design
Use on 64 bit or 32 bit Java systems
FAQs