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的更多相关文章

  1. Jena TDB Assembler

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

  2. Jena TDB 102

    1 Introduction TDB is a RDF storage of Jena. official guarantees and limitations TDB support full ra ...

  3. Jena TDB 101 Java API without Assembler

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

  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数据库

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

  6. Outline of Apache Jena Notes

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

  7. Jena Fuseki 101

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

  8. Jena Fuseki 102

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

  9. Apache jena SPARQL endpoint及推理

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

随机推荐

  1. C++string中有关大小和容量的函数浅析

    1.length()与size() length是因为沿用C语言的习惯而保留下来的,string类最初只有length,引入STL之后,为了兼容又加入了size,它是作为STL容器的属性存在的,便于符 ...

  2. Cheatsheet: 2016 01.01 ~ 01.31

    Mobile An Introduction to Cordova: Basics Web Angular 2 versus React: There Will Be Blood How to Bec ...

  3. [HIHO1107]Shortest Proper Prefix(trie)

    题目链接:http://hihocoder.com/problemset/problem/1107 题意:求有多少非依赖前缀,使得前缀下标识的字符串不超过5个. 这里非依赖的意思是,假如前缀a,b,a ...

  4. 解决Jenkins console输出乱码

    背景 Jenkins console输出乱码,如 ������������� 1 解决办法 Jenkins Master 设置utf8 encoding Tomcat 启动脚本 export JAVA ...

  5. js继承之call,apply和prototype随谈

    在js中,call,apply和prototype都可以实现对象的继承,下面我们看一个例子: function FatherObj1() { this.sayhello = "I am jo ...

  6. LTE Module User Documentation(翻译8)——核心网(EPC)

    LTE用户文档 (如有不当的地方,欢迎指正!) 14 Evolved Packet Core (EPC)   我们现在讲解如何编写一个仿真程序——除了 LTE 无线接入网外,还允许仿真 EPC. EP ...

  7. Nginx模块之————RTMP模块的FFmpeg的配置问题是FFmpeg的连续退出

    rtmp { server { listen ; application live { allow publish all; allow play all; live on; exec /root/b ...

  8. 利用反射和ResultSetMetaData实现DBUtils的基本功能

    DBUtils大大简化了JDBC的书写,极大的提高了开发效率,和数据库连接池一起,简化了JDBC开发的流程.简易的自定义数据库连接池可以通过装饰者设计模式和动态代理模式得到很简单的实现,那么DBUti ...

  9. 匿名函数和Lamda

    不是本人所写!网络收集 C#中的匿名函数和Lamda是很有意思的东东,那么我们就来介绍一下,这到底是什么玩意,有什么用途了? 打开visual studio 新建一个控制台程序. 我们利用委托来写一个 ...

  10. iOS开发拓展篇—UIDynamic(简单介绍)

    iOS开发拓展篇—UIDynamic(简单介绍) 一.简单介绍 1.什么是UIDynamic UIDynamic是从iOS 7开始引入的一种新技术,隶属于UIKit框架 可以认为是一种物理引擎,能模拟 ...