On 30/05/13 20:07, Rob Vesse wrote:
DatasetFactory.createMem() creates a new empty in-memory dataset
There are also lots of other create() overloads for creating datasets from
existing Model or DatasetGraph instances as necessary
If you really want a faithful TDB 'mock' for testing use
TDBFactory.createDataset() which creates a non-persistent in-memory TDB
instance backed by a simple RAM disk implementation. If you do this you
may need to up the heap size for your tests as using TDB this way can eat
up lots of memory particularly if you don't clean up properly.
Rob
Importantly, it's the DatasetGraph that "is" TDB - in fact, TDB just
uses a standard wrapper to add the higher level Dataset interface over
the core DatasetGraph.
On 5/30/13 10:12 AM, "Cindy A McMullen" <[email protected]> wrote:
I've been using TDB, but now want to set up a test environment with
in-memory graphs. Using TDB, I could create a Dataset to query as:
String directory = "/scratch/tdb/demo1" ;
Dataset ds = TDBFactory.createDataset(directory) ;
Query query = QueryFactory.create(q) ;
QueryExecution qe = QueryExecutionFactory.create(query, ds) ;
It's not clear from reading the documentation how to query over a
DatasetGraph? Can someone point me to an example?