In order to have 100% native coverage of SPARQL we must translate the SPARQL operator tree as received from the parser into Bigdata operators. This will make it possible to provide native evaluation of optional join groups and several other interesting SPARQL constructions.
Note that there are already two SPARQL parsers which use bigdata (Sesame, Glitter) and we may be doing a Jena integration shortly. Therefore, it makes sense that this translation should be as portable as possible with respect to the source abstract syntax tree (AST).
This translation should be captured in a declarative manner, ideally as a set of rules. I have identified an embeddable Java based implementation of Prolog for this purpose (tuprolog). This should provide us with the ability to traverse the generated SPARQL operator trees regardless of the parser, convert (either directly or via an intermediate syntax tree) to bigdata operators, and then to optimize the bigdata operator tree through a set of rewrite rules.