PelletInfGraph pelletInfGraph = (PelletInfGraph) graph;
KnowledgeBase kb = pelletInfGraph.getKB();
pelletInfGraph.prepare();
ARQParser parser = new ARQParser();
// The parser uses the query parameterization to resolve
// parameters
// (i.e. variables) in the query
parser.setInitialBinding( initialBinding );
try {
parser.parse( query, kb );
// parsing successful so we can use Pellet engine
engineType = QueryEngineType.PELLET;
} catch( UnsupportedQueryException e ) {
// parsing failed so we will use the mixed engine
engineType = QueryEngineType.MIXED;