Jena TDB 102
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
- **urn:x-arq:UnionGraph**: union of all named graphs in a dataset
- **urn:x-arq:DefaultGraph**: the unamed default graph in a dataset
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的更多相关文章
- Jena TDB 101 Java API without Assembler
Update on 2015/05/12 ongoing tutorials site on https://github.com/zhoujiagen/semanticWebTutorialUsin ...
- Jena TDB assembler syntax
1 introduction Assembler is a DSL of Jena to specify something to build, models and dataset, for exa ...
- Jena Fuseki 102
Version Fuseki v1 Fuseki v2 since Jena 2.13.0 Both v1 and v2 are active and maintained.[2015/06/29] ...
- 【转载】Apache Jena TDB CRUD operations
Apache Jena TDB CRUD operations June 11, 2015 by maltesander http://tutorial-academy.com/apache-jena ...
- Jena TDB Assembler
TDB Assembler Assemblers (装配器) 是Jena中用于描述将要构建的对象(通常是模型和数据集 models & datasets)的一种通用机制.例如, Fuseki ...
- 导入本体到Jena TDB数据库
本体的存储方法或称本体持久化,大致分为基于内存的方式.基于文件的方式.基于数据库的方式和专门的管理工具方式4种(傅柱等, 2013).其中,基于数据库的方式又有基于关系数据库.基于面向对象数据库.基于 ...
- Outline of Apache Jena Notes
1 description 这篇是语义网应用框架Apache Jena学习记录的索引. 初始动机见Apache Jena - A Bootstrap 2 Content 内容组织基本上遵循Jena首页 ...
- Jena Fuseki 101
前言 正如其承诺的那样 Expose your triples as a SPARQL end-point accessible over HTTP. Fuseki provides REST-sty ...
- Apache jena SPARQL endpoint及推理
一.Apache Jena简介 Apache Jena(后文简称Jena),是一个开源的Java语义网框架(open source Semantic Web Framework for Java),用 ...
随机推荐
- 【树莓派】使用树莓派制作img镜像(二)
树莓派制作的镜像,需要如何使用,这里直接引用目前树莓派官方的文章,不再重复描述: 参考:http://shumeipai.nxez.com/2013/08/31/usb-image-tool.html ...
- python走起之第四话
本节大纲: 一:双层装饰器:一个函数可以被多层装饰器进行装饰,函数渲染(编译)从下到上,函数执行从上到下.如下程序: 1 #!/usr/bin/env python 2 #-*-coding:utf- ...
- D3.js 力导向图
花了大半天看了一个八十几行的代码..心累 力导向图是之前就有画过很多次的东西,但是这次的代码看上去很陌生,然后发现是D3更新了4.0.... 先贴代码 var svg = d3.select(&quo ...
- phonegap开发经验谈之一命令行建立项目和准备工作
一安装与配置 安装命令行配置,这个可以参见网上的.3.0的最好用命令行配置. 大家在安装android sdk的时候,会发现里面自带了一个eclipse,并且继承了adt,直接用这个就好了.当然你已经 ...
- 02-编写第一个C语言程序
本文目录 1.打开Xcode,新建Xcode项目 2.选择最简单的命令行项目 3.输入项目信息 4.选择一个用来存放C程序代码的文件夹 5.运行项目 说明:这个C语言专题,是学习iOS开发的前奏.也为 ...
- HDU-4532 湫秋系列故事——安排座位 组合数学DP
题意:有来自n个专业的学生,每个专业分别有ai个同学,现在要将这些学生排成一行,使得相邻的两个学生来自不同的专业,问有多少种不同的安排方案. 分析:首先将所有专业的学生视作一样的,最后再乘以各自学生的 ...
- Delphi名站以及高手Blog
以前知道的: http://cnblogs.com/del (万一兄的,这个不用解释了) http://www.cnblogs.com/del/archive/2010/04/25/1720750.h ...
- 网络内容缓存CDN的工作原理
网络内容缓存CDN的工作原理 CDN的全称是Content Delivery Network,即内容分发网络CDN的目的就是提高用户访问网站的响应速度提速的基本思路例如你的网站服务器是在北京,这时有一 ...
- 使用File类递归列出E盘下全部文件
import java.io.File;public class FileListTest { public void tree(File file){ if(file.listFiles()!=nu ...
- Centos7 搭建 Keepalived+LVS 备注
NAT模型需要RealServer gateway设定为,DR模式需要执行 RealServer.sh.需要先安装network-tools. #!/bin/bash#description : st ...