Jon*_*han 2 jena triplestore fuseki docker
我正在按照此Docker映像的说明进行操作,该映像描述了如何使用Apache Fuseki设置新的容器化RDF三元组.我想我可以使用Dockerfile自动执行这些数据集指令中的所有步骤,但是在"识别Fuseki中的数据集"下有一步,您可以进入GUI界面并在那里添加新数据集.由于我最终希望自动执行此过程,因此我想找到一种添加新数据集的命令行方式.它不需要任何花哨的东西,只需添加一个具有给定名称的新数据集,如"db".有没有办法做到这一点?(而且,我想,这是在docker容器中运行该命令的一种方法吗?)
这是你需要做的:
(1)用你的容器启动容器docker run -p 3030:3030 -it stain/jena-fuseki.
(2)找到你的容器的id $$$ docker ps.
(3)config.ttl用docker container cp config.ttl $$$:config.ttl.将文件复制到docker容器.示例config.ttl可以如下所示:
@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 : <#> .
<#service1> rdf:type fuseki:Service ;
fuseki:name "ds" ; # http://host:port/ds
fuseki:serviceQuery "sparql" ; # SPARQL query service
fuseki:serviceQuery "query" ; # SPARQL query service (alt name)
fuseki:serviceUpdate "update" ; # SPARQL update 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> ;
.
<#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 ;
.
Run Code Online (Sandbox Code Playgroud)
(4)用你的容器提交更改docker container commit $$$ stackoverflow/jena-fuseki:latest.
(5)用:重新启动容器docker run -p 3030:3030 -it stackoverflow/jena-fuseki ./fuseki-server --config=/config.ttl.
(6)如果你现在去,http://localhost:3030你应该看到你的数据集.
| 归档时间: |
|
| 查看次数: |
581 次 |
| 最近记录: |