When trying out Apache Jena with the following code:
dataset = TDBFactory.createDataset(directory); Model model = dataset.getDefaultModel(); dataset.begin(ReadWrite.WRITE); Resource r=model.createResource(NS+"subject"); Property p = model.createProperty(NS + "predicate"); r.addProperty(p, "object"); model.write(System.out, "Turtle"); dataset.close();
Jena chokes on this. I am in the process of fixing this and purposely not showing what the content was but I am much more concerned with the way Jena chokes. Two error stack trace examples are shown below.
Question: How can one avoid such error messages? Is this kind of choking often happening?
Error stack trace #1
java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:275) at com.hp.hpl.jena.tdb.base.objectfile.ObjectFileStorage.read(ObjectFileStorage.java:328) at com.hp.hpl.jena.tdb.lib.NodeLib.fetchDecode(NodeLib.java:79) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableNative.readNodeFromTable(NodeTableNative.java:187) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:112) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:71) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:125) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:84) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:54) at com.hp.hpl.jena.tdb.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:67) at com.hp.hpl.jena.tdb.lib.TupleLib.triple(TupleLib.java:129) at com.hp.hpl.jena.tdb.lib.TupleLib.triple(TupleLib.java:113) at com.hp.hpl.jena.tdb.lib.TupleLib.access$000(TupleLib.java:44) at com.hp.hpl.jena.tdb.lib.TupleLib$3.convert(TupleLib.java:75) at com.hp.hpl.jena.tdb.lib.TupleLib$3.convert(TupleLib.java:71) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter.next(Iter.java:923) at com.hp.hpl.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.findBNodesSyntax1(TurtleShell.java:304) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:147) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:103) at org.apache.jena.riot.writer.TurtleShell.writeGraphTTL(TurtleShell.java:88) at org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.write(TurtleWriter.java:47) at org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.access$000(TurtleWriter.java:35) at org.apache.jena.riot.writer.TurtleWriter.output(TurtleWriter.java:32) at org.apache.jena.riot.writer.TurtleWriterBase.output$(TurtleWriterBase.java:55) at org.apache.jena.riot.writer.TurtleWriterBase.write(TurtleWriterBase.java:49) at org.apache.jena.riot.adapters.RDFWriterRIOT.write(RDFWriterRIOT.java:101) at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:345)
Error stack trace #2
org.apache.jena.atlas.lib.InternalErrorException: Invalid id node for subject (null node): ([0000000000000000], [000000000000001E], [000000000000003C]) at com.hp.hpl.jena.tdb.lib.TupleLib.triple(TupleLib.java:127) at com.hp.hpl.jena.tdb.lib.TupleLib.triple(TupleLib.java:113) at com.hp.hpl.jena.tdb.lib.TupleLib.access$000(TupleLib.java:44) at com.hp.hpl.jena.tdb.lib.TupleLib$3.convert(TupleLib.java:75) at com.hp.hpl.jena.tdb.lib.TupleLib$3.convert(TupleLib.java:71) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter$4.next(Iter.java:323) at org.apache.jena.atlas.iterator.Iter.next(Iter.java:923) at com.hp.hpl.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.findBNodesSyntax1(TurtleShell.java:304) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:147) at org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:103) at org.apache.jena.riot.writer.TurtleShell.writeGraphTTL(TurtleShell.java:88) at org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.write(TurtleWriter.java:47) at org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.access$000(TurtleWriter.java:35) at org.apache.jena.riot.writer.TurtleWriter.output(TurtleWriter.java:32) at org.apache.jena.riot.writer.TurtleWriterBase.output$(TurtleWriterBase.java:55) at org.apache.jena.riot.writer.TurtleWriterBase.write(TurtleWriterBase.java:49) at org.apache.jena.riot.adapters.RDFWriterRIOT.write(RDFWriterRIOT.java:101) at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:345) at org.simela.parser.TestJena.testJenaFromSimela(TestJena.java:71)