I am trying to use Jena or some other Java library to achieve some coding challenge (in this case a rewriting through post-order traversal). I am not asking a methodology to translate SPARQL to SQL query. I already have that.
I am currently trying to translate a given SPARQL query into an some other SQL query.
So far, I've used Jena parser, that given a SPARQL query, returns an ARQ tree representation, that can be traversed in post-order. This is exactly what I want to do.
The only problem is that the Walker, just walks through the tree. What I would like to do, is something like this (suppose I am going through a MINUS) :
String visit(OpMinus minus){
String l_res = minus.getLeft().visit();
String r_res = minus.getRight().visit();
/*
... do some stuff with the result ...
*/
String res = l_res + "MINUS (" + r_res + ")";
return res;
}
Jena's visitor however returns void, making this impossible. Is there another way of doing it, instead of copying the Walker and the Visitor code, in order to make it work the way I want ? Thank you.
I am not looking for a SPARQL-to-SQL direct translator, because I need to work with the tree elements.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)