Query q = QueryFactory.create(query);
QueryExecution qe = QueryExecutionFactory.create(q, ModelFactory.createDefaultModel());
ResultSet rset = qe.execSelect();
Assert.assertTrue(rset.hasNext());
Binding b = rset.nextBinding();
Assert.assertFalse(rset.hasNext());
qe.close();
//Validate returned value
Node actual = b.get(Var.alloc("square"));