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. manacher浅析

    manacher算法的输入是一个字符串,可以计算出以每个字符为中心的最长回文子串的半径.为了避免讨论奇数偶数,将原串的每两个字母之间以及前后各加一个特殊字母,比如'#',那么对于abcbb就变成了 # ...

  2. HTML表格与列表

    HTML表格 表格其实就是很多的小单元格,而这些小单元格很有次序的排列着,它们有很多行,很多列.这些很多行列组成的东西,就叫表格,表格是<table>标签来定义的.而<table&g ...

  3. HQL 参数绑定、唯一结果、分页、投影总结(上)

    我们先总结一下HQL语句常用语法: from子句:; select子句:用于选取对象和属性; where子句:用于表达查询语句的限制条件; 使用表达式:一般用在where子句中; order by子句 ...

  4. bootstrap selectpicker

    mark 一下使用 bootstrap selectpicker 遇到的一个小issue,作为下次查错使用 $('.selectpicker').selectpicker('val', 'Mustar ...

  5. OpenGL的glTexImage2D()与gluBuild2DMipmaps()的使用方法及区别

    OpenGL的glTexImage2D()与gluBuild2DMipmaps()的使用方法及区别 说明:两者的都是生成纹理,即:将载入的位图文件(*.bmp)转换成纹理贴图. 1.glTexImag ...

  6. jquery获取(设置)节点的属性与属性值

    1. attr(属性名)        //获取属性的值(取得第一个匹配元素的属性值.通过这个方法可以方便地从第一个匹配元素中获取一个属性的值.如果元素没有相应属性,则返回 undefined ) 2 ...

  7. 并发编程 17—— Lock

    Java并发编程实践 目录 并发编程 01—— ThreadLocal 并发编程 02—— ConcurrentHashMap 并发编程 03—— 阻塞队列和生产者-消费者模式 并发编程 04—— 闭 ...

  8. Java—Applet

    1  Applet的定义 Applet是Java语言编写的,无法独立运行,但可以嵌入到网页中执行.它扩展了传统的编程结构和方法,可以通过互联网发布到任何具有Java编译环境浏览器的个体计算机上. 如下 ...

  9. Python基础教程-第一章-变量、函数、字符串

    1.1变量 变量基本上就是代表(或者引用)某个值的名字,举例来说,如果希望用x代表3,只需要执行下面的语句即可: >>>x = 3 这样的操作称为赋值(assignment),值3赋 ...

  10. Fireeye火眼公司发布报告,评论中国网络间谍活动

    2013年10月2日,Fireeye火眼公司发布报告,评论中国网络间谍活动-Fireeye(美 国火眼公司)发布报告<世界网络大战:理解网络攻击背后的国家意图>(World War C: ...