Hi Alessandro I am sorry for addressing you so directly, but I'm not sure where it is more > appropriate to post such questions (couldn't find a mailing list for users > on the Clerezza homepage) and unfortunately my issue is very urgent. >
There's only one mailing list, both for users and devleopers, its [email protected] (added in cc) > > I am running an Equinox environment (plain, no SCR/Declarative services), > which includes some Clerezza bundles (mainly the org.apache.clerezza.rdf.* > ones). > > At some point I need to run a SPARQL query via > TcManager.executeSparqlQuery(), having obtained TcManager via > TcManager.getInstance() . This throws a NoQueryEngineException. > > However the org.apache.clerezza.rdf.jena.sparql bundle and its dependencies > are active and started before the bundle that does the query. > > Since org.apache.clerezza.rdf.jena.sparql contains a QueryEngine service > specification in its META-INF/services , shouldn't the Jena query engine be > registered automatically? META-INF services is used only outside an OSGi environment. > Or this doesn't hold in OSGi? Is there a way to register it myself > programmatically? > The problem is that the bindQueryEngine-method is protected so it cannot be called unless you subclass TcManager or if you use declarative service (or do the same magic otherwise). What I'm wondering is how the TcProviders are registered? The getInstance static method is designed for non-osgi use and locates the TcProvider (such as the one provided by the org.apache.clerezza.rdf.jena.tdb.storage) using META-INF/services. I think you should use declarative service, if not I think the easiest is subclass TcManager and inject the weightedTcProvider and queryEngine using the bind-methods (which you don't see when looking at the TcManager source, nevertheless they are in the compiled class file because they are added by the maven-scr-plugin). Cheers, Reto > Thank You, > Alessandro > > -- > Alessandro Adamou > Semantic Technology Laboratory (STLab) > Institute for Cognitive Science and Technology (ISTC) > National Research Council (CNR) > Via Nomentana 56, Rome - Italy > >
