for(BindingSet nextRow : results.getBindingSets()) {
Map<String,RDFNode> row = new HashMap<String, RDFNode>();
for(String nextBindingName : fieldNames) {
if(nextRow.hasBinding(nextBindingName)) {
Binding nextBinding = nextRow.getBinding(nextBindingName);
//Map<String,String> nodeDef = (Map<String,String>) entry.getValue();
Value nodeDef = nextBinding.getValue();
RDFNode node = null;
if(nodeDef instanceof org.openrdf.model.URI) {
node = new URI(nodeDef.stringValue());
} else if(nodeDef instanceof org.openrdf.model.BNode) {
node = new BNode(((org.openrdf.model.BNode)nodeDef).getID());