final CommonTree t = (CommonTree) result.getTree();
final CommonTreeNodeStream nodes = new CommonTreeNodeStream( t );
nodes.setTokenStream( tokenStream );
final SparqlOwlTreeARQ treeWalker = new SparqlOwlTreeARQ( nodes );
try {
treeWalker.query( query );
} catch( RecognitionException e ) {
throw new QueryParseException( format( "%s %s", treeWalker.getErrorHeader( e ),
treeWalker.getErrorMessage( e, parser.getTokenNames() ) ), e.line,
e.charPositionInLine );
}
return query;
}