Hi,
I'm trying to get Lucene working with TDB,
but no luck so far.
I already
have a TDB dataset saved in "tdb_directory" folder, with the following
platform:
Jena-2.11.1
Lucene-4.8.0 (Apache)
Java-1.7.0,
64-Bit
And I have
the following code:
Dataset ds1 = TDBFactory.createDataset(tdb_directory);
EntityDefinition entDef = new
EntityDefinition("uri", "text", RDFS.label.asNode());
File indexDir = new File(index_directory);
try{
dir
= FSDirectory.open(indexDir);
} catch(IOException e) {
e.printStackTrace();
}
Dataset ds = TextDatasetFactory.createLucene(ds1,
dir, entDef);
Then, when I execute the query as
following:
ds.begin(ReadWrite.READ);
Model model = ds.getDefaultModel();
Query q = QueryFactory.create(pre + "\n"
+ qs);
QueryExecution qexec =
QueryExecutionFactory.create(q, ds);
QueryExecUtils.executeQuery(q,
qexec);
ds.commit();
ds.end();
I get an empty table
-------------
| s | label |
=============
and in the index_directory, only 3
file were created; segments.gen, segments_1, and write.lock, with sizes 1kb,
1kb, 0kb, respectively.
I'm not sure what I'm missing here,
and really appreciate any help.
Thanks in advance.
Karen