Jena TDB assembler syntax
1 introduction
Assembler is a DSL of Jena to specify something to build, models and dataset, for example.
2 examples
Jena Assembler's syntax seems like turtle, here is commonly used prefixes:
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
2.1 dataset
// trigger TDB initialization
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
// specification of the TDB dataset
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;// location, relative to CWD
.
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;
// set the default graph for query is the union of named graphs
tdb:unionDefaultGraph true ;
.
2.2 graph
It's for the purpose of working with a single graph in TDB's RDF dataset.
the default graph
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;
<#graph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dataset> .
the named graph
<#graphNamed> rdf:type tdb:GraphTDB ;
tdb:dataset <#dataset> .
tdb:graphName <http://example/graph1> ;
.
2.3 mixed datasets
It's for the purpose of a dataset may be composed of different sourced graphs.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#graph> ;// the default graph
ja:namedGraph // the named graph
[ ja:graphName <http://example.org/name1> ;
ja:graph <#graph2> ] ;
.
<#graph> rdf:type tdb:GraphTDB ;
tdb:location "DB" ;
.
// a graph using external sources
<#graph2> rdf:type ja:MemoryModel ;
ja:content [ja:externalContent <file:Data/books.n3> ] ;
.
Note ja:RDFDataset and ja:Model support more settings of datasets and models.
3 related namespaces
ja
com.hp.hpl.jena.assembler.JA(jena-core-2.11.1-sources.jar)
tdb
com.hp.hpl.jena.tdb.assembler.VocabTDB(jena-tdb-1.0.1-sources.jar)
Jena TDB assembler syntax的更多相关文章
- Jena TDB Assembler
TDB Assembler Assemblers (装配器) 是Jena中用于描述将要构建的对象(通常是模型和数据集 models & datasets)的一种通用机制.例如, Fuseki ...
- Jena TDB 102
1 Introduction TDB is a RDF storage of Jena. official guarantees and limitations TDB support full ra ...
- Jena TDB 101 Java API without Assembler
Update on 2015/05/12 ongoing tutorials site on https://github.com/zhoujiagen/semanticWebTutorialUsin ...
- 【转载】Apache Jena TDB CRUD operations
Apache Jena TDB CRUD operations June 11, 2015 by maltesander http://tutorial-academy.com/apache-jena ...
- 导入本体到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 ...
- 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 SPARQL endpoint及推理
一.Apache Jena简介 Apache Jena(后文简称Jena),是一个开源的Java语义网框架(open source Semantic Web Framework for Java),用 ...
随机推荐
- GZFramwork数据库层《前言》DLL项目引用
新建项目: 1. 项目引入GZFramwork.dll NuGet地址:Install-Package GZFramwork 每个项目都引用 2.BLL层 设置数据库连接维护类:继承于:GZFramw ...
- FreeMarker常用语法
转自:http://www.cnblogs.com/linjiqin/p/3388298.html FreeMarker的插值有如下两种类型:1,通用插值${expr};2,数字格式化插值:#{exp ...
- IE6兼容性问题及IE6常见bug详细汇总
转载地址:http://www.jb51.net/css/76894.html 1.IE6怪异解析之padding与border算入宽高 原因:未加文档声明造成非盒模型解析 解决方法:加入文档声明&l ...
- Oracle在归档模式下恢复
=============== 数据库的完全恢复 =============== 在归档模式下数据库完全恢复时,数据库所经过的状态如下: 1.利用备份修复(Restores)损坏或丢失的数据文件,即将 ...
- Action<>和Func<> 委托【代理】
C#中的Action<>和Func<> 其实他们两个都是委托[代理]的简写形式. 一.[action<>]指定那些只有输入参数,没有返回值的委托 Delegate的 ...
- Calendar.get()方法--- WEEK_OF_YEAR 、MONTH、
1. WEEK_OF_YEAR 一年中的第几周 由于西方的一周指的是:星期日-星期六,星期日是一周的第一天,星期六是一周的最后一天, 所以,使用 calendar.get(Calendar.WEE ...
- java实现httpclient2
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.i ...
- ArrayList 如何增加大小
JDK1.8 private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; transient Object[] elem ...
- iOS开发UI篇—使用picker View控件完成一个简单的选餐应用
iOS开发UI篇—使用picker View控件完成一个简单的选餐应用 一.实现效果 说明:点击随机按钮,能够自动选取,下方数据自动刷新. 二.实现思路 1.picker view的有默认高度为162 ...
- JavaScript整合
JavaScript已经学完了,总体感觉良好,但是突然发现原来JS可以做的东西比我想象的还要多!我整理了一些JavaScript的基础知识,这些内容掌握好的话,对我们深入学习JavaScript会有很 ...