You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Paolo Castagna <ca...@googlemail.com> on 2011/04/26 20:17:13 UTC
Adding LARQ to Fuseki via DatasetAssemblerTDB
Hi,
today, I had a go at adding LARQ to DatasetAssemblerTDB.
We can use reflection in TDB's DatasetAssemblerTDB so that we do not
need to add a dependency on Lucene to TDB (see patch attached).
This works, however I am not satisfied by logging and exception handling.
I did not want to pollute the console when running TDB tests, however now
when there is a problem it's not as easy to understand what's going wrong.
Also, I am not so sure how we are suppose to .close() things.
My ultimate goal was to use LARQ from Fuseki, so, I tried to use the
modified DatasetAssemblerTDB from Fuseki.
I noticed a problem with Lucene write.lock file and after some investigation
I found that the DatasetAssemblerTDB was called twice. This could be a
bug:
Index: src/main/java/org/openjena/fuseki/FusekiCmd.java
===================================================================
--- src/main/java/org/openjena/fuseki/FusekiCmd.java (revision 8563)
+++ src/main/java/org/openjena/fuseki/FusekiCmd.java (working copy)
@@ -183,12 +183,6 @@
throw new CmdException(argPort.getKeyName()+" : bad port number: "+portStr) ;
}
}
- else
- {
- Dataset ds = modDataset.createDataset() ;
- if ( ds != null )
- dsg = ds.asDatasetGraph() ;
- }
if ( dsg == null )
throw new CmdException("No dataset defined: "+argUsage) ;
After I removed these lines from FusekiCmd.java I was able to use LARQ
successfully simply adding a ja:textIndex "..." to my assembler file:
<#dataset> rdf:type tdb:DatasetTDB ;
...
ja:textIndex "/path/to/lucene/index" ;
.
I'd really like to use LARQ (the one available as a separate module)
from Fuseki and this is the best way I found to do it.
What do you think?
Paolo