我正在尝试以三元组的形式转储一个jena数据库。
似乎有一个命令听起来非常适合这项任务: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文件时,我得到一个堆栈跟踪,报告它的格式。
Google已经找到了Jena文档,告诉我该命令存在,仅此而已。所以我很感谢你们的帮助。
发布于 2020-09-10 22:06:05
"--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可检测现有数据库类型。
https://stackoverflow.com/questions/63791814
复制相似问题