jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [26/51] [partial] jena git commit: Rename com.hp.hpl.jena.* as org.apache.jena.*
Date Thu, 23 Apr 2015 19:56:42 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprDigest.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprDigest.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprDigest.java
deleted file mode 100644
index dca91c5..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprDigest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.expr;
-
-import java.security.MessageDigest ;
-import java.security.NoSuchAlgorithmException ;
-
-import org.apache.jena.atlas.lib.Bytes ;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-
-public abstract class ExprDigest extends ExprFunction1
-{
-    private final String digestName ;
-    private MessageDigest digestCache ;
-
-    public ExprDigest(Expr expr, String symbol, String digestName)
-    {
-        super(expr, symbol) ;
-        this.digestName = digestName ; 
-        try
-        {
-            digestCache = MessageDigest.getInstance(digestName) ;
-        } catch (NoSuchAlgorithmException e)
-        {
-            throw new ARQInternalErrorException("Digest not provided in this Java system: "+digestName) ;
-        }
-    }
-
-    // Each digest expr function is unique 
-    // Pool needs to be static and per-digest-type
-
-//    private Pool<MessageDigest> pool = PoolSync.create(new PoolBase<MessageDigest>()) ;
-//    private MessageDigest getDigest()
-//    {
-//        MessageDigest md = pool.get() ;
-//        if ( md == null )
-//        {
-//            synchronized (pool)
-//            {
-//                md = pool.get() ;
-//                if ( md == null )
-//                {
-//                    md = createDigest() ;
-//                    pool.put(md) ;
-//                }
-//            }
-//        }
-//        return md ;
-//    }
-    
-    private MessageDigest getDigest()
-    {
-        if ( digestCache != null )
-        {
-            MessageDigest digest2 = null ;
-            try {
-                digest2 = (MessageDigest)digestCache.clone() ;
-                return digest2 ;
-            } catch (CloneNotSupportedException ex)
-            {
-                // Can't clone - remove cache copy.
-                digestCache = null ;
-            }
-        }
-        return createDigest() ;
-    }
-    
-    private MessageDigest createDigest()
-    {
-        try { return MessageDigest.getInstance(digestName) ; }
-        catch (Exception ex2) { throw new ARQInternalErrorException(ex2) ; } 
-    }
-    
-    NodeValue lastSeen = null ;
-    NodeValue lastCalc = null ;
-    
-    @Override
-    public NodeValue eval(NodeValue v)
-    {
-        if ( lastSeen != null && lastSeen.equals(v) )
-            return lastCalc ;
-        
-        Node n = v.asNode() ;
-        if ( ! n.isLiteral() )
-            throw new ExprEvalException("Not a literal: "+v) ;
-        if ( n.getLiteralLanguage() != null && ! n.getLiteralLanguage().equals("") )
-            throw new ExprEvalException("Can't make a digest of an RDF term with a language tag") ; 
-        // Literal, no language tag.
-        if ( n.getLiteralDatatype() != null && ! XSDDatatype.XSDstring.equals(n.getLiteralDatatype()) )
-            throw new ExprEvalException("Not a simple literal nor an XSD string") ;
-        
-        try { 
-            MessageDigest digest = getDigest() ;
-            String x = n.getLiteralLexicalForm() ;
-            byte b[] = x.getBytes("UTF-8") ;
-            byte d[] = digest.digest(b) ;
-            String y = Bytes.asHexLC(d) ;
-            NodeValue result = NodeValue.makeString(y) ;
-            
-            // Cache
-            lastSeen = v ;
-            lastCalc = result ;
-            
-            return result ;
-            
-        } catch (Exception ex2) { throw new ARQInternalErrorException(ex2) ; } 
-        
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalException.java
deleted file mode 100644
index 4e62263..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.expr;
-
-/** Exception for a dynamic evaluation exception.
- *  The current solution is likely to be rejected.
- *  See also QueryFatalException which aborts the whole query execution. */
-
-public class ExprEvalException extends ExprException
-{
-    public ExprEvalException() { super() ; }
-    public ExprEvalException(Throwable cause) { super(cause) ; }
-    public ExprEvalException(String msg) { super(msg) ; }
-    public ExprEvalException(String msg, Throwable cause) { super(msg, cause) ; }
-
-    private static final long serialVersionUID = 1L; // Unused
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalTypeException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalTypeException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalTypeException.java
deleted file mode 100644
index a3651b2..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprEvalTypeException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.expr;
-
-/** Exception for a dynamic evaluation exception due to wrong type. */
-
-public class ExprEvalTypeException extends ExprEvalException
-{
-    public ExprEvalTypeException() { super() ; }
-    public ExprEvalTypeException(Throwable cause) { super(cause) ; }
-    public ExprEvalTypeException(String msg) { super(msg) ; }
-    public ExprEvalTypeException(String msg, Throwable cause) { super(msg, cause) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprException.java
deleted file mode 100644
index afd98aa..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.expr;
-import com.hp.hpl.jena.query.QueryException ;
-
-/** The root of all expression exceptions */
-
-public class ExprException extends QueryException
-{
-    public ExprException() { super() ; }
-    public ExprException(Throwable cause) { super(cause) ; }
-    public ExprException(String msg) { super(msg) ; }
-    public ExprException(String msg, Throwable cause) { super(msg, cause) ; }
-    
-    private static final long serialVersionUID = 1L; // Unused
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction.java
deleted file mode 100644
index 8bf2aee..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.ArrayList ;
-import java.util.List ;
-
-import org.apache.jena.atlas.lib.Lib ;
-
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-
-/** A function in the expression hierarchy.
- *  Everything that is evaluable (i.e. not NodeValue, NodeVar) is a function).
- *  It is useful to distinguish between values, vars and functions.
- *  The exists operations (which take a op, not arguments) are functions of zero arguments.
- */
- 
-public abstract class ExprFunction extends ExprNode
-{
-    protected FunctionLabel funcSymbol ;
-    protected String opSign ;
-    private List<Expr> argList = null ;
-    
-    protected ExprFunction(String fName)
-    {
-        funcSymbol = new FunctionLabel(fName) ;
-        opSign = null ;
-    }
-
-    protected ExprFunction(String fName, String opSign)
-    {
-        this(fName) ;
-        this.opSign = opSign ;
-    }
-
-    public abstract Expr getArg(int i) ;
-    public abstract int numArgs() ;
-
-    // ExprFunctionN overrides this.
-    public List<Expr> getArgs()
-    {
-        if ( argList != null )
-            return argList ; 
-        argList = new ArrayList<>() ;
-        for ( int i = 1 ; i <= numArgs() ; i++ )
-            argList.add(this.getArg(i)) ;
-        return argList ;        
-    }
-
-    @Override
-    public boolean isFunction()        { return true ; }
-    @Override
-    public ExprFunction getFunction()  { return this ; }
-    
-    @Override
-    public int hashCode()
-    {
-        return funcSymbol.hashCode() ^ numArgs() ;
-    }
-    
-    // A function is equal if:
-    // + The name is the same
-    // + The arguments are the same (including arity).
-    
-    @Override
-    public boolean equals(Object other)
-    {
-        if ( this == other ) return true ;
-
-        if ( ! other.getClass().equals(this.getClass()) )
-            return false ;
-        
-        ExprFunction ex = (ExprFunction)other ;
-        
-        if ( ! funcSymbol.equals(ex.funcSymbol) )
-            return false ;
-        
-        if ( numArgs() != ex.numArgs() )
-            return false ;
-        
-        // Arguments are 1, 2, 3, ...
-        for ( int i = 1 ; i <= numArgs() ; i++ )
-        {
-            Expr a1 = this.getArg(i) ;
-            Expr a2 = ex.getArg(i) ;
-            if ( ! Lib.equal(a1, a2) )
-                return false ;
-        }
-        return true ;
-    }
-    
-    /** Name used for output in SPARQL format needing functional form (no specific keyword).
-     *  e.g. regexp(), custom functions, ...
-     */
-    
-    public String getFunctionPrintName(SerializationContext cxt)
-    { return funcSymbol.getSymbol() ; }
-
-    /** Name used in a functional form (i.e. SPARQL algebra).
-     *  getOpName() is used in preference as a short, symbol name.
-     */
-    public String getFunctionName(SerializationContext cxt)
-    { return funcSymbol.getSymbol() ; }
-    
-    /** Used to get a unique name for the function, which is intern'ed.  Used in hashCode() */ 
-    public FunctionLabel getFunctionSymbol()
-    { return funcSymbol ; }
-
-    /** URI for this function, whether custom or specification defined URI (these are keywords in the language) */  
-    public String getFunctionIRI() { return null ; }
-
-    /** Get the symbol name (+, ! etc) for this function -- maybe null for none */
-    public String getOpName()
-    { return opSign ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction0.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction0.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction0.java
deleted file mode 100644
index 3795c28..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction0.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-
-/** An expression that is constant (does not depend on evaluating a sub expression). */
-
-public abstract class ExprFunction0 extends ExprFunction
-{
-    protected ExprFunction0(String fName) { this(fName, null) ; }
-    
-    protected ExprFunction0(String fName, String opSign)
-    {
-        super(fName, opSign) ;
-    }
-
-    @Override
-    public Expr getArg(int i)       { return null ; }
-    
-    @Override
-    public int hashCode()           { return getFunctionSymbol().hashCode() ; }
-
-    @Override
-    public int numArgs()            { return 0 ; }
-    
-    // ---- Evaluation
-    
-    @Override
-    final public NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        return eval(env) ;
-    }
-   
-    public abstract NodeValue eval(FunctionEnv env)  ;
-    
-    @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
-    {
-        // Nothing to transform. 
-        return copy() ;
-    }
-    
-    public abstract Expr copy() ;
-    
-    @Override
-    final public Expr copySubstitute(Binding binding)
-    {
-        return copy() ;
-    }
-    
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform) { return transform.transform(this) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction1.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction1.java
deleted file mode 100644
index c5390ec..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction1.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.expr;
-
-import org.apache.jena.atlas.lib.Lib ;
-
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-
-/** A function that has a single argument */
- 
-public abstract class ExprFunction1 extends ExprFunction
-{
-    protected final Expr expr ;
-
-    protected ExprFunction1(Expr expr, String fName) { this(expr, fName, null) ; }
-    
-    protected ExprFunction1(Expr expr, String fName, String opSign)
-    {
-        super(fName, opSign) ;
-        this.expr = expr ;
-    }
-
-    public Expr getArg() { return expr ; }
-
-    @Override
-    public Expr getArg(int i)
-    {
-        if ( i == 1 )
-            return expr ; 
-        return null ;
-    }
-    
-    @Override
-    public int hashCode()
-    {
-        return getFunctionSymbol().hashCode() ^ Lib.hashCodeObject(expr) ;
-    }
-
-    @Override
-    public int numArgs() { return 1 ; }
-    
-    // ---- Evaluation
-    
-    @Override
-    final public NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        NodeValue s = evalSpecial(binding, env) ;
-        if ( s != null )
-            return s ;
-        
-        NodeValue x = eval(binding, env, expr) ;
-        return eval(x, env) ;
-    }
-    
-    // Ideally, we would only have the FunctionEnv form but that break compatibility. 
-    public NodeValue eval(NodeValue v, FunctionEnv env) { return eval(v) ; }
-    public abstract NodeValue eval(NodeValue v) ;
-    
-    // Allow special cases.
-    protected NodeValue evalSpecial(Binding binding, FunctionEnv env) { return null ; } 
-    
-    @Override
-    final public Expr copySubstitute(Binding binding)
-    {
-        Expr e = (expr == null ? null : expr.copySubstitute(binding)) ;
-        return copy(e) ;
-    }
-
-    @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
-    {
-        Expr e = (expr == null ? null : expr.applyNodeTransform(transform)) ;
-        return copy(e) ;
-    }
-    
-    public abstract Expr copy(Expr expr) ;
-    
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform, Expr sub) { return transform.transform(this, sub) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction2.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction2.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction2.java
deleted file mode 100644
index 58aa0a4..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction2.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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.expr;
-
-import org.apache.jena.atlas.lib.Lib ;
-
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-
-
-/** A function of two arguments */
- 
-public abstract class ExprFunction2 extends ExprFunction
-{
-    protected final Expr expr1 ;
-    protected final Expr expr2 ;
-
-    protected ExprFunction2(Expr expr1, Expr expr2, String fName) { this(expr1, expr2, fName, null) ; }
-    
-    protected ExprFunction2(Expr expr1, Expr expr2, String fName, String opSign)
-    {
-        super(fName, opSign) ;
-        this.expr1 = expr1 ;
-        this.expr2 = expr2 ;
-    }
-    
-    public Expr getArg1() { return expr1 ; }
-    public Expr getArg2() { return expr2 ; }
-    
-    @Override
-    public Expr getArg(int i)
-    {
-        if ( i == 1 )
-            return expr1 ; 
-        if ( i == 2 )
-            return expr2 ; 
-        return null ;
-    }
-    
-    @Override
-    public int numArgs() { return 2 ; }
-    
-    // ---- Evaluation
-    
-    @Override
-    public int hashCode()
-    {
-        return getFunctionSymbol().hashCode() ^
-                Lib.hashCodeObject(expr1) ^
-                Lib.hashCodeObject(expr2) ;
-    }
-
-    @Override
-    final public NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        NodeValue s = evalSpecial(binding, env) ;
-        if ( s != null )
-            return s ;
-        
-        NodeValue x = eval(binding, env, expr1) ;
-        NodeValue y = eval(binding, env, expr2) ;
-        return eval(x, y, env) ;
-    }
-    
-    /** Special form evaluation (example, don't eval the arguments first) */
-    protected NodeValue evalSpecial(Binding binding, FunctionEnv env) { return null ; } 
-    
-    public NodeValue eval(NodeValue x, NodeValue y, FunctionEnv env) { return eval(x,y) ; }
-
-    public abstract NodeValue eval(NodeValue x, NodeValue y) ; 
-
-    @Override
-    final public Expr copySubstitute(Binding binding)
-    {
-        Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding)) ;
-        Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding)) ;
-        return copy(e1, e2) ;
-    }
-    
-
-    @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
-    {
-        Expr e1 = (expr1 == null ? null : expr1.applyNodeTransform(transform)) ;
-        Expr e2 = (expr2 == null ? null : expr2.applyNodeTransform(transform)) ;
-        return copy(e1, e2) ;
-    }
-
-
-    public abstract Expr copy(Expr arg1, Expr arg2) ;
-
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform, Expr arg1, Expr arg2) { return transform.transform(this, arg1, arg2) ; }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction3.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction3.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction3.java
deleted file mode 100644
index fa5fd15..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunction3.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.expr;
-
-import org.apache.jena.atlas.lib.Lib ;
-
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-
-
-/** A function of three arguments */
- 
-public abstract class ExprFunction3 extends ExprFunction
-{
-    protected final Expr expr1 ;
-    protected final Expr expr2 ;
-    protected final Expr expr3 ;
-
-    protected ExprFunction3(Expr expr1, Expr expr2, Expr expr3, String fName) { this(expr1, expr2, expr3, fName, null) ; }
-    
-    protected ExprFunction3(Expr expr1, Expr expr2, Expr expr3, String fName, String opSign)
-    {
-        super(fName, opSign) ;
-        this.expr1 = expr1 ;
-        this.expr2 = expr2 ;
-        this.expr3 = expr3 ;
-    }
-    
-    public Expr getArg1() { return expr1 ; }
-    public Expr getArg2() { return expr2 ; }
-    public Expr getArg3() { return expr3 ; }
-    
-    @Override
-    public Expr getArg(int i)
-    {
-        if ( i == 1 )
-            return expr1 ; 
-        if ( i == 2 )
-            return expr2 ; 
-        if ( i == 3 )
-            return expr3 ; 
-        return null ;
-    }
-    
-    @Override
-    public int numArgs() { return 3 ; }
-    
-    // ---- Evaluation
-    
-    @Override
-    public int hashCode()
-    {
-        return getFunctionSymbol().hashCode() ^
-               Lib.hashCodeObject(expr1) ^
-               Lib.hashCodeObject(expr2) ^
-               Lib.hashCodeObject(expr3) ;
-    }
-
-    @Override
-    final public NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        NodeValue s = evalSpecial(binding, env) ;
-        if ( s != null )
-            return s ;
-        
-        NodeValue x = eval(binding, env, expr1) ;
-        NodeValue y = eval(binding, env, expr2) ;
-        NodeValue z = eval(binding, env, expr3) ;
-        return eval(x, y, z, env) ;
-    }
-    
-    /** Special form evaluation (example, don't eval the arguments first) */
-    protected NodeValue evalSpecial(Binding binding, FunctionEnv env) { return null ; } 
-    
-    public NodeValue eval(NodeValue x, NodeValue y, NodeValue z, FunctionEnv env) { return eval(x,y, z) ; }
-
-    public abstract NodeValue eval(NodeValue x, NodeValue y, NodeValue z) ; 
-
-    // ---- Duplication
-    
-    @Override
-    final public Expr copySubstitute(Binding binding)
-    {
-        Expr e1 = (expr1 == null ? null : expr1.copySubstitute(binding)) ;
-        Expr e2 = (expr2 == null ? null : expr2.copySubstitute(binding)) ;
-        Expr e3 = (expr3 == null ? null : expr3.copySubstitute(binding)) ;
-        return copy(e1, e2, e3) ;
-    }
-    
-
-    @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
-    {
-        Expr e1 = (expr1 == null ? null : expr1.applyNodeTransform(transform)) ;
-        Expr e2 = (expr2 == null ? null : expr2.applyNodeTransform(transform)) ;
-        Expr e3 = (expr3 == null ? null : expr3.applyNodeTransform(transform)) ;
-        return copy(e1, e2, e3) ;
-    }
-
-    public abstract Expr copy(Expr arg1, Expr arg2, Expr arg3) ;
-    
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform, Expr arg1, Expr arg2, Expr arg3) { return transform.transform(this, arg1, arg2, arg3) ; }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java
deleted file mode 100644
index 2fdf939..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.ArrayList ;
-import java.util.List ;
-
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-
-/** A function which takes N arguments (N may be variable e.g. regex) */
- 
-public abstract class ExprFunctionN extends ExprFunction
-{
-    protected ExprList args = null ;
-    
-    protected ExprFunctionN(String fName, Expr... args)
-    {
-        this(fName, argList(args)) ;
-    }
-    
-    protected ExprFunctionN(String fName, ExprList args)
-    {
-        super(fName) ;
-        this.args = args ;
-    }
-
-    private static ExprList argList(Expr[] args)
-    {
-        ExprList exprList = new ExprList() ;
-        for ( Expr e : args )
-            if ( e != null )
-                exprList.add(e) ;
-        return exprList ;
-    }
-
-
-    @Override
-    public Expr getArg(int i)
-    {
-        i = i-1 ;
-        if ( i >= args.size() )
-            return null ;
-        return args.get(i) ;
-    }
-
-    @Override
-    public int numArgs() { return args.size() ; }
-    
-    @Override
-    public List<Expr> getArgs() { return args.getList() ; }
-
-    @Override
-    public Expr copySubstitute(Binding binding)
-    {
-        ExprList newArgs = new ExprList() ;
-        for ( int i = 1 ; i <= numArgs() ; i++ )
-        {
-            Expr e = getArg(i) ;
-            e = e.copySubstitute(binding) ;
-            newArgs.add(e) ;
-        }
-        return copy(newArgs);
-    }
-
-    @Override
-    public Expr applyNodeTransform(NodeTransform transform)
-    {
-        ExprList newArgs = new ExprList() ;
-        for ( int i = 1 ; i <= numArgs() ; i++ )
-        {
-            Expr e = getArg(i) ;
-            e = e.applyNodeTransform(transform) ;
-            newArgs.add(e) ;
-        }
-        return copy(newArgs) ;
-    }
-    
-    /** Special form evaluation (example, don't eval the arguments first) */
-    protected NodeValue evalSpecial(Binding binding, FunctionEnv env) { return null ; }
-
-    @Override
-    final public NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        NodeValue s = evalSpecial(binding, env) ;
-        if ( s != null )
-            return s ;
-        
-        List<NodeValue> argsEval = new ArrayList<>() ;
-        for ( int i = 1 ; i <= numArgs() ; i++ )
-        {
-            NodeValue x = eval(binding, env, getArg(i)) ;
-            argsEval.add(x) ;
-        }
-        return eval(argsEval, env) ;
-    }
-    
-    public NodeValue eval(List<NodeValue> args, FunctionEnv env) { return eval(args) ; }
-
-    public abstract NodeValue eval(List<NodeValue> args) ;
-
-    public abstract Expr copy(ExprList newArgs) ;
-    
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform, ExprList exprList) { return transform.transform(this, exprList) ; }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionOp.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionOp.java
deleted file mode 100644
index 319b7b9..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionOp.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-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.iterator.QueryIterSingleton ;
-import com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCheck ;
-import com.hp.hpl.jena.sparql.engine.main.QC ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.syntax.Element ;
-
-
-/** A "function" that executes over a pattern */
- 
-public abstract class ExprFunctionOp extends ExprFunction
-{
-    private final Op op ;
-    private Op opRun = null ;
-    private final Element element ;
-    
-    protected ExprFunctionOp(String fName, Element el, Op op)
-    {
-        super(fName) ;
-        this.op = op ;
-        this.element = el ;
-    }
-
-    @Override
-    public Expr getArg(int i)
-    {
-        return null ;
-    }
-    
-    @Override
-    public boolean isGraphPattern()     { return true ; }
-    @Override
-    public Op getGraphPattern()         { return op ; }
-
-    public Element getElement()         { return element ; }
-    
-    @Override
-    public int numArgs() { return 0 ; }
-    
-    // ---- Evaluation
-    
-    @Override
-    public final NodeValue eval(Binding binding, FunctionEnv env)
-    {
-        // Substitute?
-        // Apply optimize transforms after substitution?
-//        if ( opRun == null )
-//        {
-//            opRun = op ;
-//            if ( env.getContext().isTrueOrUndef(ARQ.propertyFunctions) )
-//                opRun = Optimize.apply("Property Functions", new TransformPropertyFunction(env.getContext()), opRun) ;
-//        }
-        
-        ExecutionContext execCxt = new ExecutionContext(env.getContext(),
-                                                        env.getActiveGraph(),
-                                                        env.getDataset(),
-                                                        QC.getFactory(env.getContext())
-                                                        ) ;
-        QueryIterator qIter1 = QueryIterSingleton.create(binding, execCxt) ;
-        QueryIterator qIter = QC.execute(op, qIter1, execCxt) ;
-        // Wrap with something to check for closed iterators.
-        qIter = QueryIteratorCheck.check(qIter, execCxt) ;
-        // Call the per-operation functionality.
-        NodeValue v = eval(binding, qIter, env) ;
-        qIter.close() ;
-        return v ;
-    }
-    
-    protected abstract NodeValue eval(Binding binding, QueryIterator iter, FunctionEnv env) ;
-    
-    public abstract ExprFunctionOp copy(ExprList args, Op x) ;
-    @Override
-    public void visit(ExprVisitor visitor) { visitor.visit(this) ; }
-    public Expr apply(ExprTransform transform, ExprList args, Op x) { return transform.transform(this, args, x) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprLib.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprLib.java
deleted file mode 100644
index 91e78d4..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprLib.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.algebra.optimize.ExprTransformConstantFold ;
-import com.hp.hpl.jena.sparql.core.Var ;
-
-public class ExprLib
-{
-    /** Attempt to fold any sub-expressions of the Expr.
-     * Return an expression that is euqivalent to the argument but maybe simpler.    
-     * @param expr
-     * @return Expression
-     */
-    public static Expr foldConstants(Expr expr) {
-        return ExprTransformer.transform(new ExprTransformConstantFold(), expr) ;
-    }
-
-    /** transform an expression that may involve aggregates into one that just uses the variable for the aggregate */  
-
-    public static Expr replaceAggregateByVariable(Expr expr)
-    {
-        return ExprTransformer.transform(replaceAgg, expr) ;
-    }
-
-    /** transform expressions that may involve aggregates into one that just uses the variable for the aggregate */  
-    public static ExprList replaceAggregateByVariable(ExprList exprs)
-    {
-        return ExprTransformer.transform(replaceAgg, exprs) ;
-    }
-    
-    private static ExprTransform replaceAgg = new ExprTransformCopy()
-    {
-        @Override
-        public Expr transform(ExprAggregator eAgg)       
-        { return eAgg.getAggVar()  ; }
-    } ;
-    
-    /** Decide whether an expression is safe for using a a graph substitution.
-     * Need to be careful about value-like tests when the graph is not 
-     * matched in a value fashion.
-     */
-
-    public static boolean isAssignmentSafeEquality(Expr expr)
-    { 
-        return isAssignmentSafeEquality(expr, false, false) ;
-    }
-    
-    /**
-     * @param graphHasStringEquality    True if the graph triple matching equates xsd:string and plain literal
-     * @param graphHasNumercialValueEquality    True if the graph triple matching equates numeric values
-     */
-    
-    public static boolean isAssignmentSafeEquality(Expr expr, boolean graphHasStringEquality, boolean graphHasNumercialValueEquality) 
-    {
-        if ( !(expr instanceof E_Equals) && !(expr instanceof E_SameTerm) )
-            return false ;
-
-        // Corner case: sameTerm is false for string/plain literal, 
-        // but true in the graph. 
-        
-        ExprFunction2 eq = (ExprFunction2)expr ;
-        Expr left = eq.getArg1() ;
-        Expr right = eq.getArg2() ;
-        Var var = null ;
-        NodeValue constant = null ;
-
-        if ( left.isVariable() && right.isConstant() )
-        {
-            var = left.asVar() ;
-            constant = right.getConstant() ;
-        }
-        else if ( right.isVariable() && left.isConstant() )
-        {
-            var = right.asVar() ;
-            constant = left.getConstant() ;
-        }
-
-        // Not between a variable and a constant
-        if ( var == null || constant == null )
-            return false ;
-
-        if ( ! constant.isLiteral() )
-            // URIs, bNodes.  Any bNode will have come from a substitution - not legal syntax in filters
-            return true ;
-        
-        if (expr instanceof E_SameTerm)
-        {
-            if ( graphHasStringEquality && constant.isString() ) 
-                // Graph is not same term
-                return false ;
-            if ( graphHasNumercialValueEquality && constant.isNumber() )
-                return false ;
-            return true ;
-        }
-        
-        // Final check for "=" where a FILTER = can do value matching when the graph does not.
-        if ( expr instanceof E_Equals )
-        {
-            if ( ! graphHasStringEquality && constant.isString() )
-                return false ;
-            if ( ! graphHasNumercialValueEquality && constant.isNumber() )
-                return false ;
-            return true ;
-        }
-        // Unreachable.
-        throw new ARQInternalErrorException() ;
-    }
-    
-    /** Some "functions" are non-deterministic (unstable) - 
-     * calling them with the same arguments 
-     * does not yields the same answer each time.
-     * Therefore how and when they are called
-     * matters.
-     * 
-     * Functions: RAND, UUID, StrUUID, BNode
-     * 
-     * NOW() is safe.
-     */
-    public static boolean isStable(Expr expr) {
-        try {
-            ExprWalker.walk(exprVisitorCheckForNonFunctions, expr) ;
-            return true ;
-        } catch ( ExprUnstable ex ) {
-            return false ;
-        }
-    }
-
-    private static ExprVisitor exprVisitorCheckForNonFunctions = new ExprVisitorBase() { 
-        @Override
-        public void visit(ExprFunction0 func) {
-            if ( func instanceof E_Random ||
-                func instanceof E_UUID ||
-                func instanceof E_StrUUID)
-                throw new ExprUnstable() ; 
-        }
-        @Override
-        public void visit(ExprFunctionN func) {
-            if (func instanceof E_BNode )
-                throw new ExprUnstable() ;
-        }
-    } ;
-    
-    private static class ExprUnstable extends ExprException {}
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprList.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprList.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprList.java
deleted file mode 100644
index 51719f3..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprList.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.* ;
-
-import com.hp.hpl.jena.sparql.core.Var ;
-import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-public class ExprList implements Iterable<Expr>
-{
-    private final List<Expr> expressions ;
-    /** Create a copy which does not share the list of expressions with the original */ 
-    public static ExprList copy(ExprList other) { return new ExprList(other) ; }
-    /** Empty, immutable ExprList */
-    public static final ExprList emptyList = new ExprList(Collections.<Expr> emptyList()) ;
-    
-    public ExprList() { expressions = new ArrayList<Expr>() ; }
-    
-    private ExprList(ExprList other) {
-        this() ;
-        expressions.addAll(other.expressions) ;
-    }
-
-    public ExprList(Expr expr) {
-        this() ;
-        expressions.add(expr) ;
-    }
-
-    public ExprList(List<Expr> x)   { expressions = x ; }
-
-    public boolean isSatisfied(Binding binding, ExecutionContext execCxt) {
-        for (Expr expr : expressions) {
-            if ( !expr.isSatisfied(binding, execCxt) )
-                return false ;
-        }
-        return true ;
-    }
-    
-    public Expr get(int idx)                            { return expressions.get(idx) ; }
-    public int size()                                   { return expressions.size() ; }
-    public boolean isEmpty()                            { return expressions.isEmpty() ; }
-    public ExprList subList(int fromIdx, int toIdx)     { return new ExprList(expressions.subList(fromIdx, toIdx)) ; }
-    public ExprList tail(int fromIdx)                   { return subList(fromIdx, expressions.size()) ; }
-    
-    public Set<Var> getVarsMentioned() {
-        Set<Var> x = new HashSet<Var>() ;
-        varsMentioned(x) ;
-        return x ;
-    }
-
-    public void varsMentioned(Collection<Var> acc) {
-        for (Expr expr : expressions)
-            expr.varsMentioned(acc) ;
-    }
-    
-    /**
-     * Rewrite, applying a node->node transformation
-     */
-    public ExprList applyNodeTransform(NodeTransform transform) {
-        ExprList x = new ExprList() ;
-        for ( Expr e : expressions)
-            x.add(e.applyNodeTransform(transform));
-        return x ; 
-    }
-
-    public ExprList copySubstitute(Binding binding) {
-        ExprList x = new ExprList() ;
-        for (Expr expr : expressions ) {
-            expr = expr.copySubstitute(binding) ;
-            x.add(expr) ;
-        }
-        return x ;
-    }
-
-    public void addAll(ExprList exprs)      { expressions.addAll(exprs.getList()) ; }
-    public void add(Expr expr)              { expressions.add(expr) ; }
-    public List<Expr> getList()             { return expressions ; }
-    @Override
-    public Iterator<Expr> iterator()        { return expressions.iterator() ; }
-    
-    public void prepareExprs(Context context) {
-        ExprBuild build = new ExprBuild(context) ;
-        // Give each expression the chance to set up (bind functions)
-        for (Expr expr : expressions)
-            ExprWalker.walk(build, expr) ;
-    }
-    
-    @Override
-    public String toString()
-    { return expressions.toString() ; }
-    
-    @Override
-    public int hashCode() { return expressions.hashCode() ; }
-
-    @Override
-    public boolean equals(Object other) {
-        if ( this == other ) return true ;
-        if ( ! ( other instanceof ExprList ) ) return false ;
-        ExprList exprs = (ExprList)other ;
-        return expressions.equals(exprs.expressions) ;
-    }
-
-    public static ExprList splitConjunction(ExprList exprList1) {
-        ExprList exprList2 = new ExprList() ;
-        for (Expr expr : exprList1)
-            split(exprList2, expr) ;
-        return exprList2 ;
-    }
-
-    private static ExprList splitConjunction(Expr expr) {
-        ExprList exprList = new ExprList() ;
-        split(exprList, expr) ;
-        return exprList ;
-    }
-
-    private static void split(ExprList exprList, Expr expr) {
-        // Explode &&-chain to exprlist.
-        while (expr instanceof E_LogicalAnd) {
-            E_LogicalAnd x = (E_LogicalAnd)expr ;
-            Expr left = x.getArg1() ;
-            Expr right = x.getArg2() ;
-            split(exprList, left) ;
-            expr = right ;
-        }
-        // Drop through and add remaining
-        exprList.add(expr) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNode.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNode.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNode.java
deleted file mode 100644
index 7712583..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNode.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.Collection ;
-import java.util.Set ;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.Var ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.expr.nodevalue.XSDFuncOp ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.graph.NodeTransform ;
-import com.hp.hpl.jena.sparql.util.ExprUtils ;
-
-
-/** A node that is a constraint expression that can be evaluated
- * An Expr is already a Constraint - ExprNode is the base implementation
- * of all Expr classes that provides the Constraint machinary. */
- 
-public abstract class ExprNode implements Expr
-{
-    @Override
-    public boolean isSatisfied(Binding binding, FunctionEnv funcEnv)
-    {
-        try {
-            NodeValue v = eval(binding, funcEnv) ;
-            boolean b = XSDFuncOp.booleanEffectiveValue(v) ;
-            return b ;
-        }
-        catch (ExprEvalException ex)
-        { 
-            return false ;
-        }
-    }
-
-    public boolean isExpr() { return true ; }
-    public final Expr getExpr()   { return this ; }
-    
-    // --- interface Constraint
-    
-    @Override
-    public abstract NodeValue eval(Binding binding, FunctionEnv env) ; 
-    
-    @Override
-    public Set<Var> getVarsMentioned() { return ExprVars.getVarsMentioned(this) ; }
-    @Override
-    public void varsMentioned(Collection<Var> acc) { ExprVars.varsMentioned(acc, this) ; }
-
-    public Set<String> getVarNamesMentioned() { return ExprVars.getVarNamesMentioned(this) ; }
-    public void varNamesMentioned(Collection<String> acc) { ExprVars.varNamesMentioned(acc, this) ; }
-
-    @Override
-    public abstract int     hashCode() ;
-    @Override
-    public abstract boolean equals(Object other) ;
-    
-    protected static NodeValue eval(Binding binding, FunctionEnv funcEnv, Expr expr)
-    {   
-        if ( expr == null ) return null ;
-        return expr.eval(binding, funcEnv) ;
-    }
-    
-    @Override
-    final public Expr deepCopy()                     
-    { return copySubstitute(null) ; }
-    
-    @Override
-    public abstract Expr copySubstitute(Binding binding) ;
-    
-    @Override
-    public abstract Expr applyNodeTransform(NodeTransform transform) ;
-
-        
-    // ---- Default implementations
-    @Override
-    public boolean isVariable()        { return false ; }
-    @Override
-    public String getVarName()         { return null ; } //throw new ExprException("Expr.getVarName called on non-variable") ; }
-    @Override
-    public ExprVar getExprVar()        { return null ; } //throw new ExprException("Expr.getVar called on non-variable") ; }
-    @Override
-    public Var asVar()                 { return null ; } //throw new ExprException("Expr.getVar called on non-variable") ; }
-    
-    @Override
-    public boolean isConstant()        { return false ; }
-    @Override
-    public NodeValue getConstant()     { return null ; } // throw new ExprException("Expr.getConstant called on non-constant") ; }
-    
-    @Override
-    public boolean isFunction()        { return false ; }
-    @Override
-    public ExprFunction getFunction()  { return null ; }
-    
-    public boolean isGraphPattern()    { return false ; }
-    public Op getGraphPattern()        { return null ; }
-    
-    // ---- 
-    
-    @Override
-    public String toString()
-    {
-        return ExprUtils.fmtSPARQL(this) ; 
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNotComparableException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNotComparableException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNotComparableException.java
deleted file mode 100644
index 4f1c6bc..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprNotComparableException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.expr;
-
-
-public class ExprNotComparableException extends ExprEvalException
-{
-    public ExprNotComparableException(String msg) { super(msg) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprSystem.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprSystem.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprSystem.java
deleted file mode 100644
index b0a7450..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprSystem.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.util.Symbol ;
-import com.hp.hpl.jena.sparql.util.Utils ;
-
-public abstract class ExprSystem extends ExprFunction0
-{
-    private final Symbol systemSymbol ;
-
-    protected ExprSystem(String fName, Symbol systemSymbol)
-    {
-        super(fName) ;
-        this.systemSymbol = systemSymbol ;
-    }
-
-    @Override
-    public NodeValue eval(FunctionEnv env)
-    {
-        Object obj = env.getContext().get(systemSymbol) ;
-        
-        if ( obj == null )
-            throw new ExprEvalException("null for system symbol: "+systemSymbol) ;
-        if ( ! ( obj instanceof Node ) )
-            throw new ExprEvalException("Not a Node: "+Utils.className(obj)) ;
-        
-        Node n = (Node)obj ;
-//        if ( n == null )
-//            throw new ExprEvalException("No value for system variable: "+systemSymbol) ;  
-        // NodeValue.makeNode could have a cache.
-        NodeValue nv = NodeValue.makeNode(n) ;
-        return nv ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransform.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransform.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransform.java
deleted file mode 100644
index 4aa20d0..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransform.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-
-public interface ExprTransform
-{
-    public Expr transform(ExprFunction0 func) ;
-    public Expr transform(ExprFunction1 func, Expr expr1) ;
-    public Expr transform(ExprFunction2 func, Expr expr1, Expr expr2) ;
-    public Expr transform(ExprFunction3 func, Expr expr1, Expr expr2, Expr expr3) ;
-    public Expr transform(ExprFunctionN func, ExprList args) ;
-    public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg) ;
-    public Expr transform(NodeValue nv) ;
-    public Expr transform(ExprVar nv) ;
-    public Expr transform(ExprAggregator eAgg) ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformBase.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformBase.java
deleted file mode 100644
index 94de6e8..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformBase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-
-public class ExprTransformBase implements ExprTransform
-{
-    @Override public Expr transform(ExprFunction0 func)                                       { return func ; }
-    @Override public Expr transform(ExprFunction1 func, Expr expr1)                           { return func ; }
-    @Override public Expr transform(ExprFunction2 func, Expr expr1, Expr expr2)               { return func ; }
-    @Override public Expr transform(ExprFunction3 func, Expr expr1, Expr expr2, Expr expr3)   { return func ; }
-    @Override public Expr transform(ExprFunctionN func, ExprList args)                        { return func ; }
-    @Override public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg)           { return funcOp ; }
-    @Override public Expr transform(NodeValue nv)                                             { return nv ; }
-    @Override public Expr transform(ExprVar ev)                                               { return ev ; }
-    @Override public Expr transform(ExprAggregator eAgg)                                      { return eAgg ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformCopy.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformCopy.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformCopy.java
deleted file mode 100644
index 096b021..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformCopy.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.List ;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-
-public class ExprTransformCopy implements ExprTransform
-{
-    public static final boolean COPY_ALWAYS         = true ;
-    public static final boolean COPY_ONLY_ON_CHANGE = false ;
-    private boolean alwaysCopy = false ;
-    
-    public ExprTransformCopy()                          { this(COPY_ONLY_ON_CHANGE) ; }
-    public ExprTransformCopy(boolean alwaysDuplicate)   { this.alwaysCopy = alwaysDuplicate ; }
-    
-    @Override
-    public Expr transform(ExprFunction0 func)                   
-    { return xform(func) ; }
-
-    @Override
-    public Expr transform(ExprFunction1 func, Expr expr1)                   
-    { return xform(func, expr1) ; }
-    
-    @Override
-    public Expr transform(ExprFunction2 func, Expr expr1, Expr expr2)
-    { return xform(func, expr1, expr2) ; }
-    
-    @Override
-    public Expr transform(ExprFunction3 func, Expr expr1, Expr expr2, Expr expr3)
-    { return xform(func, expr1, expr2, expr3) ; }
-    
-    @Override
-    public Expr transform(ExprFunctionN func, ExprList args)
-    { return xform(func, args) ; }
-
-    @Override
-    public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg)
-    { return xform(funcOp, args, opArg) ; }
-    
-    @Override
-    public Expr transform(NodeValue nv)     
-    { return xform(nv) ; }
-    
-    @Override
-    public Expr transform(ExprVar exprVar)       
-    { return xform(exprVar) ; }
-
-    @Override
-    public Expr transform(ExprAggregator eAgg)       
-    { return xform(eAgg) ; }
-
-    private Expr xform(ExprFunction0 func)
-    {
-        if ( !alwaysCopy )
-            return func ;
-        return func.copy() ;
-    }
-
-    private Expr xform(ExprFunction1 func, Expr expr1)
-    {
-        if ( !alwaysCopy && expr1 == func.getArg() )
-            return func ;
-        return func.copy(expr1) ;
-    }
-    
-    private Expr xform(ExprFunction2 func, Expr expr1, Expr expr2)
-    {
-        if ( !alwaysCopy && 
-                expr1 == func.getArg1() &&
-                expr2 == func.getArg2() )
-            return func ;
-        return func.copy(expr1, expr2) ;
-    }
-    
-    private Expr xform(ExprFunction3 func, Expr expr1, Expr expr2, Expr expr3)
-    {
-        if ( !alwaysCopy && 
-                expr1 == func.getArg1() &&
-                expr2 == func.getArg2() &&
-                expr3 == func.getArg3() )
-        return func ;
-    return func.copy(expr1, expr2, expr3) ;
-    }
-    
-    private Expr xform(ExprFunctionN func, ExprList args)
-    {
-        if ( ! alwaysCopy && equals1(func.getArgs(), args.getList()) )
-            return func ;
-        return func.copy(args) ;
-    }
-    
-    private boolean equals1(List<Expr> list1, List<Expr> list2)
-    {
-        if ( list1 == null && list2 == null )
-            return true ;
-        if ( list1 == null )
-            return false ;
-        if ( list2 == null )
-            return false ;
-        
-        if ( list1.size() != list2.size() )
-            return false ;
-        for ( int i = 0 ; i < list1.size() ; i++ )
-        {
-            if ( list1.get(i) != list2.get(i) )
-                return false ;
-        }
-        return true ;
-    }
-    
-    private Expr xform(ExprFunctionOp funcOp, ExprList args, Op opArg)
-    {
-        if ( ! alwaysCopy && equals1(funcOp.getArgs(), args.getList()) && funcOp.getGraphPattern() == opArg )
-            return funcOp ;
-        return funcOp.copy(args, opArg) ;
-    }
-    
-    private Expr xform(NodeValue nv)
-    {
-        return nv ;
-    }
-    
-    private Expr xform(ExprVar exprVar)
-    {
-        return exprVar ;
-    }
-    
-    private Expr xform(ExprAggregator eAgg)
-    {
-        if ( ! alwaysCopy )
-            return eAgg ;
-        
-        return eAgg.copy(eAgg.getVar()) ;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformOp.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformOp.java
deleted file mode 100644
index 15bf0c6..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformOp.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.expr;
-
-import com.hp.hpl.jena.sparql.algebra.Transform ;
-
-public interface ExprTransformOp extends ExprTransform
-{
-    public Transform getTransform() ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformSubstitute.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformSubstitute.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformSubstitute.java
deleted file mode 100644
index 3ff0a55..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformSubstitute.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.hp.hpl.jena.sparql.core.Var;
-import com.hp.hpl.jena.sparql.function.user.UserDefinedFunction;
-
-/**
- * An expression transformer that substitutes another expression in place of variables
- * <p>
- * Primarily introduced in order to support the new {@link UserDefinedFunction} capabilities
- * </p>
- */
-public class ExprTransformSubstitute extends ExprTransformCopy {
-    
-    private Map<String, Expr> replacements = new HashMap<>();
-    
-    /**
-     * Creates a simple transform that replaces any occurrence of the given variable with the given expression
-     * @param find Variable to find
-     * @param replace Expression to replace with
-     */
-    public ExprTransformSubstitute(Var find, Expr replace) {
-        if (find == null) throw new IllegalArgumentException("find cannot be null");
-        if (replace == null) throw new IllegalArgumentException("replace cannot be null");
-        this.replacements.put(find.getVarName(), replace);
-    }
-    
-    /**
-     * Creates an advanced transform that uses the given map to make substitutions
-     * @param substitutions Substitutions from variables to expressions
-     */
-    public ExprTransformSubstitute(Map<String, Expr> substitutions) {
-        if (substitutions == null) throw new IllegalArgumentException("replacements cannot be null");
-        this.replacements.putAll(substitutions);
-        
-        for (String key : this.replacements.keySet()) {
-            if (this.replacements.get(key) == null) throw new IllegalArgumentException("Variable ?" + key + " cannot be mapped to a null expression");
-        }
-    }
-    
-    @Override
-    public Expr transform(ExprVar exprVar) {
-        //If variable matches replace with the chosen expression
-        if (this.replacements.containsKey(exprVar.getVarName())) return this.replacements.get(exprVar.getVarName());
-        //Otherwise leave as is
-        return super.transform(exprVar);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformer.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformer.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformer.java
deleted file mode 100644
index ac1db00..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTransformer.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * 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.expr;
-
-import java.util.* ;
-
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.algebra.Transformer ;
-
-public class ExprTransformer
-{
-    private static ExprTransformer singleton = new ExprTransformer();
-    
-    /** Get the current transformer of expressions */
-    public static ExprTransformer get() { return singleton; }
-    
-    /** Transform an expression */
-    public static Expr transform(ExprTransform transform, Expr expr)
-    { return get().transformation(transform, expr) ; }
-
-    /** Transform an expression list */
-    public static ExprList transform(ExprTransform transform, ExprList exprList)
-    { return get().transformation(transform, exprList) ; }
-    
-    private Expr transformation(ExprTransform transform, Expr expr)
-    {
-        ApplyExprTransformVisitor v = new ApplyExprTransformVisitor(transform) ;
-        return transformation(v, expr) ;
-    }
-
-    private ExprList transformation(ExprTransform transform, ExprList exprList)
-    {
-        ApplyExprTransformVisitor v = new ApplyExprTransformVisitor(transform) ;
-        ExprList exprList2 = new ExprList() ;
-        for ( Expr expr : exprList )
-        {
-            Expr expr2 = transformation(v, expr) ;
-            exprList2.add(expr2) ;
-        }
-        return exprList2 ;
-    }
-    
-    private Expr transformation(ApplyExprTransformVisitor applyVisitor, Expr expr)
-    {
-        ExprWalker.walk(applyVisitor, expr) ;
-        return applyVisitor.result() ;
-    }
-    
-    public static
-    class ApplyExprTransformVisitor implements ExprVisitor
-    {
-        private ExprTransform transform ;
-        private final Deque<Expr> stack = new ArrayDeque<>() ;
-        
-        final Expr result()
-        { 
-            if ( stack.size() != 1 ) {
-                Log.warn(this, "Stack is not aligned (size = "+stack.size()+")") ;
-                if ( stack.isEmpty() )
-                    return null ;
-            }
-            return stack.pop() ; 
-        }
-
-        ApplyExprTransformVisitor(ExprTransform transform)
-        { this.transform = transform ; }
-
-        @Override
-        public void startVisit()    {}
-        @Override
-        public void finishVisit()   {}
-
-        
-        @Override
-        public void visit(ExprFunction0 func)
-        {
-            Expr e = func.apply(transform) ;
-            push(stack, e) ;
-        }
-        
-        @Override
-        public void visit(ExprFunction1 func)
-        {
-            Expr e1 = pop(stack) ;
-            Expr e = func.apply(transform, e1) ;
-            push(stack, e) ;
-        }
-
-        @Override
-        public void visit(ExprFunction2 func)
-        {
-            Expr e2 = pop(stack) ;
-            Expr e1 = pop(stack) ;
-            Expr e = func.apply(transform, e1, e2) ;
-            push(stack, e) ;
-        }
-
-        @Override
-        public void visit(ExprFunction3 func)
-        {
-            Expr e3 = pop(stack) ;
-            Expr e2 = pop(stack) ;
-            Expr e1 = pop(stack) ;
-            Expr e = func.apply(transform, e1, e2, e3) ;
-            push(stack, e) ;
-        }
-
-        @Override
-        public void visit(ExprFunctionN func)
-        {
-            ExprList x = process(func.getArgs()) ;
-            Expr e = func.apply(transform, x) ;
-            push(stack, e) ;
-        }
-        
-        private ExprList process(List<Expr> exprList)
-        {
-            int N = exprList.size() ;
-            List<Expr> x = new ArrayList<>(N) ;
-            for ( Expr anExprList : exprList )
-            {
-                Expr e2 = pop( stack );
-                // Add in reverse.
-                x.add( 0, e2 );
-            }
-            return new ExprList(x) ;
-        }
-        
-        @Override
-        public void visit(ExprFunctionOp funcOp)
-        {
-            ExprList x = null ;
-            if ( funcOp.getArgs() != null )
-                x = process(funcOp.getArgs()) ;
-            Op op = funcOp.getGraphPattern() ;
-            // Caution: the expression can have a pattern inside it.
-            // See also: ExprTransformApplyTransform which does much the same in a different way.
-            if ( transform instanceof ExprTransformOp )
-            {
-                ExprTransformOp t = (ExprTransformOp)transform ;
-                op = Transformer.transform(t.getTransform(), op) ; 
-            }
-            
-            Expr e = funcOp.apply(transform, x, op) ;
-            push(stack, e) ;
-
-        }
-
-        @Override
-        public void visit(NodeValue nv)
-        {
-            Expr e = nv.apply(transform) ;
-            push(stack, e) ;
-        }
-
-        @Override
-        public void visit(ExprVar var)
-        {
-            Expr e = var.apply(transform) ;
-            push(stack, e) ;
-        }
-        
-        @Override
-        public void visit(ExprAggregator eAgg)
-        {
-            Expr e = eAgg.apply(transform) ;
-            push(stack, e) ;
-        }
-        
-        private static void push(Deque<Expr> stack, Expr value)
-        {
-            stack.push(value) ;
-        }
-        
-        private static Expr pop(Deque<Expr> stack)
-        {
-            try {
-            Expr e = stack.pop();
-            if ( e == NodeValue.nvNothing )
-                e = null ;
-            return e ;
-            } catch ( EmptyStackException ex)
-            {
-                System.err.println("Empty stack") ;
-                return null ;
-            }
-        }
-    }
-    
-    
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTypeException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTypeException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTypeException.java
deleted file mode 100644
index 2022f0b..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprTypeException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.expr;
-
-/** Exception for a dynamic evaluation exception caused by a type mismatch. */
-
-public class ExprTypeException extends ExprEvalException
-{
-    public ExprTypeException() { super() ; }
-    public ExprTypeException(Throwable cause) { super(cause) ; }
-    public ExprTypeException(String msg) { super(msg) ; }
-    public ExprTypeException(String msg, Throwable cause) { super(msg, cause) ; }
-
-    private static final long serialVersionUID = 1L; // Unused
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprUndefException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprUndefException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprUndefException.java
deleted file mode 100644
index 7d15eba..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprUndefException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.expr;
-
-/** Exception for an undefined expression (including unbound variable) */
-
-public class ExprUndefException extends ExprEvalException
-{
-    public ExprUndefException() { super() ; }
-    public ExprUndefException(Throwable cause) { super(cause) ; }
-    public ExprUndefException(String msg) { super(msg) ; }
-    public ExprUndefException(String msg, Throwable cause) { super(msg, cause) ; }
-
-    private static final long serialVersionUID = 1L; // Unused
-}


Mime
View raw message