Andy Seaborne wrote: > On 25/05/12 19:27, Paolo Castagna wrote: >> Hi Rob >> >> Robert Vesse wrote: >>> There's nothing to stop us making LARQ generate an uber-jar in the same >>> way we do for Fuseki with maven shade is there? >>> >>> This would be sufficient for users if they only had to drop in a single >>> extra JAR into a directory - most users can manage that ;-) >> >> My 0 hasn't flipped to +1, but if you need that feel free to go ahead. >> >>> Yes that is my concern that we're making users jump through a lot of >>> hoops >>> to extend things >> >> Yep. >> >>> I thought assemblers can be used to get arbitrary classes loaded so can >>> you not theoretically have some initializer class for the plugin >>> (whether >>> LARQ or otherwise) and add lines to the assembler to get it loaded. >>> >>> It seems like assemblers would solve other current problems with LARQ >>> such >>> as the ability to specify custom analyzers, index directories etc. >>> Doing >>> everything via assembler seems the logical way to go for plugins like >>> LARQ >> >> I am by no means an Assembler expert and perhaps you are right. I hope >> so. >> >> If I remember correctly the problem I had was that in order to build a >> LARQ >> index, I needed a Dataset, but I did not find a way to get a reference >> to an >> object created by another assembler module from the LARQ ones. I hope I >> explained this clearly enough. >> >> Paolo > > +1 to assemblers. > > And in general, the "drop jars into a dir" idea works very well with > assemblers because > > [] ja:loadClass "x.y.z.someclass" . > > mechanism also invokes a static init() method so the code gets a chance > to plug into the system during startup. > > Paolo - there are various examples of assembler code in the codebase > e.g. TDB :-)
Hi Andy, good, thanks for the +1 on assemblers. The thing that I struggled with is how to get a reference to a Dataset (built by an assembler in TDB or other systems, SDB) when I need to build an IndexLARQ. I need a reference to a Dataset since I want to register a listener to be notified as new triples|quads are added/removed (and update Lucene index accordingly). Dataset dataset = ... ; IndexBuilderModel larqBuilder = new IndexBuilderString(indexWriter) ; dataset.getDefaultModel().register(larqBuilder); for ( Iterator<String> iter = dataset.listNames() ; iter.hasNext() ; ) { String g = iter.next() ; dataset.getNamedModel(g).register(larqBuilder) ; } This was the reasons of the 'pollution' and call to make(...) via reflection in ARQ's DatasetAssembler. Is there an example of an assembler which uses and/or get a reference to an object build elsewhere via another assembler? This is what I am not sure is possible and if it is possible, I do not know how to do it with assemblers. A similar requirement would arise if we want to have an assembler which build a Dataset wrapping an existing assembler object built by another assembler from TDB or SDB. (I hope I explained my problem clearly enough... I have not tried yet to do this again, from scratch and avoiding any change to ARQ or TDB code as it should be to allow third party to plug-in their extensions transparently). Paolo > > Andy