1 Introduction

TDB is a RDF storage of Jena.

official guarantees and limitations

  • TDB support full range of Jena APIs
  • TDB can be used as a high performance RDF store on a single machine
  • TDB can be accessed and managed with cmd scripts and Java API
  • TDB dataset can be protected against corruption using transaction
  • TDB supports Serializable transaction level
  • TDB supports ACID transaction trough write-ahead-logging
  • A TDB dataset should only directly accessed from a single JVM at a time, otherwise data corruption may occur.From 1.1.0 onwards TDB includes automatic protection against multi-JVM usage which prevents this under most circumstances.

2 TDB Java API

The application obtain a model or RDF dataset from TDB, navigate or use it for other model or dataset.

construct a model or dataset

2 ways to specify data source:

  • directory

see Jena TDB API without Assembler

  • assembler file

the assembler syntax and sematic see under 5 assembler: a DSL

bulkloader

load data into an empty dataset fastly, using cmd utitilies: tdbloader

concurrency support

USE transaction DEEPLY, it's guaranteed.

cache

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) ;

3 command line scripts

scripts located in JENA_HOME/bin

datasource specification

// assembler file
--desc=assembler.ttl
--tdb=assembler.ttl

// directory
--loc=DIRECTORY
--location=DIRECTORY

if not specified, --desc=tdb.ttl default is set.

commands

  • 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.

//TODO cmd tool usage

4 transaction

detailed limitations

  • Bulk loads: the TDB bulk loader is not transactional
  • Nested transactions are not supported.
  • Some active transaction state is held exclusively in-memory, limiting scalability.
  • Long-running read-transactions cause a build-up of pending changes.

API for transaction

read transaction

// 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() 

}    

write transaction

dataset.begin(ReadWrite.WRITE) ;
try {
  ...
  dataset.commit();
} finally {
  dataset.end();
}

see Jena TDB 101 Java API without Assembler for a running example.

tansaction with concurrency

2 methods:

  • shareable Dataset, sequential transaction behaviour
  • private Dataset, independent transaction

5 assembler: a DSL

see Jena TDB assembler

6 dataset and named graph

concept

An RDF dataset is composed of 1 unnamed default graph, and 0+ named graphs. Here graph is same as graph is SPARQL vocabulary.

storage

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.

query

SPARQL query is fully supported in named graphs of TDB backed datasets.

2 special graph name

7 TDB configuration

TODO

8 TDB optimizer

TODO

references

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

随机推荐

  1. AJax登录。。转

    AJAX即“Asynchronous Javascript And XML”(异步JavaScript和XML),是指一种创建交互式网页应用的网页开发技术.        AJAX 是一种用于创建快速 ...

  2. workbench中safe update

    1.在workbench中表格显示为readonly ,更新时提示Error Code: 1175. You are using safe update mode and you tried to u ...

  3. [转载]ExtJs4 笔记(8) Ext.slider 滚轴控件、 Ext.ProgressBar 进度条控件、 Ext.Editor 编辑控件

    作者:李盼(Lipan)出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法律 ...

  4. Remote 的远程使用

        <script type="text/javascript">        $(function () {            //每次隐藏的时候 删除页面 ...

  5. SQL Server 最小化日志操作解析,应用

    Sql Server 中数据库在BULK_LOGGED/SIMPLE模式下的一些操作会采用最小化日志的记录方式,以减小tran log落盘日志量从而提高整体性能. 这里我简单介绍下哪些操作在什么样的情 ...

  6. CodeForces 149D Coloring Brackets 区间DP

    http://codeforces.com/problemset/problem/149/D 题意: 给一个给定括号序列,给该括号上色,上色有三个要求 1.只有三种上色方案,不上色,上红色,上蓝色 2 ...

  7. 基于Unity3D的AOP使用思路

    考虑到AOP的特性,并参考Python的装饰模式(AOP类似),在做开发时,可以使用AOP的思想做一些工作上的简化(比如:运行时的Range属性.内存/存档加密属性等等). 但是AOP(使用的Post ...

  8. 【POJ1067】取石子游戏 (威佐夫博弈)

    [题目] Description 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两堆中同时取走相同数量的 ...

  9. UTL_DBWS - Consuming Web Services in Oracle 10g Onward

    from:http://oracle-base.com/articles/10g/utl_dbws-10g.php In a previous article I presented a method ...

  10. .Net程序员 初学Ubuntu ,配置Nignix

    1.安装VM虚拟机 2.升级VI编辑器 3.安装Nginx 4.测试localhost 5.编辑配置文件 仅仅用了记录一个过程,不会太详细 1.安装虚拟机,网上一大片,不是特别难 2.为什么要升级VI ...