ASTQuery queryNode = qc.getQuery();
if (queryNode instanceof ASTSelectQuery) {
query = new ParsedTupleQuery(tupleExpr);
}
else if (queryNode instanceof ASTConstructQuery) {
query = new ParsedGraphQuery(tupleExpr, prefixes);
}
else if (queryNode instanceof ASTAskQuery) {
query = new ParsedBooleanQuery(tupleExpr);
}
else if (queryNode instanceof ASTDescribeQuery) {
query = new ParsedGraphQuery(tupleExpr, prefixes);
}
else {
throw new RuntimeException("Unexpected query type: " + queryNode.getClass());
}