Version

Fuseki v1

Fuseki v2 since Jena 2.13.0

Both v1 and v2 are active and maintained.[2015/06/29]

v1

1 start

$ cd FUSEKI_V1_HOME
$ chmod +x fuseki-server s-*
$ ./fuseki-server --update --mem /ds # the dataset name is '/ds'

fuseki-server options

  • --localhost

    listen only to localhost NIC

  • --port=PORT

    set the port number

  • --update

    allow update, otherwise only serve read requests.
    ignored if a configuration file is given

  • fuseki-server --mem /DatasetPathName

    create an empty, in-memory(non-persistent) dataset

  • fuseki-server --file=FILE /DatasetPathName

    create an empty, in-memory(non-persistent) dataset, then load FILE into it

  • fuseki-server --loc=DIR /DatasetPathName

    use an existing TDB database, create an empty is it doesnot exist

  • fuseki-server --desc=assemblerFile

    construct a database based on the general assembler description

  • fuseki-server --config=ConfigFile

    construct one or more service endpoints based on the confifuration file, see # 6

2 user interface

http://localhost:3030/

3 script control

$ cd FUSEKI_V1_HOME

Server URI schema

Fuseki's default port is 3030

  • /dataset/query: SPARQL query endpoint
  • /dataset/update: SPARQL update language endpoint
  • /dataset/data: SPARQL Graph Store Protocol endpoint
  • /dataset/upload: file upload endpoint

4 security

Fuseki does not currently offer security and access control itself.

Data can be updated without access control if the server is started with the --update argument. If started without that argument, data is read-only.

5 logging

see Fuseki_V1_HOME/fuseki-server.jar/jena-log4j.properties

6 configuration

A Fuseki server can be set up using a configuration file.

The command-line arguments for publishing a single dataset are a short cut that, internally, builds a default configuration based on the dataset name given.

The configuration is an RDF graph. One graph consists of one server description, with a number of services, and each service offers a number of endpoints over a dataset.

All datasets are described by assembler descriptions.

samples:

// [1] prefixes
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix :        <#> .
// [2] server - server context, custom code, and avaiable services
## ---------------------------------------------------------------
[] rdf:type fuseki:Server ;
# Server-wide context parameters can be given here.
# For example, to set query timeouts: on a server-wide basis:
# Format 1: "1000" -- 1 second timeout
# Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
# See java doc for ARQ.queryTimeout
# ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;

# Load custom code (rarely needed)
# ja:loadClass "your.code.Class" ;

# Services available.  Only explicitly listed services are configured.
#  If there is a service description not linked from this list, it is ignored.
fuseki:services (
    <#service1>
    <#service2>
) .
// [3] dataset - a tdb dataset
## ---------------------------------------------------------------
# Declaration additional assembler items.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .

# TDB
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

// [4] service 1 - a service use in-memory dataset,
// customed dataset's and SPARQL services' endpoint
## ---------------------------------------------------------------
## Updatable in-memory dataset.

<#service1> rdf:type fuseki:Service ;
    fuseki:name                       "ds" ;       # http://host:port/ds
    fuseki:serviceQuery               "query" ;    # SPARQL query service
    fuseki:serviceQuery               "sparql" ;   # SPARQL query service
    fuseki:serviceUpdate              "update" ;   # SPARQL query service
    fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
    fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
    # A separate read-only graph store endpoint:
    fuseki:serviceReadGraphStore      "get" ;      # SPARQL Graph store protocol (read only)
    fuseki:dataset                   <#dataset-mem> ;
    .

<#dataset-mem> rdf:type ja:RDFDataset .

// [5] service 2 - read only in-memory single graph data
## ---------------------------------------------------------------
<#service2> rdf:type fuseki:Service ;
    fuseki:name                     "books" ;    # http://host:port/books
    fuseki:serviceQuery             "query" ;    # SPARQL query service
    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
    fuseki:dataset           <#books> ;
    .

<#books>    rdf:type ja:RDFDataset ;
    rdfs:label "Books" ;
    ja:defaultGraph
        [ rdfs:label "books.ttl" ;
          a ja:MemoryModel ;
          ja:content [ja:externalContent <file:Data/books.ttl> ] ;
        ] ;
    .
// [6] service 3 - with a customed TDB
## ---------------------------------------------------------------
<#service3>  rdf:type fuseki:Service ;
    fuseki:name              "tdb" ;       # http://host:port/tdb
    fuseki:serviceQuery      "sparql" ;    # SPARQL query service
    fuseki:dataset           <#dataset> ;
    .

<#dataset> rdf:type      tdb:DatasetTDB ;
    tdb:location "DB" ;
    # Query timeout on this dataset (1s, 1000 milliseconds)
    ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "1000" ] ;
    # Make the default graph be the union of all named graphs.
    ## tdb:unionDefaultGraph true ;
    .

7 dataset

7.1 TDB

samples:

[1] fuseki-server --desc tdb.ttl /ds

# tdb.ttl
@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#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

<#dataset> rdf:type      tdb:DatasetTDB ;
    tdb:location "DB" ;
    .

[2] fuseki-server --loc=DB /ds

<#dataset> rdf:type      tdb:DatasetTDB ;
    tdb:location "DB" ;
    tdb:unionDefaultGraph true ;
    .

7.2 general database description

The Fuseki server can be given an assembler description to build a variety of model and datasets types.

samples:

fuseki-server --desc **assembler.ttl** /ds

// assembler.ttl
# Dataset of default graph and one named graph.
<#dataset> rdf:type ja:RDFDataset ;
    ja:defaultGraph <#modelDft> ;
    ja:namedGraph
        [ ja:graphName      <http://example.org/name1> ;
          ja:graph          <#model1> ] ;
    .

<#modelDft> a ja:MemoryModel ;
    ja:content [ ja:externalContent <file:Data.ttl> .

<#model1>  rdf:type ja:MemoryModel ;
    ja:content [ ja:externalContent <file:FILE-1.ttl> ] ;
    ja:content [ ja:externalContent <file:FILE-2.ttl> ] ;
    .

8 SPARQL Over HTTP(SOH)

see SOH - SPARQL over HTTP for more details.

9 use from Java

see ARQ - Querying Remote SPARQL Services for more details.

v2

TODO

Jena Fuseki 102的更多相关文章

  1. Jena Fuseki 101

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

  2. python使用rdflib创建rdf,在jena fuseki上执行SPARQL查询

    建立并启动jena fuseki服务 参考:https://www.cnblogs.com/bincoding/p/11223372.html 使用rdflib创建rdf文件 import rdfli ...

  3. 搭建Jena Fuseki并执行SPARQL查询

    1. 下载Jena Fuseki:http://jena.apache.org/download/index.cgi 2. 运行服务 windows解压后双击fuseki-server.bat lin ...

  4. Apache Jena Fuseki使用

    下载Apache Jena Fuseki 先从apache官网下载fuseki压缩包.然后解压到目标文件夹. apache官网:http://jena.apache.org/download/ 这里我 ...

  5. Jena TDB 102

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

  6. Jena Fuseki安装完成后不能添加数据库

    问题描述:安装Jena成功后可以进入管理页面,无法通过界面选择和查询数据 解决方案: 进入 apache-jena-fuseki-3.12.0\run 修改 shiro.ini 配置文件 注释 /$/ ...

  7. Jena+fuseki

    1.下载apache-jena-3.1.0.tar.gz,这个可以将ttl三元组文件或者xml文件加载 进入bin目录,执行./tdbloader2 --loc /path/for/database ...

  8. Outline of Apache Jena Notes

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

  9. 导入本体到Jena TDB数据库

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

随机推荐

  1. 分享 - 最初的JDBC操作步骤

    /* * 1. 注册 */ // 装载注册 SQLServer Driver Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDri ...

  2. android DevicePolicyManager实现一键锁屏

    本文章一部分资料来源于网上 1.实现一键锁屏关键是DevicePolicyManager这个类,然后使用lockNow():方法. 2.DevicePolicyManager类,可以让你的做软件获得系 ...

  3. 根据多年经验整理的《互联网MySQL开发规范》

    一.基础规范 使用 INNODB 存储引擎 表字符集使用 UTF8  所有表都需要添加注释 单表数据量建议控制在 5000W 以内 不在数据库中存储图⽚.文件等大数据 禁止在线上做数据库压力测试 禁⽌ ...

  4. Linux线程的实现 & LinuxThread vs. NPTL & 用户级内核级线程 & 线程与信号处理

    另,线程的资源占用可见:http://www.cnblogs.com/charlesblc/p/6242111.html 进程 & 线程的很多知识可以看这里:http://www.cnblog ...

  5. SQL convert datetime

    格式: CONVERT(data_type,expression[,style]) 说明: 此样式一般在时间类型(datetime,smalldatetime)与字符串类型(nchar,nvarcha ...

  6. 0030 Linux 网络操作命令

    1. 主机是否可达 ping IP 2. 服务是否在运行 telnet IP port 3. 网络配置 ifconfig ip route arp 4. 网络访问 curl wget 5. 网络追踪 ...

  7. Windows Store App 主题动画

    Windows 8系统的动画库中包含了丰富的主题动画,在开发Windows应用商店应用时,使用主题动画编写较少的代码即可实现所期望的动画效果.下面介绍一些常用的主题动画,读者可以根据每种主题动画提供的 ...

  8. 1410. Crack

    http://acm.timus.ru/problem.aspx?space=1&num=1410 题目倒是不难,水题DP 就是题意理解起来有点困难,意思就是给你一段话,提取里面的单词 单词有 ...

  9. 实现用CSS切割图片的方法

    切割图片这里不是真正的切割,只是用CSS取图片中的一部分而已.这样做的好处就是减少了打开网页时请求图片的次数.主要有两种方式,一是做为某一元素的背景图片,二是用img元素的属性. 方法一: 用CSS中 ...

  10. Android中Handler的消息处理

    关于Handler机制,能找到无数的文章.http://blog.csdn.net/jiangshitian/article/details/12525313这篇博客写得比较好,关键是图很清晰,结合H ...