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)

最新文章

  1. vcf格式
  2. 使用 Redis 实现分布式锁
  3. Java Gradle入门指南之内建与定制任务类(buildSrc、Groovy等)
  4. iOS -类目,延展,协议
  5. Ubantu16.4的安装过程以及基本配置
  6. SVN 文件解锁
  7. asp.net的JSON数据进行序列化和反序列化
  8. 在Windows/Ubuntu下安装OpenGL环境(GLUT/freeglut)与跨平台编译(mingw/g++)
  9. Wireshark技巧-过滤规则和显示规则
  10. Ubuntu开机启动svn
  11. C与C++动态分配二维数组
  12. ros消息时间同步与回调
  13. chrome误删书签恢复。
  14. ORA-12545: Connect failed because target host or object does not exist
  15. python 关于django 2.X from django.contrib.auth.views import login
  16. jmeter中文乱码及Unicode转中文
  17. Cannot Connect to Database Server
  18. 移动端的dl
  19. Windows下安装MySql5.7(解压版本)
  20. Python之socket_tcp

热门文章

  1. (三)kafka集群扩容后的topic分区迁移
  2. (转载)TCP/IP的三次握手与四次挥手
  3. ios 模拟器不显示系统版本了,后边都是 uuid 了,怎么弄回来?系统升级xcode6.4,模拟器找不到选择了?
  4. go文件操作大全
  5. 浅谈AJAX的基本原理和原生AJAX的基础用法
  6. Centos7 搭建 Keepalived+LVS 备注
  7. Chinese culture
  8. 饮水思源——python中常用基础类源码解析
  9. quartz-2.2.x 快速入门 (1)
  10. SSM框架学习之高并发秒杀业务--笔记2-- DAO层