将 bzip2 输出通过管道传输到 tdbloader2 (apache-jena) 得到 "File does not exist"
Piping bzip2 output into tdbloader2 (apache-jena) gives "File does not exist"
我想通过管道传输 bzip2 的输出,并将其用作输入,以使用来自 apache-jena-3.9.0 的 tbdloader2 填充 TDB 数据库。
我已经找到了
Generating TDB Dataset from archive containing N-TRIPLES files
但是那里提出的解决方案对我不起作用。
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test -- -
产生
20:08:01 INFO -- TDB Bulk Loader Start
20:08:01 INFO Data Load Phase
20:08:01 INFO Got 1 data files to load
20:08:01 INFO Data file 1: /home/user/-
File does not exist: /home/user/-
20:08:01 ERROR Failed during data phase
我得到了类似的结果(灵感来自 https://unix.stackexchange.com/questions/16990/using-data-read-from-a-pipe-instead-than-from-a-file-in-command-options)
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test /dev/stdin
20:34:45 INFO -- TDB Bulk Loader Start
20:34:45 INFO Data Load Phase
20:34:45 INFO Got 1 data files to load
20:34:45 INFO Data file 1: /proc/16256/fd/pipe:[92062]
File does not exist: /proc/16256/fd/pipe:[92062]
20:34:45 ERROR Failed during data phase
和
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test /dev/fd/0
20:34:52 INFO -- TDB Bulk Loader Start
20:34:52 INFO Data Load Phase
20:34:52 INFO Got 1 data files to load
20:34:52 INFO Data file 1: /proc/16312/fd/pipe:[97432]
File does not exist: /proc/16312/fd/pipe:[97432]
20:34:52 ERROR Failed during data phase
手动解压 bz2 文件然后添加它工作正常:
bzip2 -d test.ttl.bz2
tdbloader2 --loc=/pathto/TDBdatabase_test test.ttl
如果有人能指出正确的方向,那就太好了。
tdbloader2 在命令行上接受 bz2 压缩文件:
tdbloader2 --loc=/pathto/TDBdatabase_test test.ttl.bz2
它不接受来自管道的输入 - 如果接受了,那么它不知道语法是从文件扩展名中获取的 Turtle。
我想通过管道传输 bzip2 的输出,并将其用作输入,以使用来自 apache-jena-3.9.0 的 tbdloader2 填充 TDB 数据库。
我已经找到了 Generating TDB Dataset from archive containing N-TRIPLES files 但是那里提出的解决方案对我不起作用。
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test -- -
产生
20:08:01 INFO -- TDB Bulk Loader Start
20:08:01 INFO Data Load Phase
20:08:01 INFO Got 1 data files to load
20:08:01 INFO Data file 1: /home/user/-
File does not exist: /home/user/-
20:08:01 ERROR Failed during data phase
我得到了类似的结果(灵感来自 https://unix.stackexchange.com/questions/16990/using-data-read-from-a-pipe-instead-than-from-a-file-in-command-options)
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test /dev/stdin
20:34:45 INFO -- TDB Bulk Loader Start
20:34:45 INFO Data Load Phase
20:34:45 INFO Got 1 data files to load
20:34:45 INFO Data file 1: /proc/16256/fd/pipe:[92062]
File does not exist: /proc/16256/fd/pipe:[92062]
20:34:45 ERROR Failed during data phase
和
bzip2 -dc test.ttl.bz2 | tdbloader2 --loc=/pathto/TDBdatabase_test /dev/fd/0
20:34:52 INFO -- TDB Bulk Loader Start
20:34:52 INFO Data Load Phase
20:34:52 INFO Got 1 data files to load
20:34:52 INFO Data file 1: /proc/16312/fd/pipe:[97432]
File does not exist: /proc/16312/fd/pipe:[97432]
20:34:52 ERROR Failed during data phase
手动解压 bz2 文件然后添加它工作正常:
bzip2 -d test.ttl.bz2
tdbloader2 --loc=/pathto/TDBdatabase_test test.ttl
如果有人能指出正确的方向,那就太好了。
tdbloader2 在命令行上接受 bz2 压缩文件:
tdbloader2 --loc=/pathto/TDBdatabase_test test.ttl.bz2
它不接受来自管道的输入 - 如果接受了,那么它不知道语法是从文件扩展名中获取的 Turtle。