jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1175530 - in /incubator/jena/Jena2/ARQ/trunk: src-test/com/hp/hpl/jena/sparql/expr/ src-test/com/hp/hpl/jena/sparql/junit/ src-test/com/hp/hpl/jena/sparql/resultset/ src/arq/ src/com/hp/hpl/jena/sparql/core/ src/com/hp/hpl/jena/sparql/engi...
Date Sun, 25 Sep 2011 19:11:53 GMT
Author: andy
Date: Sun Sep 25 19:11:52 2011
New Revision: 1175530

URL: http://svn.apache.org/viewvc?rev=1175530&view=rev
Log:
JENA-121
Interface for BindingMap (mutating operations)

Added:
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingHashMap.java
      - copied, changed from r1175418, incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java
  (with props)
Modified:
    incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/expr/TestExpressions.java
    incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/junit/TestExpr.java
    incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSet.java
    incubator/jena/Jena2/ARQ/trunk/src/arq/qexpr.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/core/ResultBinding.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding0.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding1.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingBase.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingFactory.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingProjectBase.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingUtils.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterCommonParent.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/graph/Reifier2.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/pfunction/library/splitIRI.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/JSONInput.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/SortedResultSet.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputSAX.java
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputStAX.java

Modified: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/expr/TestExpressions.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/expr/TestExpressions.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/expr/TestExpressions.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/expr/TestExpressions.java
Sun Sep 25 19:11:52 2011
@@ -380,7 +380,7 @@ public class TestExpressions
     static String xsd = XSDDatatype.XSD+"#" ;
     static Binding env ; 
     static {
-        BindingMap b = new BindingMap() ;
+        BindingMap b = BindingFactory.create() ;
         b.add(Var.alloc("a"), Node.createLiteral("A")) ;
         b.add(Var.alloc("b"), Node.createAnon()) ;
         b.add(Var.alloc("x"), Node.createURI("urn:x")) ;

Modified: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/junit/TestExpr.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/junit/TestExpr.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/junit/TestExpr.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/junit/TestExpr.java Sun
Sep 25 19:11:52 2011
@@ -15,7 +15,7 @@ import com.hp.hpl.jena.query.Query ;
 import com.hp.hpl.jena.query.QueryFactory ;
 import com.hp.hpl.jena.query.QueryParseException ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
 import com.hp.hpl.jena.sparql.expr.NodeValue ;
 import com.hp.hpl.jena.sparql.function.FunctionEnv ;
@@ -69,7 +69,7 @@ public abstract class TestExpr extends T
             queryCxt = QueryFactory.make() ;
         query = queryCxt ;
         if ( env == null )
-            env = new BindingMap() ;
+            env = BindingFactory.create() ;
         binding = env ;
         this.failureMode = failureOutcome ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSet.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSet.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSet.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src-test/com/hp/hpl/jena/sparql/resultset/TestResultSet.java
Sun Sep 25 19:11:52 2011
@@ -26,6 +26,7 @@ import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
 import com.hp.hpl.jena.sparql.engine.ResultSetStream ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.engine.iterator.QueryIterPlainWrapper ;
 import com.hp.hpl.jena.sparql.engine.iterator.QueryIterSingleton ;
@@ -320,7 +321,7 @@ public class TestResultSet extends BaseT
     
     private ResultSet make(String var, Node val)
     {
-        BindingMap b = new BindingMap() ;
+        BindingMap b = BindingFactory.create() ;
         b.add(Var.alloc(var), val) ;
         List<String> vars = new ArrayList<String>() ;
         vars.add(var) ;
@@ -331,9 +332,9 @@ public class TestResultSet extends BaseT
 
     private ResultSet make2(String var, Node val)
     {
-        BindingMap b1 = new BindingMap() ;
+        BindingMap b1 = BindingFactory.create() ;
         b1.add(Var.alloc(var), val) ;
-        BindingMap b2 = new BindingMap() ;
+        BindingMap b2 = BindingFactory.create() ;
         b2.add(Var.alloc(var), val) ;
         
         List<String> vars = new ArrayList<String>() ;
@@ -365,7 +366,7 @@ public class TestResultSet extends BaseT
     
     private ResultSet make(String var1, Node val1, String var2, Node val2 )
     {
-        BindingMap b = new BindingMap() ;
+        BindingMap b = BindingFactory.create() ;
         
         b.add(Var.alloc(var1), val1) ;
         b.add(Var.alloc(var2), val2) ;

Modified: incubator/jena/Jena2/ARQ/trunk/src/arq/qexpr.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/arq/qexpr.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/arq/qexpr.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/arq/qexpr.java Sun Sep 25 19:11:52 2011
@@ -9,6 +9,7 @@ package arq;
 import java.util.Iterator ;
 
 import org.openjena.atlas.io.IndentedWriter ;
+import org.openjena.atlas.logging.Log ;
 import arq.cmd.CmdException ;
 import arq.cmd.CmdUtils ;
 import arq.cmd.TerminationException ;
@@ -23,13 +24,12 @@ import com.hp.hpl.jena.shared.PrefixMapp
 import com.hp.hpl.jena.sparql.ARQConstants ;
 import com.hp.hpl.jena.sparql.core.Prologue ;
 import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
 import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
 import com.hp.hpl.jena.sparql.expr.NodeValue ;
 import com.hp.hpl.jena.sparql.function.FunctionEnv ;
 import com.hp.hpl.jena.sparql.sse.WriterSSE ;
-import org.openjena.atlas.logging.Log ;
 import com.hp.hpl.jena.sparql.util.ExprUtils ;
 import com.hp.hpl.jena.sparql.util.FmtUtils ;
 import com.hp.hpl.jena.sparql.util.NodeFactory ;
@@ -171,7 +171,7 @@ public class qexpr
                 try {
                     if ( actionCopySubstitute )
                     {
-                        Expr e = expr.copySubstitute(new BindingMap(), true) ;
+                        Expr e = expr.copySubstitute(BindingFactory.create(), true) ;
                         System.out.println(e) ;
                     }
                     else

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/core/ResultBinding.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/core/ResultBinding.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/core/ResultBinding.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/core/ResultBinding.java Sun
Sep 25 19:11:52 2011
@@ -35,7 +35,7 @@ public class ResultBinding extends Query
 //    private ResultBinding( Model _model )
 //    {
 //        model = _model ;
-//        binding = new BindingMap() ;
+//        binding = BindingFactory.create() ;
 //    }
     
     @Override

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding.java
Sun Sep 25 19:11:52 2011
@@ -14,9 +14,6 @@ import com.hp.hpl.jena.sparql.core.Var ;
 
 public interface Binding
 {
-//    /** Add a (var, value) pair- the value must not be null */
-//    public void add(Var var, Node node) ;
-
     /** Iterate over all variables of this binding. */
     public Iterator<Var> vars() ;
 
@@ -32,7 +29,6 @@ public interface Binding
     /** Is this an empty binding?  No variables. */
     public boolean isEmpty() ;
 
-//    public void addAll(Binding key) ;
 }
 
 /*

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding0.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding0.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding0.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding0.java
Sun Sep 25 19:11:52 2011
@@ -20,12 +20,6 @@ public class Binding0 extends BindingBas
     /* package */ Binding0() { super(null) ; }
     /* package */ Binding0(Binding parent) { super(parent) ; }
 
-    @Override
-    protected void add1(Var var, Node node)
-    {
-        throw new UnsupportedOperationException("Binding0.add1") ;
-    }
-    
     /** Iterate over all the names of variables.
      */
     @Override
@@ -42,9 +36,6 @@ public class Binding0 extends BindingBas
     
     @Override
     public Node get1(Var var) { return null ; }
-
-    @Override
-    protected void checkAdd1(Var var, Node node) { }
 }
 
 /*

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding1.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding1.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding1.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/Binding1.java
Sun Sep 25 19:11:52 2011
@@ -24,18 +24,11 @@ public class Binding1 extends BindingBas
     /*package*/ Binding1(Binding parent, Var _var, Node _node)
     { 
         super(parent) ;
-        checkAdd1(_var, _node) ;
         var = _var ; 
         value = _node ;
     }
     
     @Override
-    protected void add1(Var v, Node node)
-    {
-        throw new UnsupportedOperationException("Binding1.add1") ;
-    }
-
-    @Override
     protected int size1() { return 1 ; }
     
     @Override
@@ -62,9 +55,6 @@ public class Binding1 extends BindingBas
             return value ;
         return null ;
     }
-
-    @Override
-    protected void checkAdd1(Var v, Node val) { }
 }
 
 /*

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingBase.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingBase.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingBase.java
Sun Sep 25 19:11:52 2011
@@ -11,14 +11,19 @@ import java.util.Iterator ;
 import org.openjena.atlas.iterator.IteratorConcat ;
 
 import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
 import com.hp.hpl.jena.sparql.core.Var ;
 
 import org.openjena.atlas.lib.Lib ;
-import org.openjena.atlas.logging.Log ;
 import com.hp.hpl.jena.sparql.util.FmtUtils ;
 
-/** Machinary encapsulating a mapping from a name to a value. */
+
+/** Machinary encapsulating a mapping from a name to a value.
+ *  The "parent" is a shared, immutable, common set of bindings.
+ *  An association of var/node must not override a setting in the parent.
+ *  
+ *  @see BindingFactory
+ *  @see BindingMap for mutable bindings.
+ */
 
 
 abstract public class BindingBase implements Binding
@@ -51,31 +56,6 @@ abstract public class BindingBase implem
         
     public Binding getParent() { return parent ; }
     
-    /** Add a (var,value) - the node value is never null */
-    final public void add(Var var, Node node)
-    { 
-        if ( node == null )
-        {
-            Log.warn(this, "Binding.add: null value - ignored") ;
-            return ;
-        }
-        checkAdd(var, node) ;
-        add1(var, node) ;
-    }
-
-    protected abstract void add1(Var name, Node node) ;
-
-    public void addAll(Binding other)
-    {
-        Iterator<Var> iter = other.vars() ;
-        for ( ; iter.hasNext(); )
-        {
-            Var v = iter.next();
-            Node n = other.get(v) ;
-            add(v, n) ;
-        }
-    }
-    
     /** Iterate over all the names of variables. */
     final public Iterator<Var> vars()
     {
@@ -184,24 +164,6 @@ abstract public class BindingBase implem
         return sbuff.toString() ;
     }
 
-    private void checkAdd(Var var, Node node)
-    {
-        if ( ! CHECKING )
-            return ;
-        if ( var == null )
-            throw new ARQInternalErrorException("check("+var+", "+node+"): null var" ) ;
-        if ( node == null )
-            throw new ARQInternalErrorException("check("+var+", "+node+"): null node value"
) ;
-        if ( UNIQUE_NAMES_CHECK && contains(var) )
-            throw new ARQInternalErrorException("Attempt to reassign '"+var+
-                                                "' from '"+FmtUtils.stringForNode(get(var))+
-                                                "' to '"+FmtUtils.stringForNode(node)+"'")
;
-        // Let the implementation do a check as well.
-        checkAdd1(var, node) ;
-    }
-
-    protected abstract void checkAdd1(Var var, Node node) ;
-    
     @Override
     public int hashCode() { return hashCode(this) ; } 
     @Override

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingFactory.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingFactory.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingFactory.java
Sun Sep 25 19:11:52 2011
@@ -30,7 +30,7 @@ public class BindingFactory
     }
     
     public static BindingMap create() { return create(noParent) ; }
-    public static BindingMap create(Binding parent) { return new BindingMap(parent)  ; }
+    public static BindingMap create(Binding parent) { return new BindingHashMap(parent) 
; }
 }
 
 /*

Copied: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingHashMap.java
(from r1175418, incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java)
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingHashMap.java?p2=incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingHashMap.java&p1=incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java&r1=1175418&r2=1175530&rev=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingHashMap.java
Sun Sep 25 19:11:52 2011
@@ -9,29 +9,31 @@ import java.util.HashMap ;
 import java.util.Iterator ;
 import java.util.Map ;
 
+import org.openjena.atlas.logging.Log ;
+
 import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
 import com.hp.hpl.jena.sparql.core.Var ;
+import com.hp.hpl.jena.sparql.util.FmtUtils ;
 
-
-/** A mapping from a name to a value such that we can create a tree of levels
+/** A muatable mapping from a name to a value such that we can create a tree of levels
  *  with higher (earlier levels) being shared.
  *  Looking up a name is done by looking in the current level,
  *  then trying the parent is not found. */
 
-
-public class BindingMap extends BindingBase
+public class BindingHashMap extends BindingBase implements BindingMap
 {
     // Bindings are often small.  Is this overkill? 
     Map<Var, Node> map = new HashMap<Var, Node>() ;
     
     /** Using BindingFactory.create is better */
-    public BindingMap(Binding parent) { super(parent) ; }
+    public BindingHashMap(Binding parent) { super(parent) ; }
     /** Using BindingFactory.create is better */
-    public BindingMap() { super(BindingRoot.create()) ; } // null?
+    public BindingHashMap() { super(BindingRoot.create()) ; } // null?
 
     /** Add a (name,value) */
     
-    @Override
+    //@Override
     protected void add1(Var var, Node node)
     {
         if ( ! Var.isAnonVar(var) )
@@ -66,7 +68,49 @@ public class BindingMap extends BindingB
         return map.get(var) ;
     }
 
-    @Override
+    /** Add a (var,value) - the node value is never null */
+    //@Override
+    final public void add(Var var, Node node)
+    { 
+        if ( node == null )
+        {
+            Log.warn(this, "Binding.add: null value - ignored") ;
+            return ;
+        }
+        checkAdd(var, node) ;
+        add1(var, node) ;
+    }
+
+    //@Override
+    final public void addAll(Binding other)
+    {
+        Iterator<Var> iter = other.vars() ;
+        for ( ; iter.hasNext(); )
+        {
+            Var v = iter.next();
+            Node n = other.get(v) ;
+            add(v, n) ;
+        }
+    }
+    
+    private void checkAdd(Var var, Node node)
+    {
+        if ( ! CHECKING )
+            return ;
+        if ( var == null )
+            throw new ARQInternalErrorException("check("+var+", "+node+"): null var" ) ;
+        if ( node == null )
+            throw new ARQInternalErrorException("check("+var+", "+node+"): null node value"
) ;
+        if ( UNIQUE_NAMES_CHECK && contains(var) )
+            throw new ARQInternalErrorException("Attempt to reassign '"+var+
+                                                "' from '"+FmtUtils.stringForNode(get(var))+
+                                                "' to '"+FmtUtils.stringForNode(node)+"'")
;
+        // Let the implementation do a check as well.
+        checkAdd1(var, node) ;
+    }
+
+
+    //@Override
     protected void checkAdd1(Var v, Node node) { }
 }
 

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMap.java
Sun Sep 25 19:11:52 2011
@@ -1,98 +1,39 @@
-/*
- * (c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company,
LP
- * [See end of file]
- */
-
-package com.hp.hpl.jena.sparql.engine.binding;
-
-import java.util.HashMap ;
-import java.util.Iterator ;
-import java.util.Map ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.core.Var ;
-
-
-/** A mapping from a name to a value such that we can create a tree of levels
- *  with higher (earlier levels) being shared.
- *  Looking up a name is done by looking in the current level,
- *  then trying the parent is not found. */
-
-
-public class BindingMap extends BindingBase
-{
-    // Bindings are often small.  Is this overkill? 
-    Map<Var, Node> map = new HashMap<Var, Node>() ;
-    
-    /** Using BindingFactory.create is better */
-    public BindingMap(Binding parent) { super(parent) ; }
-    /** Using BindingFactory.create is better */
-    public BindingMap() { super(BindingRoot.create()) ; } // null?
-
-    /** Add a (name,value) */
-    
-    @Override
-    protected void add1(Var var, Node node)
-    {
-        if ( ! Var.isAnonVar(var) )
-            map.put(var, node) ;
-    }
-
-    @Override
-    protected int size1() { return map.size() ; }
-    
-    @Override
-    protected boolean isEmpty1() { return map.isEmpty() ; }
-    
-    /** Iterate over all the names of variables.
-     */
-    @Override
-    public Iterator<Var> vars1() 
-    {
-        // Assumes that varnames are NOT duplicated.
-        Iterator<Var> iter = map.keySet().iterator() ;
-        return iter ;
-    }
-    
-    @Override
-    public boolean contains1(Var var)
-    {
-        return map.containsKey(var) ;
-    }
-    
-    @Override
-    public Node get1(Var var)
-    {
-        return map.get(var) ;
-    }
-
-    @Override
-    protected void checkAdd1(Var v, Node node) { }
-}
-
-/*
- *  (c) Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company,
LP
- *  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.sparql.engine.binding;
+
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.sparql.core.Var ;
+
+/** Bindings are immutable, and are equal-by-value, but 
+ * they have to be constructed
+ * somehow and this interface captures that.
+ * Bindings should be created, then not changed, and 
+ * returned as type "Binding".  
+ */
+
+public interface BindingMap extends Binding
+{
+    /** Add a (var, value) pair- the value must not be null */
+    public void add(Var var, Node node) ;
+
+    /** Add all the (var, value) pairs from another binding */
+    public void addAll(Binding other) ;
+}
+

Added: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java?rev=1175530&view=auto
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java
(added)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java
Sun Sep 25 19:11:52 2011
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.sparql.engine.binding;
+
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.sparql.core.Var ;
+
+public interface BindingMutable extends Binding
+{
+    /** Add a (var, value) pair - the value must not be null */
+    public void add(Var var, Node node) ;
+
+    /** Add all the var/node pairs from another binding */ 
+    public void addAll(Binding key) ;
+}
+

Propchange: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingMutable.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingProjectBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingProjectBase.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingProjectBase.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingProjectBase.java
Sun Sep 25 19:11:52 2011
@@ -30,13 +30,13 @@ public abstract class BindingProjectBase
         binding = bind ;
     }
 
-    @Override
-    protected void add1(Var var, Node node)
-    { throw new UnsupportedOperationException("BindingProject.add1") ; }
-
-    @Override
-    protected void checkAdd1(Var var, Node node)
-    {}
+//    @Override
+//    protected void add1(Var var, Node node)
+//    { throw new UnsupportedOperationException("BindingProject.add1") ; }
+//
+//    @Override
+//    protected void checkAdd1(Var var, Node node)
+//    {}
 
     protected abstract boolean accept(Var var) ; 
     

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingUtils.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingUtils.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingUtils.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/binding/BindingUtils.java
Sun Sep 25 19:11:52 2011
@@ -45,7 +45,7 @@ public class BindingUtils
         if ( qSolution instanceof ResultBinding )
             // Only named variables.
             return new BindingProjectNamed( ((ResultBinding)qSolution).getBinding() ) ;
-        BindingMap binding = new BindingMap(null) ;
+        BindingMap binding = BindingFactory.create() ;
         addToBinding(binding, qSolution) ;
         return binding ;
     }

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterCommonParent.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterCommonParent.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterCommonParent.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/engine/iterator/QueryIterCommonParent.java
Sun Sep 25 19:11:52 2011
@@ -14,6 +14,7 @@ import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import org.openjena.atlas.logging.Log ;
 
@@ -41,7 +42,7 @@ public class QueryIterCommonParent exten
                 return b ;
         
             // This is the result.  Could have BindingBase.setParent etc.  
-            BindingMap b2 = new BindingMap(parentBinding) ;
+            BindingMap b2 = BindingFactory.create(parentBinding) ;
 
             // Copy the resultSet bindings to the combined result binding with checking.

             for ( Iterator<Var> iter = b.vars() ; iter.hasNext(); )

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/graph/Reifier2.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/graph/Reifier2.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/graph/Reifier2.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/graph/Reifier2.java Sun Sep
25 19:11:52 2011
@@ -35,6 +35,7 @@ import com.hp.hpl.jena.sparql.engine.Que
 import com.hp.hpl.jena.sparql.engine.QueryEngineRegistry ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingRoot ;
 import com.hp.hpl.jena.util.iterator.ExtendedIterator ;
@@ -114,7 +115,7 @@ public class Reifier2 implements Reifier
         
         if ( node != null || triple != null )
         {
-            BindingMap b2 = new BindingMap(b) ;
+            BindingMap b2 = BindingFactory.create(b) ;
             if ( node != null )
                 bind(b2, reifNodeVar, node) ; 
             if ( triple != null )

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/lang/ParserQueryBase.java Sun
Sep 25 19:11:52 2011
@@ -17,6 +17,7 @@ import com.hp.hpl.jena.query.Query ;
 import com.hp.hpl.jena.query.QueryParseException ;
 import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.modify.request.QuadAcc ;
 import com.hp.hpl.jena.sparql.modify.request.QuadDataAcc ;
@@ -156,7 +157,7 @@ public class ParserQueryBase extends Par
     
     protected void startBindingValueRow(int line, int col)
     { 
-        values.add(new BindingMap()) ;
+        values.add(BindingFactory.create()) ;
         currentColumn = -1 ;
     }
     

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/pfunction/library/splitIRI.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/pfunction/library/splitIRI.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/pfunction/library/splitIRI.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/pfunction/library/splitIRI.java
Sun Sep 25 19:11:52 2011
@@ -13,6 +13,7 @@ import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.pfunction.PropFuncArg ;
 import com.hp.hpl.jena.sparql.pfunction.PropFuncArgType ;
@@ -82,7 +83,7 @@ public class splitIRI extends PropertyFu
         // New binding to return.
         BindingMap b = null ;
         if ( Var.isVar(namespaceNode) || Var.isVar(localnameNode) )
-            b = new BindingMap(binding) ;
+            b = BindingFactory.create(binding) ;
         
         if ( Var.isVar(namespaceNode) ) // .isVariable() )
         {

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/JSONInput.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/JSONInput.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/JSONInput.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/JSONInput.java Sun
Sep 25 19:11:52 2011
@@ -42,6 +42,7 @@ import com.hp.hpl.jena.rdf.model.Model ;
 import com.hp.hpl.jena.sparql.core.ResultBinding ;
 import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.util.LabelToNodeMap ;
 import com.hp.hpl.jena.sparql.util.NodeFactory ;
@@ -281,7 +282,7 @@ public class JSONInput extends SPARQLRes
                 if (row < 0 || row >= jbindings.size())
                     return null;
                 
-                BindingMap binding = new BindingMap() ;
+                BindingMap binding = BindingFactory.create() ;
                 JsonObject jsolution = jbindings.get(row).getAsObject() ;
                 
                 for ( String varName : jsolution.keys() )  

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/SortedResultSet.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/SortedResultSet.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/SortedResultSet.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/SortedResultSet.java
Sun Sep 25 19:11:52 2011
@@ -22,6 +22,7 @@ import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.QueryIterator ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingComparator ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.engine.iterator.QueryIterPlainWrapper ;
 
@@ -111,7 +112,7 @@ public class SortedResultSet implements 
     
     private Binding copyToBinding(QuerySolution qs)
     {
-        BindingMap b = new BindingMap() ;
+        BindingMap b = BindingFactory.create() ;
         for ( Iterator<String> iter = qs.varNames() ; iter.hasNext() ; )
         {
             String varName = iter.next() ;

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputSAX.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputSAX.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputSAX.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputSAX.java Sun
Sep 25 19:11:52 2011
@@ -11,6 +11,7 @@ import java.io.InputStream ;
 import java.util.ArrayList ;
 import java.util.List ;
 
+import org.openjena.atlas.logging.Log ;
 import org.xml.sax.Attributes ;
 import org.xml.sax.ContentHandler ;
 import org.xml.sax.InputSource ;
@@ -26,9 +27,9 @@ import com.hp.hpl.jena.rdf.model.Model ;
 import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.ResultSetStream ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
 import com.hp.hpl.jena.sparql.engine.iterator.QueryIterPlainWrapper ;
-import org.openjena.atlas.logging.Log ;
 import com.hp.hpl.jena.sparql.util.FmtUtils ;
 import com.hp.hpl.jena.sparql.util.LabelToNodeMap ;
 import com.hp.hpl.jena.sparql.util.graph.GraphFactory ;
@@ -172,7 +173,7 @@ class XMLInputSAX extends SPARQLResult
             
             if ( localName.equals(XMLResults.dfSolution) )
             {
-                binding = new BindingMap() ; 
+                binding = BindingFactory.create() ; 
                 return ;
             }
             

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputStAX.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputStAX.java?rev=1175530&r1=1175529&r2=1175530&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputStAX.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/XMLInputStAX.java
Sun Sep 25 19:11:52 2011
@@ -20,6 +20,7 @@ import javax.xml.stream.XMLStreamReader 
 
 import org.openjena.atlas.lib.Closeable ;
 import org.openjena.atlas.lib.StrUtils ;
+import org.openjena.atlas.logging.Log ;
 
 import com.hp.hpl.jena.datatypes.RDFDatatype ;
 import com.hp.hpl.jena.datatypes.TypeMapper ;
@@ -33,8 +34,8 @@ import com.hp.hpl.jena.sparql.ARQConstan
 import com.hp.hpl.jena.sparql.core.ResultBinding ;
 import com.hp.hpl.jena.sparql.core.Var ;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
+import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
 import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
-import org.openjena.atlas.logging.Log ;
 import com.hp.hpl.jena.sparql.util.LabelToNodeMap ;
 import com.hp.hpl.jena.sparql.util.graph.GraphFactory ;
 
@@ -402,7 +403,7 @@ class XMLInputStAX extends SPARQLResult
     private Binding getOneSolution() throws XMLStreamException
     {
         // At the start of <result>
-        BindingMap binding = new BindingMap() ;
+        BindingMap binding = BindingFactory.create() ;
         String varName = null ;
         
         while(parser.hasNext())
@@ -427,7 +428,7 @@ class XMLInputStAX extends SPARQLResult
                     tag = parser.getLocalName() ;
                     if ( isTag(tag, XMLResults.dfSolution) )
                     {
-                        binding = new BindingMap() ;
+                        binding = BindingFactory.create() ;
                         break ;
                     }
                     if ( isTag(tag, XMLResults.dfBinding ))



Mime
View raw message