I have the following code excerpt in the main method:
CsparqlQueryResultProxy c1 = null;
c1 = engine.registerQuery(query, false);
c1.addObserver(new RDFResultsProcesser());
In order to get the Observer argument values I created a new class as an extension to ResultsFormatter
like follows:
public class RDFResultFormatter extends ResultFormatter {
@Override
public void update(Observable o, Object arg) {
RDFTable res = (RDFTable) arg;
for (final RDFTuple t : res) {
String rdfName = t.get(0);
String rdfVal = t.get(1);
}
}
}
But, I cannot return back the values of rdfName
and rdfVal
in main and I know its because of the fact that update is a void function. Does anyone has any idea how can I return these values in main?