Hello everyone,
I bulk load some RDF files into a TDB2 in my Java code, like,
Runtime.getRuntime().exec(“tdb2.tdbloader --loc=dataset --loader=parallel
a.rdf b.rdf c.rdf”);
But when I connect to the dataset by java API, like
Dataset dbdataset = TDB2Factory.assembleDataset("dataset");
I get a empty dataset, and cannot query any data.
Further, I add some data into the same TDB2 by java api, like
dbdataset.begin(ReadWrite.WRITE);
UpdateRequest updateRequest = UpdateFactory.create(
"PREFIX dc: <http://purl.org/dc/elements/1.1/>\n" +
"INSERT DATA\n" +
"{ \n" +
" <http://example/book1> dc:title \"A new book\" ;\n" +
" dc:creator \"A.N.Other\" .\n"
+
"}");
UpdateProcessor updateProcessor =
UpdateExecutionFactory.create(updateRequest, dbdataset);
updateProcessor.execute();
dbdataset.commit();
dbdataset.close();
I can query the data of book1 only by java api, and tdb2.tdbquery commandline
tool can query all data include book1 and RDF files.
So how to make it work?
Btw, is there any tdb2 tdbloaer Java API?
Thank you very much
Jason
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10