On 22/09/11 09:38, Ján Mojžiš wrote:
Hello,
I work with jena tdb triple store and I would like to have following
question answered:

To create and fill jena tdb store I use commands:

TDBFactory tdb = new TDBFactory();

Not needed : it's all a library of statics.

InputStream in = new FileInputStream(new File("dblp-2006-02-06.rdf"));

model = TDBFactory.createModel("data\\");//createModel();


model.read(in, null);
in.close();

jena's tdb then creates a data files under data\\ directory and fills them
with triples from my source file. It is processed without any error and
it is clear, that the database files are filled with something.

Now how to re-open the dataset on disk back, so I can use it again to query?
I suggest to use directory data\\ again, but there is no such argument in
functions TDBLoader.

Please, I look forward to hear anything from you.
Thanks.

Jan Mojzis, new-user of jena tdb


"create" refers to the Java object, not the database itself.

Call

model = TDBFactory.createModel("data\\");

Think of it as "connect".

It does autocreate non-existent databases.

Unrelated: By the way, it is better to use

Dataset ds = TDBFactory.createDataset("data\\");
model = ds.getDefaultModel() ;

as you may later want to use the dataset.

        Andy

Reply via email to