Dave,
Which version are you running?
There has been a bug in this area - fixed in the development codebase.
https://repository.apache.org/content/groups/snapshots/org/apache/jena/jena-tdb/
But it's also one of those places in the code where when something goes
wrong, it shows up here. It's looking in the prefixes file.
Is the data publicly accessible so I can try it?
Andy
On 13/12/11 13:31, [email protected] wrote:
I'm getting this error trying to load a turtles file (.ttl) into a new
tdb database.
Here is the traceback:
java.util.NoSuchElementException
at org.openjena.riot.tokens.TokenizerText.next(TokenizerText.java:90)
at com.hp.hpl.jena.tdb.nodetable.NodecSSE.decode(NodecSSE.java:91)
at com.hp.hpl.jena.tdb.lib.NodeLib.decode(NodeLib.java:89)
at com.hp.hpl.jena.tdb.lib.NodeLib.fetchDecode(NodeLib.java:71)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableNative.readNodeByNodeId(NodeTableNative.java:158)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:85)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:58)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:44)
at
com.hp.hpl.jena.tdb.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:55)
at com.hp.hpl.jena.tdb.lib.TupleLib.tupleNodes(TupleLib.java:86)
at com.hp.hpl.jena.tdb.lib.TupleLib$1.convert(TupleLib.java:40)
at com.hp.hpl.jena.tdb.lib.TupleLib$1.convert(TupleLib.java:36)
at org.openjena.atlas.iterator.Iter$4.next(Iter.java:267)
at
com.hp.hpl.jena.tdb.sys.ConcurrencyPolicyMRSW$IteratorCheckNotConcurrent.next(ConcurrencyPolicyMRSW.java:113)
at
com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.readPrefix(DatasetPrefixesTDB.java:130)
at
com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.get(GraphPrefixesProjection.java:85)
at
com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.set(GraphPrefixesProjection.java:63)
at
com.hp.hpl.jena.shared.impl.PrefixMappingImpl.setNsPrefix(PrefixMappingImpl.java:52)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.setNsPrefix(ModelCom.java:792)
at
org.openjena.riot.system.JenaReaderTurtle2.readWorker(JenaReaderTurtle2.java:37)
at
org.openjena.riot.system.JenaReaderRIOT.readImpl(JenaReaderRIOT.java:120)
at org.openjena.riot.system.JenaReaderRIOT.read(JenaReaderRIOT.java:79)
The code in question is:
Dataset ds = TDBFactory.createDataset( tdbDest ) ; // tdbDest is a String
Model model = ds.getDefaultModel() ;
RDFReader rdfRdr = model.getReader( "TTL" );
File f = new File( ttlDir, fn ); // ttlDir is a File, fn is a String
InputStream dataStream = new FileInputStream( f );
rdfRdr.read( model, dataStream, null ); // <-- this is where the error
occurs
dataStream.close();
Is there a way to find out where in the file the error occurred? Is this
indicative of a specific problem?
My ttl file has many lines with \unnnn UTF-8 coded entries, if that has
any impact.
Thanks
Dave Patterson