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());
} else if(nodeDef instanceof org.openrdf.model.Literal) {
org.openrdf.model.Literal nodeLiteral = (org.openrdf.model.Literal)nodeDef;
if(nodeLiteral.getLanguage() != null) {
node = new Literal(nodeLiteral.getLabel(), nodeLiteral.getLanguage());
} else if(nodeLiteral.getDatatype() != null) {