On 19/04/12 15:51, Jim Reilly wrote:
Andy,
I found the solution this morning...:
use: datasetGraphTDB.sync(); instead of: TDB.sync(dataset) ;
Fixed.
where the datasetGraphTDB was from the DatasetGraphTransaction that
was from the Dataset, and that seemed to work (see code below, init()
method for reference, if interested.).
For reference only:
I am just writing a simple JenaDAO class and a JeneDAOTest junit test
for ... testing my methods.. ;-) Nothing too complicated...
So, between test runs, I would (or would NOT) run a maven clean that
would delete my TDB DB, thus allowing me the test over JVM restarts,
all from a Win/DOS cmd line... (using maven). I was only add 1
Statement, stopping, and then querying...
I'm running in Winblows 7, don't have cygwin installed, so can't run
the tdbquery... [I would have just for reference for ya...] But, per
maven, and clean compile and install, get the latest versions....
Is there any thoughts of writing equivalent windows .bat scripts for
those unix scripts...? (or an Ant script that would work on both
OS's...?)?
Sure - but better if a windows person contributes them, not being a
Windows user at the moment.
https://svn.apache.org/repos/asf/incubator/jena/Jena2/JenaZip/trunk/bat/sparql.bat
was my attempt at short notice for a command script.
If you are using Fuseki, a trick is:
java -jar fuseki-server.jar tdb.tdbloader ...
or
java -jar 'TDBInstallDir\lib\*;' tdb.tdbloader ...
(windows needs the trailing ";" for some reason, Linux does not need a ":").
Andy
Thanks for the help, much appreciated!!!
Tkx, Jim
private void init() { String assemblerFile = "tdb-assembler.ttl";
dataset = TDBFactory.assembleDataset(assemblerFile); model =
dataset.getDefaultModel(); DatasetGraphTransaction dst =
(DatasetGraphTransaction) dataset.asDatasetGraph(); datasetGraphTDB =
dst.getBaseDatasetGraph(); fileMgr = FileManager.get();
fileMgr.addLocatorClassLoader(JenaDAO.class.getClassLoader()); }
public void addStatement(Statement statement) {
model.add(statement); datasetGraphTDB.sync(); }