首页 > 解决方案 > 有谁知道如何让 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文件时,我得到一个堆栈跟踪,抱怨它的格式。

谷歌已经打开了耶拿文档,告诉我命令存在,就是这样。所以任何帮助表示赞赏。

标签: jenatdb

解决方案


“--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 检测现有数据库类型。


推荐阅读