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. ShareSDK第三方登录代码

    - (IBAction)YYSJBut:(UIButton *)sender{    if (sender.tag == 7)    {        [self AuthLogin:SSDKPlat ...

  2. 招聘一个靠谱的 iOS

    近一年内陆续面试了不少人了,从面试者到面试官的转变让我对 iOS 招聘有了更多的感受.经过了前段时间的一大波面试,我们终于找到了志同道合的小伙伴,面试也暂时告一段落了.总结下面试人过程中的感受,你也可 ...

  3. Java使用BigDecimal精确计算的简单公式计算器

    由于工作需要,写了一个使用BigDecimal运算的精确计算的计算器(然后发现其实比不用BigDecimal的并好不到哪里去) 只能做加减乘除 double类型的数字在千万级别的时候会转成科学计数法, ...

  4. jsoup: Java HTML Parser (类似jquery)

    jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extr ...

  5. iOS核心动画学习整理

    最近利用业余时间终于把iOS核心动画高级技巧(https://zsisme.gitbooks.io/ios-/content/chapter1/the-layer-tree.html)看完,对应其中一 ...

  6. mysql的初识--DOS下的简单命令

    DOS下进入 1.通过程序中的mySQL的:MySQL 5.6 Command Line Client直接进入mySQL的命令行: 2.或者通过WIn+R-->输入cmd,然后C:等一层一层找到 ...

  7. (五)socket实践编程

    1.服务器端程序编写 (1)socket(2)bind(3)listen(4)accept,返回值是一个fd,accept正确返回就表示我们已经和前来连接我的客户端之间建立了一个TCP连接了,以后我们 ...

  8. 爬虫:获取多次跳转后的页面url

    <?php $url = "xxxx"; $xx = get_headers($url,true); var_dump($xx); ?> Nbimer主页 剖面加阴影应 ...

  9. 使用java自带线程池管理器demo

    1.程序入口:DabianTest package com.lbh.myThreadPool.present; import java.util.concurrent.ExecutorService; ...

  10. HBase Cassandra Riak HyperTable

    Cassandra                                                              HBase 一致性 Quorum NRW策略 通过Goss ...