jena - 有谁知道如何让 tdb2.dump 命令真正做任何事情
问题描述
我正在尝试将耶拿数据库转储为三元组。
似乎有一个命令听起来非常适合这项任务:tdb2.dump
jena@debian-clean:~$ ./apache-jena-3.8.0/bin/tdb2.tdbdump --help
tdbdump : Write a dataset to stdout (defaults to N-Quads)
Output control
--output=FMT Output in the given format, streaming if possible.
--formatted=FMT Output, using pretty printing (consumes memory)
--stream=FMT Output, using a streaming format
--compress Compress the output with gzip
Location
--loc=DIR Location (a directory)
--tdb= Assembler description file
Symbol definition
--set Set a configuration symbol to a value
--mem=FILE Execute on an in-memory TDB database (for testing)
--desc= Assembler description file
General
-v --verbose Verbose
-q --quiet Run with minimal output
--debug Output information for debugging
--help
--version Version information
--strict Operate in strict SPARQL mode (no extensions of any kind)
jena@debian-clean:~$
但我没有成功让它向 STDOUT 写入任何内容。
当我使用--loc
参数指向数据库时,该数据库的新副本出现在子文件夹中:Data-0001
,但 STDOUT 中没有任何内容。
当我尝试该--tdb
参数并将其指向一个ttl
文件时,我得到一个堆栈跟踪,抱怨它的格式。
谷歌已经打开了耶拿文档,告诉我命令存在,就是这样。所以任何帮助表示赞赏。
解决方案
“--loc”应该与用于创建数据库的相同。
假设那是“DB2”。对于创建数据库后的 TDB2(不是 TDB1),则“DB2/Data-0001”将已经存在。不要将其用于 --loc。使用“--loc DB2”。
如果是 TDB1 数据库(文件在“--loc”目录下,没有“Datat-0001”),则使用tdbdump
. 空数据库中没有三元组/四元组,因此您不会得到任何输出。
Fuseki 当前(最高 3.16.0)每次运行时都必须使用相同的设置进行调用,这对于 TDB1/TDB2 来说是脆弱的。如果您在 Fuseki 之外创建 TDB2 数据库并且仅使用命令行参数,则每次都需要“--tdb2”。
下一版本 (3.17.0) 中的 Fuseki 检测现有数据库类型。
推荐阅读
- wpf - WPF中,如何在ScrollViewer中自定义ScrollBar的样式
- python - python比较两个不同格式的日期字符串
- r - 使用前一行的结果以特定的数字顺序进行变异
- c++ - 如何在类中获取静态变量
- python - 使用 Cython 为 ac 库编译包装器 - 链接器在 OSX 上找不到外部 c 库的 .dylib
- r - 计算 Gelman-Rubin Rhat/psrf 诊断;记忆问题
- latex - 将 Tikz 用于 Overleaf 时如何解决此错误?
- c++ - 使用 istream (std cin):防止 Windows 上的“[输入] 未被识别为 ...”
- node.js - 为什么 fs.readFile 触发“错误:EMFILE:打开的文件太多”,我该如何解决?
- css - Material UI Typography 元素均未垂直对齐