public static Binding asBinding(final QuerySolution map){
  if (map != null) {
    BindingHashMap result=new BindingHashMap();
    Iterator<String> varNames=map.varNames();
    while (varNames.hasNext()) {
      String varName=varNames.next();
      RDFNode node=map.get(varName);
      if (node != null) {
        result.add(Var.alloc(varName),node.asNode());
      }
    }
    return result;
  }
 else {
    return null;
  }
}

public static Binding asBinding ( final QuerySolution map ) { if ( map != null ) { BindingHashMap result = new BindingHashMap ( ) ; Iterator < String > varNames = map . varNames ( ) ; while ( varNames . hasNext ( ) ) { String varName = varNames . next ( ) ; RDFNode node = map . get ( varName ) ; if ( node != null ) { result . add ( Var . alloc ( varName ) , node . asNode ( ) ) ; } } return result ; } else { return null ; } }
turns a querysolution into a binding .
