jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cla...@apache.org
Subject [25/50] [abbrv] jena git commit: Using Java 8 types in o.a.j.atlas
Date Sun, 10 May 2015 13:03:54 GMT
Using Java 8 types in o.a.j.atlas


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/6b475345
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/6b475345
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/6b475345

Branch: refs/heads/add-contract-tests
Commit: 6b4753453a3be174aecc07ce9caf659e916c04f7
Parents: 2257377
Author: ajs6f <ajs6f@virginia.edu>
Authored: Mon May 4 12:30:38 2015 -0400
Committer: ajs6f <ajs6f@virginia.edu>
Committed: Mon May 4 15:16:16 2015 -0400

----------------------------------------------------------------------
 .../org/apache/jena/atlas/csv/CSVParser.java    |   9 +-
 .../java/org/apache/jena/riot/other/GLib.java   |  58 ++----
 .../org/apache/jena/riot/out/JsonLDWriter.java  |   8 +-
 .../process/normalize/CanonicalizeLiteral.java  |   6 +-
 .../apache/jena/riot/system/PrefixMapBase.java  |  25 +--
 .../org/apache/jena/riot/thrift/BinRDF.java     |  12 +-
 .../jena/sparql/core/DatasetGraphBase.java      |  12 +-
 .../jena/sparql/core/DatasetGraphQuad.java      |  13 +-
 .../org/apache/jena/sparql/engine/Rename.java   |  24 +--
 .../ReorderTransformationSubstitution.java      |  12 +-
 .../org/apache/jena/sparql/expr/E_Exists.java   |   6 +-
 .../apache/jena/sparql/expr/E_NotExists.java    |   6 +-
 .../java/org/apache/jena/sparql/expr/Expr.java  |   5 +-
 .../apache/jena/sparql/expr/ExprAggregator.java |   8 +-
 .../apache/jena/sparql/expr/ExprFunction0.java  |   6 +-
 .../apache/jena/sparql/expr/ExprFunction1.java  |   6 +-
 .../apache/jena/sparql/expr/ExprFunction2.java  |   6 +-
 .../apache/jena/sparql/expr/ExprFunction3.java  |   6 +-
 .../apache/jena/sparql/expr/ExprFunctionN.java  |   5 +-
 .../org/apache/jena/sparql/expr/ExprList.java   |   5 +-
 .../org/apache/jena/sparql/expr/ExprNode.java   |   5 +-
 .../org/apache/jena/sparql/expr/ExprVar.java    |   7 +-
 .../org/apache/jena/sparql/expr/NodeValue.java  |   6 +-
 .../jena/sparql/expr/aggregate/Aggregator.java  |   5 +-
 .../sparql/expr/aggregate/AggregatorBase.java   |   4 +-
 .../apache/jena/sparql/graph/NodeTransform.java |  12 +-
 .../jena/sparql/graph/NodeTransformLib.java     |  48 ++---
 .../jena/sparql/graph/NodeTransformOp.java      |  15 +-
 .../modify/NodeTransformBNodesToVariables.java  |   6 +-
 .../apache/jena/sparql/modify/TemplateLib.java  |  31 ++-
 .../jena/sparql/modify/UpdateEngineWorker.java  |   4 +-
 .../org/apache/jena/sparql/path/PathLib.java    |   4 +-
 .../jena/sparql/path/eval/PathEngine.java       |  25 +--
 .../jena/sparql/path/eval/PathEvaluator.java    |   6 +-
 .../jena/sparql/pfunction/library/strSplit.java |  12 +-
 .../apache/jena/sparql/resultset/CSVInput.java  |   6 +-
 .../jena/sparql/resultset/ResultSetCompare.java |  12 +-
 .../org/apache/jena/sparql/util/ModelUtils.java |  19 +-
 .../jena/sparql/util/graph/GraphList.java       |  12 +-
 .../jena/riot/process/TestNormalization.java    |   4 +-
 .../jena/riot/thrift/TestStreamRDFThrift.java   |  13 +-
 .../org/apache/jena/atlas/iterator/Action.java  |   9 +-
 .../apache/jena/atlas/iterator/ActionCount.java |   6 +-
 .../jena/atlas/iterator/ActionNothing.java      |  26 ---
 .../org/apache/jena/atlas/iterator/Filter.java  |   8 +-
 .../atlas/iterator/FilterDistinctAdjacent.java  |   8 +-
 .../jena/atlas/iterator/FilterOutNulls.java     |  32 ---
 .../apache/jena/atlas/iterator/FilterStack.java |  16 +-
 .../jena/atlas/iterator/FilterUnique.java       |  12 +-
 .../org/apache/jena/atlas/iterator/Iter.java    | 193 +++++--------------
 .../jena/atlas/iterator/IteratorArray.java      |   6 +
 .../apache/jena/atlas/iterator/MapUtils.java    |  36 ----
 .../apache/jena/atlas/iterator/Transform.java   |   8 +-
 .../apache/jena/atlas/lib/ActionKeyValue.java   |   9 +-
 .../java/org/apache/jena/atlas/lib/Cache.java   |   3 +-
 .../org/apache/jena/atlas/lib/CacheSet.java     |   4 +-
 .../org/apache/jena/atlas/lib/Closeable.java    |   2 +-
 .../apache/jena/atlas/lib/CollectionUtils.java  |  26 +--
 .../java/org/apache/jena/atlas/lib/Lib.java     |  13 +-
 .../org/apache/jena/atlas/lib/ListUtils.java    |   7 +-
 .../org/apache/jena/atlas/lib/MapUtils.java     |  45 -----
 .../java/org/apache/jena/atlas/lib/Problem.java |  25 ---
 .../org/apache/jena/atlas/lib/SetUtils.java     |  26 +--
 .../java/org/apache/jena/atlas/lib/Tuple.java   |  22 +--
 .../org/apache/jena/atlas/lib/cache/Cache0.java |   4 +-
 .../org/apache/jena/atlas/lib/cache/Cache1.java |   8 +-
 .../apache/jena/atlas/lib/cache/CacheGuava.java |   9 +-
 .../jena/atlas/lib/cache/CacheSetImpl.java      |  16 +-
 .../jena/atlas/lib/cache/CacheSetSync.java      |   5 +-
 .../jena/atlas/lib/cache/CacheSetWrapper.java   |   5 +-
 .../jena/atlas/lib/cache/CacheSimple.java       |  13 +-
 .../jena/atlas/lib/cache/CacheWrapper.java      |   4 +-
 .../java/org/apache/jena/base/Closeable.java    |  27 ---
 .../apache/jena/atlas/iterator/TestIter.java    | 134 +------------
 .../jena/fuseki/servlets/SPARQL_Protocol.java   |  12 +-
 .../jena/fuseki/servlets/SPARQL_Protocol.java   |  10 +-
 .../query/rewriter/SecuredFunction.java         |   4 +-
 .../org/apache/jena/sdb/compiler/QuadBlock.java |   6 +-
 .../org/apache/jena/sdb/compiler/SDB_QC.java    |  14 +-
 .../apache/jena/sdb/compiler/TransformSDB.java  |   4 +-
 .../org/apache/jena/sdb/core/ScopeEntry.java    |  28 +--
 .../org/apache/jena/sdb/core/ScopeRename.java   |  21 --
 .../sdb/core/sqlnode/GenerateSQLVisitor.java    |   9 +-
 .../org/apache/jena/sdb/print/ActionPrint.java  |   7 +-
 .../jena/sdb/test/junit/ParamAllStoreDesc.java  |  11 +-
 .../jena/sdb/test/junit/ParamAllStores.java     |  11 +-
 .../apache/jena/sdb/test/junit/StoreList.java   |  21 +-
 .../spatial/SpatialDocProducerTriples.java      |  19 --
 .../jena/tdb/base/block/BlockMgrCache.java      |   6 +-
 .../tdb/index/bplustree/BPlusTreeRewriter.java  |  10 +-
 .../java/org/apache/jena/tdb/lib/NodeLib.java   |   9 +-
 .../java/org/apache/jena/tdb/lib/TupleLib.java  |  34 +---
 .../apache/jena/tdb/solver/OpExecutorTDB1.java  |  11 +-
 .../java/org/apache/jena/tdb/solver/QC2.java    |   9 +-
 .../org/apache/jena/tdb/solver/SolverLib.java   |  52 ++---
 .../tdb/solver/StageGeneratorDirectTDB.java     |   9 +-
 .../apache/jena/tdb/solver/StageMatchTuple.java |  34 +---
 .../tdb/solver/stats/StatsCollectorBase.java    |   5 +-
 .../apache/jena/tdb/store/DatasetGraphTDB.java  |  13 +-
 .../org/apache/jena/tdb/store/GraphTDB.java     |  19 +-
 .../org/apache/jena/tdb/store/QuadTable.java    |   9 -
 .../org/apache/jena/tdb/store/TripleTable.java  |   9 -
 .../tdb/store/nodetable/NodeTableNative.java    |  35 +---
 .../tdb/store/tupletable/TupleIndexRecord.java  |  18 +-
 .../apache/jena/tdb/base/record/RecordLib.java  |   9 +-
 .../apache/jena/tdb/store/TestQuadFilter.java   |  20 +-
 106 files changed, 455 insertions(+), 1294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/atlas/csv/CSVParser.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/csv/CSVParser.java b/jena-arq/src/main/java/org/apache/jena/atlas/csv/CSVParser.java
index 83613ae..e1afc2f 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/csv/CSVParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/csv/CSVParser.java
@@ -23,12 +23,12 @@ import java.io.InputStream ;
 import java.io.Reader ;
 import java.util.Iterator ;
 import java.util.List ;
+import java.util.function.Function;
 
 import org.apache.commons.csv.CSVFormat ;
 import org.apache.commons.csv.CSVRecord ;
 import org.apache.jena.atlas.io.IO ;
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 
 /** 
  *  Wrapper for Commons CSV parser.
@@ -63,12 +63,7 @@ public class CSVParser implements Iterable<List<String>>
         }
     }
     
-    private static Transform<CSVRecord, List<String>> transform = new Transform<CSVRecord, List<String>>() {
-        @Override
-        public List<String> convert(CSVRecord record) {
-            return recordToList(record) ;
-        }
-    } ;
+    private static Function<CSVRecord, List<String>> transform = rec -> recordToList(rec) ;
     
     @Override
     public Iterator<List<String>> iterator() {

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/riot/other/GLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/other/GLib.java b/jena-arq/src/main/java/org/apache/jena/riot/other/GLib.java
index 6a6958a..db14724 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/other/GLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/other/GLib.java
@@ -19,9 +19,7 @@
 package org.apache.jena.riot.other;
 
 import java.util.Iterator ;
-
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -42,89 +40,55 @@ public class GLib
     public static Iterator<Node> listSubjects(Graph graph)
     {
         ExtendedIterator<Triple> iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
-        return Iter.iter(iter).map(projectTripleSubject).distinct() ;
+        return Iter.iter(iter).map(Triple::getSubject).distinct() ;
     }
 
     /** List the predicates in a graph (no duplicates) */
     public static Iterator<Node> listPredicates(Graph graph)
     {
         ExtendedIterator<Triple> iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
-        return Iter.iter(iter).map(projectTriplePredicate).distinct() ;
+        return Iter.iter(iter).map(Triple::getPredicate).distinct() ;
     }
     
     /** List the objects in a graph (no duplicates) */
     public static Iterator<Node> listObjects(Graph graph)
     {
         ExtendedIterator<Triple> iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
-        return Iter.iter(iter).map(projectTripleObject).distinct() ;
+        return Iter.iter(iter).map(Triple::getObject).distinct() ;
     }
-    
-    private static Transform<Quad, Triple> transformQuad2Triple = new Transform<Quad, Triple> () {
-        @Override
-        public Triple convert(Quad quad)    { return quad.asTriple() ; }
-    } ;
 
     /** Project quads to triples */
     public static Iter<Triple> quads2triples(Iterator<Quad> iter)
     {
-        return Iter.iter(iter).map(transformQuad2Triple) ;
+        return Iter.iter(iter).map(Quad::asTriple) ;
     }
 
     /** Project quad to graphname */
     public static Iterator<Node> quad2graphName(Iterator<Quad> iter)
-    { return Iter.map(iter, projectQuadGraphName) ; }
+    { return Iter.map(iter, Quad::getGraph) ; }
     
     /** Project quad to graphname */
     public static Iterator<Node> quad2subject(Iterator<Quad> iter)
-    { return Iter.map(iter, projectQuadSubject) ; }
+    { return Iter.map(iter, Quad::getSubject) ; }
     
     /** Project quad to predicate */
     public static Iterator<Node> quad2predicate(Iterator<Quad> iter)
-    { return Iter.map(iter, projectQuadPredicate) ; }
+    { return Iter.map(iter, Quad::getPredicate) ; }
     
     /** Project quad to object */
     public static Iterator<Node> quad2object(Iterator<Quad> iter)
-    { return Iter.map(iter, projectQuadObject) ; }
+    { return Iter.map(iter, Quad::getObject) ; }
     
     /** Project triple to subject */ 
     public static Iterator<Node> triple2subject(Iterator<Triple> iter)
-    { return Iter.map(iter, projectTripleSubject) ; }
+    { return Iter.map(iter, Triple::getSubject) ; }
     
     /** Project triple to predicate */ 
     public static Iterator<Node> triple2predicate(Iterator<Triple> iter)
-    { return Iter.map(iter, projectTriplePredicate) ; }
+    { return Iter.map(iter, Triple::getPredicate) ; }
     
     /** Project triple to object */ 
     public static Iterator<Node> triple2object(Iterator<Triple> iter)
-    { return Iter.map(iter, projectTripleObject) ; }
-
-    /** Transform quad to graphname */
-    public static Transform<Quad, Node> projectQuadGraphName = new Transform<Quad, Node>() {
-        @Override  public Node convert(Quad quad) { return quad.getGraph() ; }
-    } ;
-    /** Transform quad to subject */
-    public static Transform<Quad, Node> projectQuadSubject = new Transform<Quad, Node>() {
-        @Override  public Node convert(Quad quad) { return quad.getSubject() ; }
-    } ;
-    /** Transform quad to predicate */
-    public static Transform<Quad, Node> projectQuadPredicate = new Transform<Quad, Node>() {
-        @Override public Node convert(Quad quad) { return quad.getPredicate() ; }
-    } ;
-    /** Transform quad to object */
-    public static Transform<Quad, Node> projectQuadObject = new Transform<Quad, Node>() {
-        @Override public Node convert(Quad quad) { return quad.getObject() ; }
-    } ;
-    /** Transform triple to subject */ 
-    public static Transform<Triple, Node> projectTripleSubject   = new Transform<Triple, Node>() {
-        @Override public Node convert(Triple triple) { return triple.getSubject() ; }
-    } ;
-    /** Transform triple to predicate */ 
-    public static Transform<Triple, Node> projectTriplePredicate = new Transform<Triple, Node>() {
-        @Override public Node convert(Triple triple) { return triple.getPredicate() ; }
-    } ;
-    /** Transform triple to object */ 
-    public static Transform<Triple, Node> projectTripleObject    = new Transform<Triple, Node>() {
-        @Override public Node convert(Triple triple) { return triple.getObject() ; }
-    } ;
+    { return Iter.map(iter, Triple::getObject) ; }
 }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/riot/out/JsonLDWriter.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/out/JsonLDWriter.java b/jena-arq/src/main/java/org/apache/jena/riot/out/JsonLDWriter.java
index dbd8fff..c7530a0 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/out/JsonLDWriter.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/out/JsonLDWriter.java
@@ -23,10 +23,10 @@ import java.io.OutputStream ;
 import java.io.OutputStreamWriter ;
 import java.io.Writer ;
 import java.util.* ;
-import java.util.Map.Entry ;
+import java.util.Map.Entry;
+import java.util.function.Consumer;
 
 import org.apache.jena.atlas.io.IO ;
-import org.apache.jena.atlas.iterator.Action ;
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.atlas.lib.Chars ;
 import org.apache.jena.graph.Graph ;
@@ -123,9 +123,9 @@ public class JsonLDWriter extends WriterDatasetRIOTBase
     private static void addProperties(final Map<String, Object> ctx, Graph graph) {
         // Add some properties directly so it becomes "localname": ....
         final Set<String> dups = new HashSet<>() ;
-        Action<Triple> x = new Action<Triple>() {
+        Consumer<Triple> x = new Consumer<Triple>() {
             @Override
-            public void apply(Triple item) {
+            public void accept(Triple item) {
                 Node p = item.getPredicate() ;
                 Node o = item.getObject() ;
                 if ( p.equals(RDF.type.asNode()) )

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/riot/process/normalize/CanonicalizeLiteral.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/process/normalize/CanonicalizeLiteral.java b/jena-arq/src/main/java/org/apache/jena/riot/process/normalize/CanonicalizeLiteral.java
index c7a11ad..3f8490e 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/process/normalize/CanonicalizeLiteral.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/process/normalize/CanonicalizeLiteral.java
@@ -20,17 +20,17 @@ package org.apache.jena.riot.process.normalize;
 
 import java.util.HashMap ;
 import java.util.Map ;
+import java.util.function.Function;
 
 import org.apache.jena.datatypes.RDFDatatype ;
 import org.apache.jena.datatypes.xsd.XSDDatatype ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
 import org.apache.jena.riot.web.LangTag ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.util.NodeUtils ;
 import org.apache.jena.vocabulary.RDF ;
 
-public class CanonicalizeLiteral implements NodeTransform    
+public class CanonicalizeLiteral implements Function<Node, Node>    
 {
     private static final CanonicalizeLiteral singleton = new CanonicalizeLiteral(); 
 
@@ -39,7 +39,7 @@ public class CanonicalizeLiteral implements NodeTransform
     private CanonicalizeLiteral() {}
     
     @Override
-    public Node convert(Node node) {
+    public Node apply(Node node) {
         if ( ! node.isLiteral() )
             return node ;
             

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java b/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
index 4190e7c..10dc6de 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
@@ -18,12 +18,11 @@
 
 package org.apache.jena.riot.system;
 
+import static java.util.stream.Collectors.toMap;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
-
-import org.apache.jena.atlas.iterator.Iter;
-import org.apache.jena.atlas.lib.ActionKeyValue;
 import org.apache.jena.atlas.lib.Pair;
 import org.apache.jena.iri.IRI;
 import org.apache.jena.iri.IRIFactory;
@@ -53,16 +52,8 @@ public abstract class PrefixMapBase implements PrefixMap {
     
     @Override
     public Map<String, String> getMappingCopyStr() {
-        final Map<String, String> smap = new HashMap<>();
-        ActionKeyValue<String, IRI> action = new ActionKeyValue<String, IRI>() {
-            @Override
-            public void apply(String key, IRI value) {
-                String str = value.toString();
-                smap.put(key, str);
-            }
-        };
-        Iter.apply(getMapping(), action);
-        return smap;
+		return getMapping().entrySet().stream()
+				.collect(toMap(Map.Entry::getKey, v -> v.getValue().toString()));
     }
     
     @Override
@@ -72,9 +63,7 @@ public abstract class PrefixMapBase implements PrefixMap {
     
     @Override
     public void putAll(PrefixMap pmap) {
-        for (Map.Entry<String, IRI> e : pmap.getMapping().entrySet()) {
-            this.add(e.getKey(), e.getValue());
-        }
+    		pmap.getMapping().forEach(this::add);
     }
 
     @Override
@@ -84,9 +73,7 @@ public abstract class PrefixMapBase implements PrefixMap {
 
     @Override
     public void putAll(Map<String, String> mapping) {
-        for (Map.Entry<String, String> e : mapping.entrySet()) {
-            this.add(e.getKey(), e.getValue());
-        }
+    		mapping.forEach(this::add);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/riot/thrift/BinRDF.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/BinRDF.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/BinRDF.java
index 29ad8d9..96e4ea6 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/BinRDF.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/BinRDF.java
@@ -22,10 +22,10 @@ import java.io.BufferedOutputStream ;
 import java.io.InputStream ;
 import java.io.OutputStream ;
 import java.util.List ;
+import java.util.function.Consumer;
 
 import org.apache.jena.atlas.io.IO ;
 import org.apache.jena.atlas.io.IndentedWriter ;
-import org.apache.jena.atlas.iterator.Action ;
 import org.apache.jena.query.ResultSet ;
 import org.apache.jena.riot.system.PrefixMap ;
 import org.apache.jena.riot.system.PrefixMapFactory ;
@@ -168,11 +168,7 @@ public class BinRDF {
 
     // ** Java7 support
     public static void applyVisitor(TProtocol protocol, final VisitorStreamRowTRDF visitor) {
-        Action<RDF_StreamRow> action = new Action<RDF_StreamRow>() {
-            @Override
-            public void apply(RDF_StreamRow z) { TRDF.visit(z, visitor) ; }
-        } ;
-        apply(protocol, action) ;
+        apply(protocol, z -> TRDF.visit(z, visitor)) ;
     }
     
     /**
@@ -180,7 +176,7 @@ public class BinRDF {
      * @param protocol TProtocol
      * @param action   Code to act on the row.
      */
-    public static void apply(TProtocol protocol, Action<RDF_StreamRow> action) {
+    public static void apply(TProtocol protocol, Consumer<RDF_StreamRow> action) {
         RDF_StreamRow row = new RDF_StreamRow() ;
         while(protocol.getTransport().isOpen()) {
             try { row.read(protocol) ; }
@@ -189,7 +185,7 @@ public class BinRDF {
                     break ;
             }
             catch (TException ex) { TRDF.exception(ex) ; }
-            action.apply(row) ;
+            action.accept(row) ;
             row.clear() ;
         }
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphBase.java
index 196ecf8..bd87c82 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphBase.java
@@ -19,10 +19,8 @@
 package org.apache.jena.sparql.core;
 
 import java.util.Iterator ;
-
 import org.apache.jena.atlas.io.IndentedLineBuffer ;
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -189,15 +187,7 @@ abstract public class DatasetGraphBase implements DatasetGraph
 
     protected static Iter<Quad> triples2quads(final Node graphNode, Iterator<Triple> iter)
     {
-        Transform<Triple, Quad> transformNamedGraph = new Transform<Triple, Quad> () {
-            @Override
-            public Quad convert(Triple triple)
-            {
-                return new Quad(graphNode, triple) ;
-            }
-        } ;
-
-        return Iter.iter(iter).map(transformNamedGraph) ;
+        return Iter.iter(iter).map(t -> new Quad(graphNode, t)) ;
     }
 
     

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphQuad.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphQuad.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphQuad.java
index 5b28c90..d685a71 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphQuad.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphQuad.java
@@ -19,28 +19,19 @@
 package org.apache.jena.sparql.core;
 
 import java.util.Iterator ;
-
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.graph.Node ;
 
 
 /** A DatasetGraph base class for pure quad-centric storage.     
  */
 public abstract class DatasetGraphQuad extends DatasetGraphBase
-{
-    static Transform<Quad, Node> projectGraphName = new Transform<Quad, Node>() {
-        @Override
-        public Node convert(Quad quad)
-        {
-            return quad.getGraph() ; 
-        }} ;
-    
+{   
     @Override
     public Iterator<Node> listGraphNodes()
     {
         Iter<Quad> iter = Iter.iter(find(Node.ANY, Node.ANY, Node.ANY, Node.ANY)) ;
-        return iter.map(projectGraphName).distinct() ;
+        return iter.map(Quad::getGraph).distinct() ;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/engine/Rename.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/Rename.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/Rename.java
index 96a8751..bc1d4ea 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/Rename.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/Rename.java
@@ -22,6 +22,7 @@ import java.util.Collection ;
 import java.util.HashMap ;
 import java.util.Map ;
 import java.util.Set ;
+import java.util.function.Function;
 
 import org.apache.jena.graph.Node ;
 import org.apache.jena.sparql.ARQConstants ;
@@ -29,7 +30,6 @@ import org.apache.jena.sparql.algebra.Op ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.expr.Expr ;
 import org.apache.jena.sparql.expr.ExprList ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.graph.NodeTransformLib ;
 
 /** Support for renaming all the variables in an algebra expession
@@ -49,14 +49,14 @@ public class Rename
     /** Rename one node to another */
     public static Op renameNode(Op op, Node oldName, Node newName)
     {
-        NodeTransform renamer = new RenameNode(oldName, newName) ;
+    		Function<Node, Node> renamer = new RenameNode(oldName, newName) ;
         return NodeTransformLib.transform(renamer, op) ;
     }
 
     /** Rename one variable to another */
     public static Op renameVar(Op op, Var oldName, Var newName)
     {
-        NodeTransform renamer = new RenameNode(oldName, newName) ;
+    		Function<Node, Node> renamer = new RenameNode(oldName, newName) ;
         return NodeTransformLib.transform(renamer, op) ;
     }
     
@@ -76,13 +76,13 @@ public class Rename
     /** Rename all variables in an expression, EXCEPT for those named as constant */ 
     public static ExprList renameVars(ExprList exprList, Set<Var> constants)
     {
-        NodeTransform renamer = new RenameAnyVars(constants, prefix) ;
+    		Function<Node, Node> renamer = new RenameAnyVars(constants, prefix) ;
         return NodeTransformLib.transform(renamer, exprList) ;
     }
         
     public static Expr renameVars(Expr expr, Set<Var> constants)
     {
-        NodeTransform renamer = new RenameAnyVars(constants, prefix) ;
+    		Function<Node, Node> renamer = new RenameAnyVars(constants, prefix) ;
         return NodeTransformLib.transform(renamer, expr) ;
     }
     
@@ -90,13 +90,13 @@ public class Rename
      * This assumes the op was renamed by VarRename.rename */
     public static Op reverseVarRename(Op op, boolean repeatedly)
     {
-        NodeTransform renamer = new UnrenameAnyVars(prefix, repeatedly) ;
+    		Function<Node, Node> renamer = new UnrenameAnyVars(prefix, repeatedly) ;
         return NodeTransformLib.transform(renamer, op) ;
     }
     
     // ---- Transforms that do the renaming and unrenaming.
     
-    static class RenameNode implements NodeTransform
+    static class RenameNode implements Function<Node, Node>
     {
         private final Node oldName ;
         private final Node newName ;
@@ -107,7 +107,7 @@ public class Rename
         }
         
         @Override
-        public Node convert(Node node)
+        public Node apply(Node node)
         {
             if ( node.equals(oldName) )
                 return newName ;
@@ -116,7 +116,7 @@ public class Rename
         
     }
     
-    static class RenameAnyVars implements NodeTransform
+    static class RenameAnyVars implements Function<Node, Node>
     {
         private final Map<Var, Var> aliases = new HashMap<>() ;
         private final Collection<Var> constants ;
@@ -129,7 +129,7 @@ public class Rename
         }
         
         @Override
-        public final Node convert(Node node)
+        public final Node apply(Node node)
         {
             if ( ! Var.isVar(node) ) return node ;
             if ( constants.contains(node) ) return node ;
@@ -151,7 +151,7 @@ public class Rename
     }
 
     /** Reverse a renaming (assuming renaming was done by prefixing variable names) */
-    static class UnrenameAnyVars implements NodeTransform
+    static class UnrenameAnyVars implements Function<Node, Node>
     {
         private final String varPrefix ;
         private final boolean repeatedly ;
@@ -163,7 +163,7 @@ public class Rename
         }
 
         @Override
-        public Node convert(Node node)
+        public Node apply(Node node)
         {
             if ( ! Var.isVar(node) ) 
                 return node ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/engine/optimizer/reorder/ReorderTransformationSubstitution.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/optimizer/reorder/ReorderTransformationSubstitution.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/optimizer/reorder/ReorderTransformationSubstitution.java
index e316b31..d4caa80 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/optimizer/reorder/ReorderTransformationSubstitution.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/optimizer/reorder/ReorderTransformationSubstitution.java
@@ -22,10 +22,8 @@ import static org.apache.jena.sparql.util.StringUtils.printAbbrev ;
 
 import java.util.ArrayList ;
 import java.util.List ;
-
 import org.apache.jena.atlas.iterator.AccString ;
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.lib.StrUtils ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -64,7 +62,7 @@ public abstract class ReorderTransformationSubstitution implements ReorderTransf
         // Or done here as a second pass mutate of PatternTriples
 
         // Convert to a mutable form (that allows things like "TERM")
-        List<PatternTriple> components = Iter.toList(Iter.map(triples.iterator(), convert)) ;
+        List<PatternTriple> components = Iter.toList(Iter.map(triples.iterator(), PatternTriple::new)) ;
 
         // Allow subclasses to get in (e.g. static reordering).
         components = modifyComponents(components) ;
@@ -299,12 +297,4 @@ public abstract class ReorderTransformationSubstitution implements ReorderTransf
                 return "(" + printAbbrev(pt.toString()) + ")" ;
         }
     } ;
-
-    // Triples to TriplePatterns.
-    private static Transform<Triple, PatternTriple> convert = new Transform<Triple, PatternTriple>(){
-        @Override
-        public PatternTriple convert(Triple triple)
-        {
-            return new PatternTriple(triple) ;
-        }} ;
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_Exists.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_Exists.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_Exists.java
index 3d7f6a3..0445350 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_Exists.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_Exists.java
@@ -18,13 +18,15 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.algebra.Algebra ;
 import org.apache.jena.sparql.algebra.Op ;
 import org.apache.jena.sparql.core.Substitute ;
 import org.apache.jena.sparql.engine.QueryIterator ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.graph.NodeTransformLib ;
 import org.apache.jena.sparql.sse.Tags ;
 import org.apache.jena.sparql.syntax.Element ;
@@ -56,7 +58,7 @@ public class E_Exists extends ExprFunctionOp
     }
 
     @Override
-    public Expr applyNodeTransform(NodeTransform nodeTransform)
+    public Expr applyNodeTransform(Function<Node, Node> nodeTransform)
     {
         Op op2 = NodeTransformLib.transform(nodeTransform, getGraphPattern()) ;
         return new E_Exists(getElement(), op2) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_NotExists.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_NotExists.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_NotExists.java
index 2f41b9e..250d105 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_NotExists.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/E_NotExists.java
@@ -18,13 +18,15 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.algebra.Algebra ;
 import org.apache.jena.sparql.algebra.Op ;
 import org.apache.jena.sparql.core.Substitute ;
 import org.apache.jena.sparql.engine.QueryIterator ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.graph.NodeTransformLib ;
 import org.apache.jena.sparql.sse.Tags ;
 import org.apache.jena.sparql.syntax.Element ;
@@ -57,7 +59,7 @@ public class E_NotExists extends ExprFunctionOp
     }
 
     @Override
-    public Expr applyNodeTransform(NodeTransform nodeTransform)
+    public Expr applyNodeTransform(Function<Node, Node> nodeTransform)
     {
         Op op2 = NodeTransformLib.transform(nodeTransform, getGraphPattern()) ;
         return new E_NotExists(getElement(), op2) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/Expr.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/Expr.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/Expr.java
index 026b897..124a842 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/Expr.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/Expr.java
@@ -20,13 +20,14 @@ package org.apache.jena.sparql.expr;
 
 import java.util.Collection ;
 import java.util.Set ;
+import java.util.function.Function;
 
 import javax.xml.datatype.DatatypeConstants ;
 
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 public interface Expr
 {
@@ -63,7 +64,7 @@ public interface Expr
     /**
      * Rewrite, applying a node->node transformation
      */
-    public Expr applyNodeTransform(NodeTransform transform) ;
+    public Expr applyNodeTransform(Function<Node, Node> transform) ;
 
     /** Deep copy */
     public Expr deepCopy() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprAggregator.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprAggregator.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprAggregator.java
index 8db9b01..5f1794e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprAggregator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprAggregator.java
@@ -19,6 +19,9 @@
 package org.apache.jena.sparql.expr;
 
 import static org.apache.jena.atlas.lib.Lib.equal ;
+
+import java.util.function.Function;
+
 import org.apache.jena.atlas.lib.Lib ;
 import org.apache.jena.atlas.logging.Log ;
 import org.apache.jena.graph.Node ;
@@ -27,7 +30,6 @@ import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.expr.aggregate.Aggregator ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.serializer.SerializationContext ;
 
 /** Group aggregation functions calculated a value during grouping and
@@ -107,10 +109,10 @@ public class ExprAggregator extends ExprNode
     }
     
     @Override
-    public ExprAggregator applyNodeTransform(NodeTransform transform)
+    public ExprAggregator applyNodeTransform(Function<Node, Node> transform)
     {
         // Can't rewrite this to a non-variable.
-        Node node = transform.convert(var) ;
+        Node node = transform.apply(var) ;
         if ( ! Var.isVar(node) )
         {
             Log.warn(this, "Attempt to convert an aggregation variable to a non-variable: ignored") ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction0.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction0.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction0.java
index 8593147..696393c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction0.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction0.java
@@ -18,9 +18,11 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 /** An expression that is constant (does not depend on evaluating a sub expression). */
 
@@ -53,7 +55,7 @@ public abstract class ExprFunction0 extends ExprFunction
     public abstract NodeValue eval(FunctionEnv env)  ;
     
     @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
+    final public Expr applyNodeTransform(Function<Node, Node> transform)
     {
         // Nothing to transform. 
         return copy() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction1.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction1.java
index 97901ef..e55548d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction1.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction1.java
@@ -18,10 +18,12 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
 import org.apache.jena.atlas.lib.Lib ;
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 /** A function that has a single argument */
  
@@ -84,7 +86,7 @@ public abstract class ExprFunction1 extends ExprFunction
     }
 
     @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
+    final public Expr applyNodeTransform(Function<Node, Node> transform)
     {
         Expr e = (expr == null ? null : expr.applyNodeTransform(transform)) ;
         return copy(e) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction2.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction2.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction2.java
index 4883ad9..79a824f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction2.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction2.java
@@ -18,10 +18,12 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
 import org.apache.jena.atlas.lib.Lib ;
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 
 /** A function of two arguments */
@@ -95,7 +97,7 @@ public abstract class ExprFunction2 extends ExprFunction
     
 
     @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
+    final public Expr applyNodeTransform(Function<Node, Node> transform)
     {
         Expr e1 = (expr1 == null ? null : expr1.applyNodeTransform(transform)) ;
         Expr e2 = (expr2 == null ? null : expr2.applyNodeTransform(transform)) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction3.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction3.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction3.java
index 82d842f..f6d9a41 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction3.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunction3.java
@@ -18,10 +18,12 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
 import org.apache.jena.atlas.lib.Lib ;
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 
 /** A function of three arguments */
@@ -105,7 +107,7 @@ public abstract class ExprFunction3 extends ExprFunction
     
 
     @Override
-    final public Expr applyNodeTransform(NodeTransform transform)
+    final public Expr applyNodeTransform(Function<Node, Node> transform)
     {
         Expr e1 = (expr1 == null ? null : expr1.applyNodeTransform(transform)) ;
         Expr e2 = (expr2 == null ? null : expr2.applyNodeTransform(transform)) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunctionN.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunctionN.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunctionN.java
index 720f79d..d2cf110 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunctionN.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprFunctionN.java
@@ -20,10 +20,11 @@ package org.apache.jena.sparql.expr;
 
 import java.util.ArrayList ;
 import java.util.List ;
+import java.util.function.Function;
 
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 /** A function which takes N arguments (N may be variable e.g. regex) */
  
@@ -81,7 +82,7 @@ public abstract class ExprFunctionN extends ExprFunction
     }
 
     @Override
-    public Expr applyNodeTransform(NodeTransform transform)
+    public Expr applyNodeTransform(Function<Node, Node> transform)
     {
         ExprList newArgs = new ExprList() ;
         for ( int i = 1 ; i <= numArgs() ; i++ )

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprList.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprList.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprList.java
index 03ab237..d526bba 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprList.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprList.java
@@ -19,11 +19,12 @@
 package org.apache.jena.sparql.expr;
 
 import java.util.* ;
+import java.util.function.Function;
 
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.ExecutionContext ;
 import org.apache.jena.sparql.engine.binding.Binding ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.util.Context ;
 
 public class ExprList implements Iterable<Expr>
@@ -76,7 +77,7 @@ public class ExprList implements Iterable<Expr>
     /**
      * Rewrite, applying a node->node transformation
      */
-    public ExprList applyNodeTransform(NodeTransform transform) {
+    public ExprList applyNodeTransform(Function<Node, Node> transform) {
         ExprList x = new ExprList() ;
         for ( Expr e : expressions)
             x.add(e.applyNodeTransform(transform));

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprNode.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprNode.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprNode.java
index 680bdf8..87eec7f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprNode.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprNode.java
@@ -20,13 +20,14 @@ package org.apache.jena.sparql.expr;
 
 import java.util.Collection ;
 import java.util.Set ;
+import java.util.function.Function;
 
+import org.apache.jena.graph.Node;
 import org.apache.jena.sparql.algebra.Op ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.expr.nodevalue.XSDFuncOp ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.util.ExprUtils ;
 
 
@@ -85,7 +86,7 @@ public abstract class ExprNode implements Expr
     public abstract Expr copySubstitute(Binding binding) ;
     
     @Override
-    public abstract Expr applyNodeTransform(NodeTransform transform) ;
+    public abstract Expr applyNodeTransform(Function<Node, Node> transform) ;
 
         
     // ---- Default implementations

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprVar.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprVar.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprVar.java
index fc45447..a1a589f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprVar.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ExprVar.java
@@ -18,6 +18,8 @@
 
 package org.apache.jena.sparql.expr;
 
+import java.util.function.Function;
+
 import org.apache.jena.atlas.io.IndentedWriter ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.query.Query ;
@@ -25,7 +27,6 @@ import org.apache.jena.sparql.ARQInternalErrorException ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
 /** An expression that is a variable in an expression. */
  
@@ -75,9 +76,9 @@ public class ExprVar extends ExprNode
     }
     
     @Override
-    public Expr applyNodeTransform(NodeTransform transform)
+    public Expr applyNodeTransform(Function<Node, Node> transform)
     {
-        Node node = transform.convert(varNode) ;
+        Node node = transform.apply(varNode) ;
         if ( Var.isVar(node))
             return new ExprVar(Var.alloc(node)) ;
         return NodeValue.makeNode(node) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
index 10cfde5..d960de1 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValue.java
@@ -51,6 +51,7 @@ import java.util.Calendar ;
 import java.util.Iterator ;
 import java.util.Properties ;
 import java.util.ServiceLoader ;
+import java.util.function.Function;
 
 import javax.xml.datatype.DatatypeConfigurationException ;
 import javax.xml.datatype.DatatypeFactory ;
@@ -75,7 +76,6 @@ import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.expr.nodevalue.* ;
 import org.apache.jena.sparql.function.FunctionEnv ;
 import org.apache.jena.sparql.graph.NodeConst ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.serializer.SerializationContext ;
 import org.apache.jena.sparql.util.* ;
 import org.apache.jena.vocabulary.RDF ;
@@ -468,10 +468,10 @@ public abstract class NodeValue extends ExprNode
     }
     
     @Override
-    public Expr applyNodeTransform(NodeTransform transform)
+    public Expr applyNodeTransform(Function<Node, Node> transform)
     { 
         Node n = asNode() ;
-        n = transform.convert(n) ;
+        n = transform.apply(n) ;
         return makeNode(n) ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/Aggregator.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/Aggregator.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/Aggregator.java
index 67b016c..553202c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/Aggregator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/Aggregator.java
@@ -18,9 +18,10 @@
 
 package org.apache.jena.sparql.expr.aggregate;
 
+import java.util.function.Function;
+
 import org.apache.jena.graph.Node ;
 import org.apache.jena.sparql.expr.ExprList ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.serializer.SerializationContext ;
 
 /** An Aggregator is the processor for the whole result stream.
@@ -46,7 +47,7 @@ public interface Aggregator
     
     public ExprList getExprList() ;
     public Aggregator copy(ExprList exprs) ;
-    public Aggregator copyTransform(NodeTransform transform) ;
+    public Aggregator copyTransform(Function<Node, Node> transform) ;
     
     @Override
     public int hashCode() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
index cd6d76b..7fb321b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
@@ -21,6 +21,7 @@ package org.apache.jena.sparql.expr.aggregate;
 import java.util.HashMap ;
 import java.util.Locale ;
 import java.util.Map ;
+import java.util.function.Function;
 
 import org.apache.jena.atlas.io.IndentedLineBuffer ;
 import org.apache.jena.graph.Node ;
@@ -29,7 +30,6 @@ import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.expr.Expr ;
 import org.apache.jena.sparql.expr.ExprList ;
 import org.apache.jena.sparql.expr.NodeValue ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.serializer.SerializationContext ;
 import org.apache.jena.sparql.sse.writers.WriterExpr ;
 import org.apache.jena.sparql.util.ExprUtils ;
@@ -86,7 +86,7 @@ public abstract class AggregatorBase implements Aggregator
     public String key() {  return toPrefixString() ; }
     
     @Override
-    public final Aggregator copyTransform(NodeTransform transform)
+    public final Aggregator copyTransform(Function<Node, Node> transform)
     {
         ExprList e = getExprList() ;
         if ( e != null )

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransform.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransform.java b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransform.java
index 724da1e..a22da5f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransform.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransform.java
@@ -18,12 +18,16 @@
 
 package org.apache.jena.sparql.graph;
 
-import org.apache.jena.atlas.iterator.Transform ;
+import java.util.function.Function;
+
 import org.apache.jena.graph.Node ;
 
 /** Convert nodes to nodes - Vars may need to be translated into Vars. */
-public interface NodeTransform extends Transform<Node, Node>
+/**
+ * Prefer {@link Function<Node, Node>}.
+ *
+ */
+@Deprecated
+public interface NodeTransform extends Function<Node, Node>
 {
-    @Override
-    public Node convert(Node node) ;
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformLib.java b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformLib.java
index f585eac..94314c2 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformLib.java
@@ -21,6 +21,7 @@ package org.apache.jena.sparql.graph;
 import java.util.ArrayList ;
 import java.util.Iterator ;
 import java.util.List ;
+import java.util.function.Function;
 
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.graph.Node ;
@@ -37,19 +38,20 @@ import org.apache.jena.sparql.engine.binding.BindingFactory ;
 import org.apache.jena.sparql.engine.binding.BindingMap ;
 import org.apache.jena.sparql.expr.Expr ;
 import org.apache.jena.sparql.expr.ExprList ;
+
 import static org.apache.jena.atlas.lib.Lib.equal ;
 
 public class NodeTransformLib
 {
     /** Do a node->node conversion of an Op - return original BGP for "no change" */
-    public static Op transform(NodeTransform nodeTransform, Op op)
+    public static Op transform(Function<Node, Node> nodeTransform, Op op)
     {
         Transform opTransform = new NodeTransformOp(nodeTransform) ; 
         return Transformer.transform(opTransform, null, op) ;   // No expr transform - we do it ourselves.
     }
     
     /** Do a node->node conversion of a BGP - return original BGP for "no change" */
-    public static BasicPattern transform(NodeTransform nodeTransform, BasicPattern pattern)  
+    public static BasicPattern transform(Function<Node, Node> nodeTransform, BasicPattern pattern)  
     {
         BasicPattern bgp2 = new BasicPattern() ;
         boolean changed = false ;
@@ -66,7 +68,7 @@ public class NodeTransformLib
     }
 
     /** Do a node->node conversion of a QuadPattern - return original QuadPattern for "no change" */
-    public static QuadPattern transform(NodeTransform nodeTransform, QuadPattern pattern)  
+    public static QuadPattern transform(Function<Node, Node> nodeTransform, QuadPattern pattern)  
     {
         QuadPattern qp2 = new QuadPattern() ;
         boolean changed = false ;
@@ -83,18 +85,18 @@ public class NodeTransformLib
     }
 
     /** Do a node->node conversion of a Triple - return original Triple for "no change" */
-    public static Triple transform(NodeTransform nodeTransform, Triple triple)  
+    public static Triple transform(Function<Node, Node> nodeTransform, Triple triple)  
     {
         boolean change = false ;
         Node s = triple.getSubject() ;
         Node p = triple.getPredicate() ;
         Node o = triple.getObject() ;
         
-        Node s1 = nodeTransform.convert(s) ;
+        Node s1 = nodeTransform.apply(s) ;
         if ( s1 != s ) { change = true ; s = s1 ; }
-        Node p1 = nodeTransform.convert(p) ;
+        Node p1 = nodeTransform.apply(p) ;
         if ( p1 != p ) { change = true ; p = p1 ; }
-        Node o1 = nodeTransform.convert(o) ;
+        Node o1 = nodeTransform.apply(o) ;
         if ( o1 != o ) { change = true ; o = o1 ; }
     
         if ( ! change )
@@ -103,7 +105,7 @@ public class NodeTransformLib
     }
 
     /** Do a node->node conversion of a Quad - return original Quad for "no change" */
-    public static Quad transform(NodeTransform nodeTransform, Quad quad)  
+    public static Quad transform(Function<Node, Node> nodeTransform, Quad quad)  
     {
         boolean change = false ;
         Node s = quad.getSubject() ;
@@ -111,13 +113,13 @@ public class NodeTransformLib
         Node o = quad.getObject() ;
         Node g = quad.getGraph() ;
         
-        Node g1 = nodeTransform.convert(g) ;
+        Node g1 = nodeTransform.apply(g) ;
         if ( g1 != g ) { change = true ; g = g1 ; }
-        Node s1 = nodeTransform.convert(s) ;
+        Node s1 = nodeTransform.apply(s) ;
         if ( s1 != s ) { change = true ; s = s1 ; }
-        Node p1 = nodeTransform.convert(p) ;
+        Node p1 = nodeTransform.apply(p) ;
         if ( p1 != p ) { change = true ; p = p1 ; }
-        Node o1 = nodeTransform.convert(o) ;
+        Node o1 = nodeTransform.apply(o) ;
         if ( o1 != o ) { change = true ; o = o1 ; }
     
         if ( ! change )
@@ -125,7 +127,7 @@ public class NodeTransformLib
         return new Quad(g,s,p,o) ;
     }
     
-    public static Table transform(Table table, NodeTransform transform) {
+    public static Table transform(Table table, Function<Node, Node> transform) {
         // Non-streaming rewrite 
         List<Var> vars = transformVars(transform, table.getVars()) ;
         Iterator<Binding> iter = table.rows() ; 
@@ -138,11 +140,11 @@ public class NodeTransformLib
         return new TableData(vars, newRows) ;
     }
     
-    public static Binding transform(Binding b, NodeTransform transform) {
+    public static Binding transform(Binding b, Function<Node, Node> transform) {
         BindingMap b2 = BindingFactory.create() ;
         List<Var> vars = Iter.toList(b.vars()) ;
         for ( Var v : vars ) {
-            Var v2 = (Var)transform.convert(v) ;
+            Var v2 = (Var)transform.apply(v) ;
             b2.add(v2, b.get(v));
         }
         return b2 ;
@@ -151,7 +153,7 @@ public class NodeTransformLib
 
 
     /** Do a node->node conversion of a List&lt;Quad&gt; - return original List&lt;Quad&gt; for "no change" */
-    public static List<Quad> transformQuads(NodeTransform nodeTransform, List<Quad> quads)
+    public static List<Quad> transformQuads(Function<Node, Node> nodeTransform, List<Quad> quads)
     {
         List<Quad> x = new ArrayList<>() ;
         boolean changed = false ; 
@@ -168,14 +170,14 @@ public class NodeTransformLib
     }
 
     /** Do a node->node conversion of a VarExprList - return original VarExprList for "no change" */
-    public static VarExprList transform(NodeTransform nodeTransform, VarExprList varExprList)
+    public static VarExprList transform(Function<Node, Node> nodeTransform, VarExprList varExprList)
     {
         VarExprList varExprList2 = new VarExprList() ;
         boolean changed = false ;
         for ( Var v : varExprList.getVars() )
         {
             Expr expr = varExprList.getExpr(v) ;
-            Var v2 = (Var)nodeTransform.convert(v) ;
+            Var v2 = (Var)nodeTransform.apply(v) ;
             Expr expr2 = ( expr != null ) ? transform(nodeTransform, expr) : null ;
             
             if ( ! equal(v, v2) || ! equal(expr, expr2) )
@@ -187,13 +189,13 @@ public class NodeTransformLib
         return varExprList2 ;
     }
 
-    public static List<Var> transformVars(NodeTransform nodeTransform, List<Var> varList)
+    public static List<Var> transformVars(Function<Node, Node> nodeTransform, List<Var> varList)
     {
         List<Var> varList2 = new ArrayList<>(varList.size()) ;
         boolean changed = false ;
         for ( Var v : varList )
         {
-            Var v2 = (Var)nodeTransform.convert(v) ;
+            Var v2 = (Var)nodeTransform.apply(v) ;
             varList2.add(v2) ;
             if ( !equal(v, v2) )
                 changed = true ;
@@ -203,7 +205,7 @@ public class NodeTransformLib
         return varList2 ;
     }
 
-    public static ExprList transform(NodeTransform nodeTransform, ExprList exprList)
+    public static ExprList transform(Function<Node, Node> nodeTransform, ExprList exprList)
     {
           ExprList exprList2 = new ExprList() ;
           boolean changed = false ;
@@ -218,12 +220,12 @@ public class NodeTransformLib
           return exprList2 ;
     }
 
-    public static Expr transform(NodeTransform nodeTransform, Expr expr)
+    public static Expr transform(Function<Node, Node> nodeTransform, Expr expr)
     {
         return expr.applyNodeTransform(nodeTransform) ;
     }
 
-    public static List<SortCondition> transform(NodeTransform nodeTransform, List<SortCondition> conditions)
+    public static List<SortCondition> transform(Function<Node, Node> nodeTransform, List<SortCondition> conditions)
     {
         List<SortCondition> conditions2 = new ArrayList<>() ;
         boolean same = true ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformOp.java b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformOp.java
index a9f1945..d62d176 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/graph/NodeTransformOp.java
@@ -20,6 +20,7 @@ package org.apache.jena.sparql.graph;
 
 import java.util.ArrayList ;
 import java.util.List ;
+import java.util.function.Function;
 
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -50,8 +51,8 @@ class NodeTransformOp extends TransformCopy
     // Not:
     //   Conditional (no expression)
     
-    private final NodeTransform transform ;
-    NodeTransformOp(NodeTransform transform)
+    private final Function<Node, Node> transform ;
+    NodeTransformOp(Function<Node, Node> transform)
     {
         this.transform = transform ;
     }
@@ -85,9 +86,9 @@ class NodeTransformOp extends TransformCopy
     { 
         TriplePath tp = opPath.getTriplePath() ;
         Node s = tp.getSubject() ;
-        Node s1 = transform.convert(s) ;
+        Node s1 = transform.apply(s) ;
         Node o = tp.getObject() ;
-        Node o1 = transform.convert(o) ;
+        Node o1 = transform.apply(o) ;
         
         if ( s1 == s && o1 == o )
             // No change.
@@ -111,7 +112,7 @@ class NodeTransformOp extends TransformCopy
         // The internal representation is (graph, BGP)
         BasicPattern bgp2 = NodeTransformLib.transform(transform, opQuadPattern.getBasicPattern()) ;
         Node g2 = opQuadPattern.getGraphNode() ;
-        g2 = transform.convert(g2) ;
+        g2 = transform.apply(g2) ;
         
         if ( g2 == opQuadPattern.getGraphNode() && bgp2 == opQuadPattern.getBasicPattern() )
             return super.transform(opQuadPattern) ;
@@ -120,7 +121,7 @@ class NodeTransformOp extends TransformCopy
     
     @Override public Op transform(OpGraph opGraph, Op subOp)
     {
-        Node g2 = transform.convert(opGraph.getNode()) ;
+        Node g2 = transform.apply(opGraph.getNode()) ;
         if ( g2 == opGraph.getNode() )
             return super.transform(opGraph, subOp) ;
         return new OpGraph(g2, subOp) ;
@@ -128,7 +129,7 @@ class NodeTransformOp extends TransformCopy
     
     @Override public Op transform(OpDatasetNames opDatasetNames)
     {
-        Node g2 = transform.convert(opDatasetNames.getGraphNode()) ;
+        Node g2 = transform.apply(opDatasetNames.getGraphNode()) ;
         if ( g2 == opDatasetNames.getGraphNode() )
             return super.transform(opDatasetNames) ;
         return new OpDatasetNames(g2) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.java b/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.java
index 72abe48..85ab116 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.java
@@ -20,14 +20,14 @@ package org.apache.jena.sparql.modify;
 
 import java.util.HashMap ;
 import java.util.Map ;
+import java.util.function.Function;
 
 import org.apache.jena.graph.Node ;
 import org.apache.jena.sparql.ARQConstants ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.core.VarAlloc ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 
-public class NodeTransformBNodesToVariables implements NodeTransform
+public class NodeTransformBNodesToVariables implements Function<Node, Node>
 {
     private VarAlloc varAlloc = new VarAlloc(ARQConstants.allocVarBNodeToVar) ;
     private Map<Node, Var> mapping ;
@@ -38,7 +38,7 @@ public class NodeTransformBNodesToVariables implements NodeTransform
     }
 
     @Override
-    public Node convert(Node node)
+    public Node apply(Node node)
     {
         if ( ! node.isBlank() )
             return node ;

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/modify/TemplateLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/TemplateLib.java b/jena-arq/src/main/java/org/apache/jena/sparql/modify/TemplateLib.java
index 99f9b31..63b5cb4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/TemplateLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/TemplateLib.java
@@ -19,9 +19,10 @@
 package org.apache.jena.sparql.modify;
 
 import java.util.* ;
+import java.util.function.Function;
 
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
+import org.apache.jena.ext.com.google.common.collect.Iterators;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
 import org.apache.jena.graph.Triple ;
@@ -55,28 +56,22 @@ public class TemplateLib
         // The default graph has been set to something else.
         if ( dftGraph != null )
         {
-            Transform<Quad, Quad> nt = new Transform<Quad, Quad>() {
-                @Override
-                public Quad convert(Quad quad)
-                {
-                    if ( ! quad.isDefaultGraph() ) return quad ;
-                    
-                    return new Quad(dftGraph, quad.getSubject(), quad.getPredicate(), quad.getObject()) ;
-                }
-            };
-            quads = Iter.map(quads, nt) ;
-        }
+			quads = Iter
+					.map(quads,
+							q -> (!q.isDefaultGraph()) ? q :
+							new Quad(dftGraph, q.getSubject(), q.getPredicate(), q.getObject()));
+		}
         return quads;
     }
     
     /** Substitute into triple patterns */
     public static Iterator<Triple> calcTriples(final List<Triple> triples, Iterator<Binding> bindings)
     {
-        return Iter.mapMany(bindings, new Transform<Binding, Iterator<Triple>>()
+        return Iterators.concat(Iter.map(bindings, new Function<Binding, Iterator<Triple>>()
         {
             Map<Node, Node> bNodeMap = new HashMap<>() ;
             @Override
-            public Iterator<Triple> convert(final Binding b)
+            public Iterator<Triple> apply(final Binding b)
             {
                 // Iteration is a new mapping of bnodes. 
                 bNodeMap.clear() ;
@@ -94,17 +89,17 @@ public class TemplateLib
                 }
                 return tripleList.iterator();
             }
-        });
+        }));
     }
     
     /** Substitute into quad patterns */
     public static Iterator<Quad> calcQuads(final List<Quad> quads, Iterator<Binding> bindings)
     {
-        return Iter.mapMany(bindings, new Transform<Binding, Iterator<Quad>>()
+        return Iterators.concat(Iter.map(bindings, new Function<Binding, Iterator<Quad>>()
         {
             Map<Node, Node> bNodeMap = new HashMap<>() ;
             @Override
-            public Iterator<Quad> convert(final Binding b)
+            public Iterator<Quad> apply(final Binding b)
             {
                 // Iteration is a new mapping of bnodes. 
                 bNodeMap.clear() ;
@@ -122,7 +117,7 @@ public class TemplateLib
                 }
                 return quadList.iterator();
             }
-        });
+        }));
     }
 
     /** Substitute into a quad, with rewriting of bNodes */ 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
index f0af38f..e97a796 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/modify/UpdateEngineWorker.java
@@ -22,6 +22,7 @@ import static org.apache.jena.sparql.modify.TemplateLib.template ;
 
 import java.util.Iterator ;
 import java.util.List ;
+import java.util.function.Function;
 
 import org.apache.jena.atlas.data.BagFactory ;
 import org.apache.jena.atlas.data.DataBag ;
@@ -50,7 +51,6 @@ import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.engine.binding.BindingRoot ;
 import org.apache.jena.sparql.graph.GraphFactory ;
 import org.apache.jena.sparql.graph.GraphOps ;
-import org.apache.jena.sparql.graph.NodeTransform ;
 import org.apache.jena.sparql.graph.NodeTransformLib ;
 import org.apache.jena.sparql.modify.request.* ;
 import org.apache.jena.sparql.syntax.Element ;
@@ -474,7 +474,7 @@ public class UpdateEngineWorker implements UpdateVisitor
     
     protected static List<Quad> unused_convertBNodesToVariables(List<Quad> quads)
     {
-        NodeTransform bnodesToVariables = new NodeTransformBNodesToVariables() ;
+    		Function<Node, Node> bnodesToVariables = new NodeTransformBNodesToVariables() ;
         return NodeTransformLib.transformQuads(bnodesToVariables, quads) ;
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/path/PathLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/PathLib.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/PathLib.java
index b36ed43..c2db208 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/PathLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/PathLib.java
@@ -21,8 +21,8 @@ package org.apache.jena.sparql.path;
 import java.util.ArrayList ;
 import java.util.Iterator ;
 import java.util.List ;
+import java.util.function.Predicate;
 
-import org.apache.jena.atlas.iterator.Filter ;
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.atlas.lib.Lib ;
 import org.apache.jena.graph.Graph ;
@@ -247,7 +247,7 @@ public class PathLib
         if ( ! subject.isConcrete() || !object.isConcrete() )
             throw new ARQInternalErrorException("Non concrete node for existsPath evaluation") ;
         Iterator<Node> iter = PathEval.eval(graph, subject, path, execCxt.getContext()) ;
-        Filter<Node> filter = new Filter<Node>() { @Override public boolean accept(Node node) { return Lib.equal(node,  object) ; } } ; 
+        Predicate<Node> filter = node -> Lib.equal(node,  object); 
         // See if we got to the node we're interested in finishing at.
         iter = Iter.filter(iter, filter) ;
         long x = Iter.count(iter) ; 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine.java
index 6497bb4..9df5c10 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine.java
@@ -22,9 +22,7 @@ import java.util.ArrayList ;
 import java.util.Collection ;
 import java.util.Iterator ;
 import java.util.List ;
-
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -100,10 +98,10 @@ abstract public class PathEngine
         Iterator<Node> iter2 = null ;
         if ( direction() ) {
             Iter<Triple> iter1 = Iter.iter(graphFind(node, property, Node.ANY)) ;
-            iter2 = iter1.map(PathEngine.selectObject) ;
+            iter2 = iter1.map(Triple::getObject) ;
         } else {
             Iter<Triple> iter1 = Iter.iter(graphFind(Node.ANY, property, node)) ;
-            iter2 = iter1.map(PathEngine.selectSubject) ;
+            iter2 = iter1.map(Triple::getSubject) ;
         }
 
         return iter2 ;
@@ -151,30 +149,15 @@ abstract public class PathEngine
         return (x <= 0) ? x : x - 1 ;
     }
 
-    protected static Transform<Triple, Node> selectSubject = new Transform<Triple, Node>() {
-        @Override
-        public Node convert(Triple triple) { return triple.getSubject() ; }
-    } ;
-    
-    protected static Transform<Triple, Node> selectPredicate = new Transform<Triple, Node>() {
-        @Override
-        public Node convert(Triple triple) { return triple.getPredicate() ; }
-    } ;
-    
-    protected static Transform<Triple, Node> selectObject = new Transform<Triple, Node>() {
-        @Override
-        public Node convert(Triple triple) { return triple.getObject() ; }
-    } ;
-
     protected Iterator<Node> stepExcludeForwards(Node node, List<Node> excludedNodes) {
         Iter<Triple> iter1 = forwardLinks(node, excludedNodes) ;
-        Iter<Node> r1 = iter1.map(selectObject) ;
+        Iter<Node> r1 = iter1.map(Triple::getObject) ;
         return r1 ;
     }
 
     protected Iterator<Node> stepExcludeBackwards(Node node, List<Node> excludedNodes) {
         Iter<Triple> iter1 = backwardLinks(node, excludedNodes) ;
-        Iter<Node> r1 = iter1.map(selectSubject) ;
+        Iter<Node> r1 = iter1.map(Triple::getSubject) ;
         return r1 ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEvaluator.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEvaluator.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEvaluator.java
index 3399dec..242cf9a 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEvaluator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEvaluator.java
@@ -20,8 +20,8 @@ package org.apache.jena.sparql.path.eval ;
 
 import java.util.Collection ;
 import java.util.Iterator ;
+import java.util.function.Predicate;
 
-import org.apache.jena.atlas.iterator.Filter ;
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
@@ -164,7 +164,7 @@ final class PathEvaluator implements PathVisitor
     // Other operations can produce duplicates and so may be executed in
     // different ways depending on cardibnality requirements.
 
-    protected static class FilterExclude implements Filter<Triple>
+    protected static class FilterExclude implements Predicate<Triple>
     {
         private Collection<Node> excludes ;
 
@@ -173,7 +173,7 @@ final class PathEvaluator implements PathVisitor
         }
 
         @Override
-        public boolean accept(Triple triple) {
+        public boolean test(Triple triple) {
             return !excludes.contains(triple.getPredicate()) ;
         }
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/strSplit.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/strSplit.java b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/strSplit.java
index 126728c..86f9331 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/strSplit.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/strSplit.java
@@ -22,7 +22,6 @@ import java.util.Arrays ;
 import java.util.Iterator ;
 
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.lib.StrUtils ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
@@ -61,13 +60,10 @@ public class strSplit extends PFuncSimpleAndList
         
         // StrUtils will also trim whitespace
         String[] tokens = StrUtils.split(s, regex);
-        Iterator<Binding> it = Iter.map(Arrays.asList(tokens).iterator(), new Transform<String,Binding>() {
-            @Override
-            public Binding convert(String item)
-            {
-                return BindingFactory.binding(binding, subjectVar, NodeFactory.createLiteral(item)) ;
-            }
-        });
+		Iterator<Binding> it = Iter.map(
+				Arrays.asList(tokens).iterator(),
+				item -> BindingFactory.binding(binding, subjectVar,
+						NodeFactory.createLiteral(item)));
         return new QueryIterPlainWrapper(it, execCxt);
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/resultset/CSVInput.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/resultset/CSVInput.java b/jena-arq/src/main/java/org/apache/jena/sparql/resultset/CSVInput.java
index 7d6487b..43f6c65 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/resultset/CSVInput.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/resultset/CSVInput.java
@@ -22,10 +22,10 @@ import java.io.InputStream ;
 import java.util.ArrayList ;
 import java.util.Iterator ;
 import java.util.List ;
+import java.util.function.Function;
 
 import org.apache.jena.atlas.csv.CSVParser ;
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.logging.FmtLog ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
@@ -69,10 +69,10 @@ public class CSVInput
         CSVParser parser = CSVParser.create(in) ;
         final List<Var> vars = vars(parser) ;
         List<String> varNames = Var.varNames(vars) ;
-        Transform<List<String>, Binding> transform = new Transform<List<String>, Binding>(){
+        Function<List<String>, Binding> transform = new Function<List<String>, Binding>(){
             private int count = 1 ;
             @Override
-            public Binding convert(List<String> row) {
+            public Binding apply(List<String> row) {
                 if ( row.size() != vars.size() )
                     FmtLog.warn(log, "Row %d: Length=%d: expected=%d", count, row.size(), vars.size()) ;
                 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/resultset/ResultSetCompare.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/resultset/ResultSetCompare.java b/jena-arq/src/main/java/org/apache/jena/sparql/resultset/ResultSetCompare.java
index c11a38c..99413a5 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/resultset/ResultSetCompare.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/resultset/ResultSetCompare.java
@@ -19,9 +19,7 @@
 package org.apache.jena.sparql.resultset;
 
 import java.util.* ;
-
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.lib.Lib ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.query.* ;
@@ -230,7 +228,7 @@ public class ResultSetCompare
     }
 
     static private List<Binding> convert(ResultSet rs) {
-        return Iter.iter(rs).map(qs2b).toList() ;
+        return Iter.iter(rs).map(item -> BindingUtils.asBinding(item)).toList() ;
     }
     
     
@@ -299,14 +297,6 @@ public class ResultSetCompare
         }
         return true ;
     }
-
-    private static Transform<QuerySolution, Binding> qs2b = new Transform<QuerySolution, Binding> () {
-        @Override
-        public Binding convert(QuerySolution item)
-        {
-            return BindingUtils.asBinding(item) ;
-        }
-    } ;
     
     public static class BNodeIso implements EqualityTest
     {

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/util/ModelUtils.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/ModelUtils.java b/jena-arq/src/main/java/org/apache/jena/sparql/util/ModelUtils.java
index 9738b47..48ee0c9 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/ModelUtils.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/ModelUtils.java
@@ -22,7 +22,6 @@ import java.util.Iterator ;
 
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.atlas.iterator.IteratorResourceClosing ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.lib.Closeable ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
@@ -101,14 +100,7 @@ public class ModelUtils
     
     public static StmtIterator triplesToStatements(final Iterator<Triple> it, final Model refModel)
     {
-        return new StmtIteratorImpl(Iter.map(it, new Transform<Triple,Statement>()
-        {
-            @Override
-            public Statement convert(Triple item)
-            {
-                return refModel.asStatement(item);
-            }
-        }))
+        return new StmtIteratorImpl(Iter.map(it, refModel::asStatement))
         {
             // Make sure to close the incoming iterator
             @Override
@@ -128,14 +120,7 @@ public class ModelUtils
     
     public static Iterator<Triple> statementsToTriples(final Iterator<Statement> it)
     {
-        return new IteratorResourceClosing<>(Iter.map(it, new Transform<Statement,Triple>()
-        {
-            @Override
-            public Triple convert(Statement item)
-            {
-                return item.asTriple();
-            }
-        }),
+        return new IteratorResourceClosing<>(Iter.map(it, Statement::asTriple),
         new Closeable()
         {
             @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphList.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphList.java b/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphList.java
index d1dee93..fbc01b4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphList.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/graph/GraphList.java
@@ -24,10 +24,8 @@ import java.util.HashSet ;
 import java.util.Iterator ;
 import java.util.List ;
 import java.util.Set ;
-
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.atlas.iterator.IteratorConcat ;
-import org.apache.jena.atlas.iterator.Transform ;
 import org.apache.jena.atlas.logging.Log ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
@@ -139,13 +137,7 @@ public class GraphList
                 return Iter.nullIterator() ;
         }
         List<Node> x = members(gn) ;
-        Transform<Node, Triple> transform = new Transform<Node, Triple>() {
-            @Override
-            public Triple convert(Node obj) {
-                return Triple.create(s, ListPFunction.nListMember, obj) ;
-            }
-        } ;
-        return Iter.map(x.iterator(), transform) ;
+        return Iter.map(x.iterator(), t -> Triple.create(s, ListPFunction.nListMember, t)) ;
     }
 
     private static boolean isAny(Node x) {
@@ -354,8 +346,6 @@ public class GraphList
 
     private static GNode next(GNode gnode) { return new GNode(gnode, cdr(gnode)) ; }
 
-    private static Node value(GNode gnode) { return car(gnode) ; }
-
     public static boolean isListNode (GNode gnode)
     { return gnode.node.equals(NIL) || isCons(gnode) ; }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/6b475345/jena-arq/src/test/java/org/apache/jena/riot/process/TestNormalization.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/process/TestNormalization.java b/jena-arq/src/test/java/org/apache/jena/riot/process/TestNormalization.java
index 1d62f2a..20cf455 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/process/TestNormalization.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/process/TestNormalization.java
@@ -103,7 +103,7 @@ public class TestNormalization extends BaseTest
         Node n1 = NodeFactoryExtra.parseNode(input) ;
         assertTrue("Invalid lexical form", n1.getLiteralDatatype().isValid(n1.getLiteralLexicalForm()));
         
-        Node n2 = CanonicalizeLiteral.get().convert(n1) ;
+        Node n2 = CanonicalizeLiteral.get().apply(n1) ;
         Node n3 = NodeFactoryExtra.parseNode(expected) ;
         assertEquals("Invalid canonicalization (lex)", n3.getLiteralLexicalForm(), n2.getLiteralLexicalForm()) ;
         assertEquals("Invalid canonicalization (node)", n3, n2) ;
@@ -115,7 +115,7 @@ public class TestNormalization extends BaseTest
     private static void normalizeLang(String input, String expected, boolean correct)
     {
         Node n1 = NodeFactoryExtra.parseNode(input) ;
-        Node n2 = CanonicalizeLiteral.get().convert(n1) ;
+        Node n2 = CanonicalizeLiteral.get().apply(n1) ;
         Node n3 = NodeFactoryExtra.parseNode(expected) ;
         if ( correct )
         {


Mime
View raw message