(documentation corrected and example code on src-examples)

Sorry about that - the concept of DatasetGraphTDB got split into two parts when transactions were added. DatasetGraphTDB is the concrete storage DatasetGraph and DatasetGraphTransaction the low level API.

Jim's fix is the right way to do it.

(Maybe, long term, a cleaner way to get NodeIds out of TDB that wrapped up the incantations needed to walk the internal datastructures would be good.)

        Andy

On 21/05/12 15:20, Jim Reilly wrote:


I believe the API had changed across versions, so I did this:

     DatasetGraphTransaction dst = (DatasetGraphTransaction) 
ds.asDatasetGraph();
     DatasetGraphTDB datasetGraphTDB = dst.getBaseDatasetGraph();



Tkx,
Jim



________________________________
  From: Dick Murray<[email protected]>
To: [email protected]
Sent: Monday, May 21, 2012 10:08 AM
Subject: ExQuadFilter cast error.

Hi all.

I needed to apply a low level filter so pulled the ExQuadFilter code to get
started but the following line in setup()...

DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;

throws a...

Exception in thread "main" java.lang.ClassCastException:
com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction cannot be cast to
com.hp.hpl.jena.tdb.store.DatasetGraphTDB
     at com.unit4.dev.QuadFilter.setup(QuadFilter.java:66)
     at com.unit4.dev.QuadFilter.main(QuadFilter.java:57)

It looked standalone but as I'm fresh on this aspect of Jena an idea..? :-)

Regards Dick.

Reply via email to