// TODO: check use of unbound variables?
TupleExpr tupleExpr = QueryModelBuilder.buildQueryModel(qc, new ValueFactoryImpl());
ASTQuery queryNode = qc.getQuery();
ParsedQuery query;
if (queryNode instanceof ASTTupleQuery) {
query = new ParsedTupleQuery(tupleExpr);
}
else if (queryNode instanceof ASTGraphQuery) {
query = new ParsedGraphQuery(tupleExpr, namespaces);
}
else {
throw new RuntimeException("Unexpected query type: " + queryNode.getClass());
}
return query;
}
catch (ParseException e) {