Is any easy way to parse sparql query in variables for java, like Fyzz in python? How can Jena or sesame APIs been used?
You can parse and manipulate SPARQL in java using Apache Jena's ARQ pretty simply, at either the syntax or algebra level. QueryFactory.create(queryString) will provide a java representation of the query. Then poke around:
Query query = QueryFactory.create(queryString);
query.isSelectType() && query.isQueryResultStar(); // of the form SELECT *?
query.getDatasetDescription(); // FROM / FROM NAMED bits
query.getQueryPattern(); // The meat of the query, the WHERE bit
...etc etc..
Op op = Algebra.compile(query); // Get the algebra for the query
(see the Query java documentation)
Try starting with the tutorial 'Manipulating SPARQL using ARQ'. That will give you a feel for how queries are represented, and how to pull things out from them (visitors are especially useful). Although initially the syntax level is most familiar, for many tasks the algebra works better since it corresponds to what a query actually does.