1

我要求每天增量更新 tdb 文件。所以我使用 tdb2.tdbloader 来生成 N-Triples 文件。但是当工作完成时,包含 tdb 数据的数据目录有一个名为“data-0001”左右的新目录。当我重新启动 fuseki 服务器时,它给了我这个异常:

org.apache.jena.assembler.exceptions.AssemblerException: caught: 
Unable to check TDB lock owner as the lock file contains invalid data
    doing:
root: file:///opt/someDir/fuseki/fuseki/assembler.ttl#dataset with type: http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class org.apache.jena.tdb.assembler.DatasetAssemblerTDB

    at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
    at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
    at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
    at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
    at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
    at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:126)
    at arq.cmdline.ModAssembler.create(ModAssembler.java:72)
    at arq.cmdline.ModDatasetAssembler.createDataset(ModDatasetAssembler.java:42)
    at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.processModulesAndArgs(FusekiCmd.java:285)
    at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
    at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
    at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
    at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
    at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:103)
    at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB lock owner as the lock file contains invalid data
    at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
    at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
    at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:259)
    at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
    at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:237)
    at org.apache.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGraphTransaction.java:73)
    at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:55)
    at org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:42)
    at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
    at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
    at org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
    at org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
    at org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
    at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
    ... 14 more
Caused by: java.lang.NumberFormatException: For input string: "6893
"
    at   
 java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
    ... 27 more

我的问题是:如何将 fuseki 与 tdb2.tdbloader 一起使用,更重要的是,如果我每天更新,data 文件夹中的目录是否每天增加?无论如何我可以合并它们吗?

4

1 回答 1

0

我知道问题出在哪里:tdb2.xxx 仅适用于 tdb2。而我在 fuseki 中的配置是 tdb1 而不是 tdb2。

顺便说一下,tdb2.tdbloader 不支持对数据集进行增量更新。它只会在旧的基础上增加 spo。

于 2018-06-07T09:22:44.650 回答