}
private static Graph doGraphQuery(RepositoryConnection con, String query) throws RepositoryException, MalformedQueryException, QueryEvaluationException {
GraphQuery resultsTable = con.prepareGraphQuery(QueryLanguage.SPARQL, query);
GraphQueryResult statements = resultsTable.evaluate();
Graph g = new GraphImpl();
Vector<Value[]> results = new Vector<Value[]>();
for (int row = 0; statements.hasNext(); row++) {
Statement pairs = statements.next();
g.add(pairs);
// List<String> names = statements.getBindingNames();
// Value[] rv = new Value[names.size()];
// for (int i = 0; i < names.size(); i++) {
// String name = names.get(i);
// Value value = pairs.getValue(name);