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

Jena TDB 102的更多相关文章

  1. Jena TDB 101 Java API without Assembler

    Update on 2015/05/12 ongoing tutorials site on https://github.com/zhoujiagen/semanticWebTutorialUsin ...

  2. Jena TDB assembler syntax

    1 introduction Assembler is a DSL of Jena to specify something to build, models and dataset, for exa ...

  3. Jena Fuseki 102

    Version Fuseki v1 Fuseki v2 since Jena 2.13.0 Both v1 and v2 are active and maintained.[2015/06/29] ...

  4. 【转载】Apache Jena TDB CRUD operations

    Apache Jena TDB CRUD operations June 11, 2015 by maltesander http://tutorial-academy.com/apache-jena ...

  5. Jena TDB Assembler

    TDB Assembler Assemblers (装配器) 是Jena中用于描述将要构建的对象(通常是模型和数据集 models & datasets)的一种通用机制.例如, Fuseki ...

  6. 导入本体到Jena TDB数据库

    本体的存储方法或称本体持久化,大致分为基于内存的方式.基于文件的方式.基于数据库的方式和专门的管理工具方式4种(傅柱等, 2013).其中,基于数据库的方式又有基于关系数据库.基于面向对象数据库.基于 ...

  7. Outline of Apache Jena Notes

    1 description 这篇是语义网应用框架Apache Jena学习记录的索引. 初始动机见Apache Jena - A Bootstrap 2 Content 内容组织基本上遵循Jena首页 ...

  8. Jena Fuseki 101

    前言 正如其承诺的那样 Expose your triples as a SPARQL end-point accessible over HTTP. Fuseki provides REST-sty ...

  9. Apache jena SPARQL endpoint及推理

    一.Apache Jena简介 Apache Jena(后文简称Jena),是一个开源的Java语义网框架(open source Semantic Web Framework for Java),用 ...

随机推荐

  1. visual studio插件开发dll类库免加全局缓存处理办法

    1.卸载VSIXProject 2.然后编辑*.csproj 修改如下: 3.重新加载项目 编辑source.extension.vsixmanifest 添加资产: 完事后,直接安装VISX就可以了

  2. Count Primes - LeetCode

    examination questions Description: Count the number of prime numbers less than a non-negative number ...

  3. Linux(centos)的常用基本命令

    Linux的常用基本命令. 首先启动Linux.启动完毕后需要进行用户的登录,选择登陆的用户不同自然权限也不一样,其中“系统管理员”拥有最高权限. 在启动Linux后屏幕出现如下界面显示: …… Re ...

  4. NSUrl的打印

    1转自 http://my.oschina.net/wangdk/blog/165554: NSURL *url = [NSURL URLWithString:@"http://www.ba ...

  5. IOS详解TableView——内置刷新,EGO,以及搜索显示控制器

    内置刷新 内置刷新是苹果IOS6以后才推出的一个API,主要是针对TableViewController增加了一个属性,refreshControl,所以如果想用这个内置下拉刷新的话,最好给你的Tab ...

  6. Android学习简单总结

    1: 主要的view控件: 文字: TextView 图片: ImgView 视频:SurfaceView ... 2:控件 PopupWindow 实现类似左边导航栏 tabhost实现顶部或者下部 ...

  7. 《BI项目笔记》用Excel2013连接和浏览OLAP多维数据集

    用Excel2013连接和浏览OLAP多维数据集

  8. c读写文件

    #include<stdio.h> void main(void) { // locate ]; scanf("%s", filename); getchar(); / ...

  9. combobox获取值

    easyui-combobox是组合框 ,既可以输入,也可以选择 获取的数据是json格式的  [{"id":"001","text":&q ...

  10. python核心编程第六章练习6-14

    随机数.设计一个“石头.剪子.布”游戏,有时又叫“Rochambeau”,你小时候可能玩过,下面是规则.你和你的对手,在同一时间做出特定的手势,必须是下面一种:石头.剪子.布.胜利者从下面的规则产生, ...