1

I am completely new to Jena/TDB. All I want to do is to load data from some sample rdf, N3 etc file using tdb scripts or through java api. I am tried to use tbdloader on Cygwin to load data (tdb-0.9.0, on Windows XP with IBM Java 1.6). Following are the command that I ran:

$ export TDBROOT=/cygdrive/d/Project/Store_DB/jena-tdb-0.9.0-incubating
$ export PATH=$TDBROOT/bin:$PATH

I also changed classpath for java in the tdbloader script as mentioned at tdbloader on Cygwin: java.lang.NoClassDefFoundError :

exec java $JVM_ARGS $SOCKS -cp "PATH_OF_JAR_FILES" "tdb.$TDB_CMD" $TDB_SPEC "$@"

So when I run $ tdbloader --help it shows the help correctly. But when I run

$ tdbloader --loc /cygdrive/d/Project/Store_DB/data1

OR

$ tdbloader --loc /cygdrive/d/Project/Store_DB/data1 test.rdf

I am getting following exception:

        com.hp.hpl.jena.tdb.base.file.FileException: Failed to open: d:\cygdrive\d\Project\Store_DB\data1\node2id.idn (mode=rw)
        at com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:83)
        at com.hp.hpl.jena.tdb.base.file.ChannelManager.openref$(ChannelManager.java:58)
        at com.hp.hpl.jena.tdb.base.file.ChannelManager.acquire(ChannelManager.java:47)
        at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:57)
        at com.hp.hpl.jena.tdb.base.file.FileBase.<init>(FileBase.java:46)
        at com.hp.hpl.jena.tdb.base.file.FileBase.create(FileBase.java:41)
        at com.hp.hpl.jena.tdb.base.file.BlockAccessBase.<init>(BlockAccessBase.java:46)
        at com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createStdFile(BlockMgrFactory.java:98)
        at com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.createFile(BlockMgrFactory.java:82)
        at com.hp.hpl.jena.tdb.base.block.BlockMgrFactory.create(BlockMgrFactory.java:58)
        at com.hp.hpl.jena.tdb.setup.Builder$BlockMgrBuilderStd.buildBlockMgr(Builder.java:196)
        at com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.createBPTree(Builder.java:165)
        at com.hp.hpl.jena.tdb.setup.Builder$RangeIndexBuilderStd.buildRangeIndex(Builder.java:134)
        at com.hp.hpl.jena.tdb.setup.Builder$IndexBuilderStd.buildIndex(Builder.java:112)
        at com.hp.hpl.jena.tdb.setup.Builder$NodeTableBuilderStd.buildNodeTable(Builder.java:85)
        at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd$NodeTableBuilderRecorder.buildNodeTable(DatasetBuilderStd.java:389)
        at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.makeNodeTable(DatasetBuilderStd.java:300)
        at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd._build(DatasetBuilderStd.java:167)
        at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:157)
        at com.hp.hpl.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:70)
        at com.hp.hpl.jena.tdb.StoreConnection.make(StoreConnection.java:132)
        at com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGraphTransaction.java:46)
        at com.hp.hpl.jena.tdb.sys.TDBMakerTxn._create(TDBMakerTxn.java:50)
        at com.hp.hpl.jena.tdb.sys.TDBMakerTxn.createDatasetGraph(TDBMakerTxn.java:38)
        at com.hp.hpl.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:166)
        at com.hp.hpl.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:74)
        at com.hp.hpl.jena.tdb.TDBFactory.createDataset(TDBFactory.java:53)
        at tdb.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:95)
        at arq.cmdline.ModDataset.getDataset(ModDataset.java:34)
        at tdb.cmdline.CmdTDB.getDataset(CmdTDB.java:137)
        at tdb.cmdline.CmdTDB.getDatasetGraph(CmdTDB.java:126)
        at tdb.cmdline.CmdTDB.getDatasetGraphTDB(CmdTDB.java:131)
        at tdb.tdbloader.loadQuads(tdbloader.java:163)
        at tdb.tdbloader.exec(tdbloader.java:122)
        at arq.cmdline.CmdMain.mainMethod(CmdMain.java:97)
        at arq.cmdline.CmdMain.mainRun(CmdMain.java:59)
        at arq.cmdline.CmdMain.mainRun(CmdMain.java:46)
        at tdb.tdbloader.main(tdbloader.java:53)
Caused by: java.io.FileNotFoundException: d:\cygdrive\d\Project\Store_DB\data1\node2id.idn (The system cannot find the path specified.)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:222)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:107)
        at com.hp.hpl.jena.tdb.base.file.ChannelManager.open$(ChannelManager.java:80)
        ... 37 more

I am not sure what node2id.idn file is and why is it expecting it?

Community
  • 1
  • 1
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73

1 Answers1

1

The file node2id.idn is one of TDB's internal index files. It's not something that you have to create or manage for yourself. I've just tried tdbloader on cygwin myself, it it worked OK for me. I can think of two basic possibilities:

  • your disk is full
  • the TDB index is corrupted

If this is the first file you are loading into an otherwise emtpy TDB, the second possibility is unlikely. If you are loading into a non-empty TDB, try deleting the TDB image and starting again. Note that TDB by itself does not manage concurrent writes: if you have more than one process writing to a single TDB image, you must handle locking at the application level, or use TDB's transactions.

The final possibility, of course, is that your disk is flaky. You might want to try your code on another machine.

If none of these suggestions help, please send a complete minimal test case to the Jena users list.

Ian Dickinson
  • 12,875
  • 11
  • 40
  • 67
  • Thanks for your reply. By empty TDB, you mean directory `/cygdrive/d/Project/Store_DB/data1` is empty? yes, it is empty. My disk is also not full. So now I will try to run it on another machine, as you suggested. – Kuldeep Jain Jun 14 '12 at 07:07
  • Moved on to using Jena API(through code) to do this. Thanks for your help @IanDickinson. – Kuldeep Jain Jun 19 '12 at 19:06