Merge pull request #751 from afs/rdf-star-2

JENA-1899: RDF* (Part 2)
diff --git a/.travis.yml b/.travis.yml
index 753ab49..068d887 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,4 +6,4 @@
   - openjdk8
   - openjdk11
 env:
-  - JAVA_OPTS="-Xmx3072M -Xms512M -XX:+UseG1GC"
+  - JAVA_OPTS="-Xmx3072M -Xms512M"
diff --git a/jena-arq/Grammar/BinaryRDF.thrift b/jena-arq/Grammar/BinaryRDF.thrift
index e695472..458d6ca 100644
--- a/jena-arq/Grammar/BinaryRDF.thrift
+++ b/jena-arq/Grammar/BinaryRDF.thrift
@@ -76,6 +76,8 @@
 6: RDF_ANY          any
 7: RDF_UNDEF        undefined
 8: RDF_REPEAT       repeat
+9: RDF_Triple       tripleTerm  # RDF*
+
 # Value forms of literals.
 10: i64             valInteger
 11: double          valDouble
diff --git a/jena-arq/Grammar/arq.jj b/jena-arq/Grammar/arq.jj
index c6c0252..11080aa 100644
--- a/jena-arq/Grammar/arq.jj
+++ b/jena-arq/Grammar/arq.jj
@@ -625,6 +625,8 @@
  |
    el = InlineData()
  |
+   el = Find()
+ |
    el = Assignment()
  |
    el = ExistsElt()
@@ -662,6 +664,16 @@
   <RPAREN>
   { return new ElementBind(v, expr) ; }
 }
+Element Find() : { Var v ; Node n; }
+{
+  <FIND>
+  <LPAREN>
+  n = TripleTerm()
+  <AS>
+  v = Var()
+  <RPAREN>
+  { return new ElementFind(v, n) ; }
+}
 Element InlineData() : { ElementData el ; Token t ; }
 {
   t = <VALUES>
@@ -676,16 +688,17 @@
 {
   ( InlineDataOneVar() | InlineDataFull() )
 }
-void InlineDataOneVar() : { Var v ; Node n ; Token t ; }
+void InlineDataOneVar() : { Var v ; Node n ; Token t ; ; int beginLine; int beginColumn; }
 {
   v = Var()
   { emitDataBlockVariable(v) ; }
   t = <LBRACE>
+  { beginLine = t.beginLine; beginColumn = t.beginColumn; t = null; }
   (
     n = DataBlockValue()
-    { startDataBlockValueRow(-1, -1) ;
-      emitDataBlockValue(n, -1, -1) ;
-      finishDataBlockValueRow(-1, -1) ;
+    { startDataBlockValueRow(beginLine, beginColumn) ;
+      emitDataBlockValue(n, beginLine, beginColumn) ;
+      finishDataBlockValueRow(beginLine, beginColumn) ;
     }
   )*
   t = <RBRACE>
@@ -724,7 +737,7 @@
 | n = RDFLiteral() { return n ; }
 | n = NumericLiteral() { return n ; }
 | n = BooleanLiteral() { return n ; }
-| n = BlankNode() { return n ; }
+| n = TripleTerm() { return n ; }
 | <UNDEF> { return null ; }
 }
 Element Assignment() : { Var v ; Expr expr ; }
@@ -1158,20 +1171,24 @@
  |
   n = TriplesNodePath(acc) { return n ; }
 }
-Node VarOrTerm() : { Node n = null ; Token t = null; Node s , p , o ; }
+Node VarOrTerm() : { Node n = null ; }
 {
-  (
-    t = <LT2>
-    s = VarOrTerm()
-    p = Verb()
-    o = VarOrTerm()
-    { n = createTripleTerm(s,p,o); }
-    <GT2>
+  ( n = TripleTerm()
   | n = Var()
   | n = GraphTerm()
   )
   { return n ; }
 }
+Node TripleTerm() : { Node n = null ; Token t ; Node s , p , o ; }
+{
+  t = <LT2>
+  s = VarOrTerm()
+  p = Verb()
+  o = VarOrTerm()
+  { n = createTripleTerm(s, p, o, t.beginLine, t.beginColumn); }
+  <GT2>
+  { return n; }
+}
 Node VarOrIri() : {Node n = null ; String iri ; }
 {
   ( n = Var() | iri = iri() { n = createNode(iri) ; } )
@@ -1686,6 +1703,7 @@
 | < BIND: "bind" >
 | < SERVICE: "service" >
 | < LET: "let" >
+| < FIND: "find" >
 | < EXISTS: "exists" >
 | < NOT: "not" >
 | < AS: "as" >
diff --git a/jena-arq/Grammar/gen-thrift b/jena-arq/Grammar/gen-thrift
index b9ae9c1..ee20688 100755
--- a/jena-arq/Grammar/gen-thrift
+++ b/jena-arq/Grammar/gen-thrift
@@ -16,6 +16,7 @@
 
 for f in "$PKG"/*.java
 do
-    perl -i.bak -p -e 's/^public (class|enum)/\@SuppressWarnings("all")\npublic $1/' $f
+##    perl -i.bak -p -e 's/^public (class|enum)/\@SuppressWarnings("all")\npublic $1/' $f
+    perl -i.bak -p -e 's/^\@SuppressWarnings.*$/\@SuppressWarnings("all")/' $f
     rm -f $f.bak
 done
diff --git a/jena-arq/Grammar/master.jj b/jena-arq/Grammar/master.jj
index edf80df..5fdd7bd 100644
--- a/jena-arq/Grammar/master.jj
+++ b/jena-arq/Grammar/master.jj
@@ -894,6 +894,9 @@
    el = InlineData()
 #ifdef ARQ
  |
+   //el = BindOrFind()
+   el = Find()
+ |
    el = Assignment()
  |
    el = ExistsElt()
@@ -940,6 +943,32 @@
   { return new ElementBind(v, expr) ; }
 }
 
+#ifdef ARQ
+// To follow RDF* paper using the overloaded "BIND" syntax.
+// Also make Bind() above in GraphPatternNotTriples SPARQL 1.1 only.
+// Element BindOrFind() : {  Var v ; Expr expr = null ; Node n = null ; }
+// {
+//   <BIND>
+//   <LPAREN>
+//   ( expr = Expression() |  n = TripleTerm() )
+//    <AS>
+//   v = Var()
+//   <RPAREN>
+//   { return expr != null ? new ElementBind(v, expr) : new ElementFind(v, n); }
+// }
+
+Element Find() : { Var v ; Node n; }
+{
+  <FIND>
+  <LPAREN>
+  n = TripleTerm()
+  <AS>
+  v = Var()
+  <RPAREN>
+  { return new ElementFind(v, n) ; }
+}
+#endif
+
 Element InlineData() : { ElementData el ; Token t ; }
 {
   t = <VALUES>
@@ -956,16 +985,17 @@
   ( InlineDataOneVar() |  InlineDataFull() )
 }
 
-void InlineDataOneVar() : { Var v ; Node n ; Token t ; }
+void InlineDataOneVar() : { Var v ; Node n ; Token t ; ; int beginLine; int beginColumn; }
 {
   v = Var()
   { emitDataBlockVariable(v) ; }
   t = <LBRACE>
+  { beginLine = t.beginLine; beginColumn = t.beginColumn; t = null; }
   ( 
-    n = DataBlockValue() 
-    { startDataBlockValueRow(-1, -1) ;
-      emitDataBlockValue(n, -1, -1) ;
-      finishDataBlockValueRow(-1, -1) ;
+    n = DataBlockValue()
+    { startDataBlockValueRow(beginLine, beginColumn) ;
+      emitDataBlockValue(n, beginLine, beginColumn) ;
+      finishDataBlockValueRow(beginLine, beginColumn) ;
     }
   )*
   t = <RBRACE>
@@ -1007,7 +1037,7 @@
 | n = NumericLiteral()  { return n ; }
 | n = BooleanLiteral()  { return n ; }
 #ifdef ARQ
-| n = BlankNode()       { return n ; }
+| n = TripleTerm()      { return n ; }
 #endif
 | <UNDEF>               { return null ; }
 }
@@ -1624,23 +1654,27 @@
 #endif
 #ifdef ARQ
 // RDF* Triple as term.
-Node VarOrTerm() : { Node n = null ; Token t = null; Node s , p , o ; }
+Node VarOrTerm() : { Node n = null ; }
 {
-  (
-    t = <LT2>
-    s = VarOrTerm()
-    p = Verb()
-    o = VarOrTerm()
-    { n = createTripleTerm(s,p,o); }
-    <GT2>
+  ( n = TripleTerm()
   | n = Var()
   | n = GraphTerm()
   )
   { return n ; }
 }
 
-#endif
+Node TripleTerm() :  { Node n = null ; Token t ; Node s , p , o ; }
+{
+  t = <LT2>
+  s = VarOrTerm()
+  p = Verb()
+  o = VarOrTerm()
+  { n = createTripleTerm(s, p, o, t.beginLine, t.beginColumn); }
+  <GT2>
+  { return n; }
+}
 
+#endif
 
 // e.g. Property (if no bNodes) + DESCRIBE
 Node VarOrIri() : {Node n = null ; String iri ; }
@@ -2372,6 +2406,7 @@
 
 #ifdef ARQ
 |  < LET:         "let" >
+|  < FIND:        "find" >
 #endif
 |  < EXISTS:      "exists" >
 |  < NOT:         "not" >
diff --git a/jena-arq/Grammar/sparql_11.jj b/jena-arq/Grammar/sparql_11.jj
index 0da06d9..49cce0f 100644
--- a/jena-arq/Grammar/sparql_11.jj
+++ b/jena-arq/Grammar/sparql_11.jj
@@ -595,16 +595,17 @@
 {
   ( InlineDataOneVar() | InlineDataFull() )
 }
-void InlineDataOneVar() : { Var v ; Node n ; Token t ; }
+void InlineDataOneVar() : { Var v ; Node n ; Token t ; ; int beginLine; int beginColumn; }
 {
   v = Var()
   { emitDataBlockVariable(v) ; }
   t = <LBRACE>
+  { beginLine = t.beginLine; beginColumn = t.beginColumn; t = null; }
   (
     n = DataBlockValue()
-    { startDataBlockValueRow(-1, -1) ;
-      emitDataBlockValue(n, -1, -1) ;
-      finishDataBlockValueRow(-1, -1) ;
+    { startDataBlockValueRow(beginLine, beginColumn) ;
+      emitDataBlockValue(n, beginLine, beginColumn) ;
+      finishDataBlockValueRow(beginLine, beginColumn) ;
     }
   )*
   t = <RBRACE>
diff --git a/jena-arq/Grammar/sse/sse.jj b/jena-arq/Grammar/sse/sse.jj
index 92ce812..c913151 100644
--- a/jena-arq/Grammar/sse/sse.jj
+++ b/jena-arq/Grammar/sse/sse.jj
@@ -195,7 +195,7 @@
 
 void TripleTerm() :     { Token t1 = null ; Token t2 = null ; }
 {
-    t1 = <LBRACE> // "{"
+    t1 = <LT2>
     (<WS>)*
     { tripleTermStart(t1.beginLine, t1.beginColumn); }
     RDFTerm()
@@ -204,7 +204,7 @@
     (<WS>)*
     RDFTerm()
     (<WS>)*
-    t2 = <RBRACE>
+    t2 = <GT2>
     { tripleTermFinish(t2.beginLine, t2.beginColumn); }
 }
 
diff --git a/jena-arq/Grammar/sse/tokens.inc b/jena-arq/Grammar/sse/tokens.inc
index 87b21e0..0480cdb 100644
--- a/jena-arq/Grammar/sse/tokens.inc
+++ b/jena-arq/Grammar/sse/tokens.inc
@@ -98,6 +98,9 @@
 
 | < LBRACKET:  "[" >
 | < RBRACKET:  "]" >
+
+| < LT2 : "<<" >
+| < GT2 : ">>" >
 }
 
 // Specials for literals trailing parts
@@ -149,13 +152,15 @@
   // Excludes:
   //   LPAREN and RPAREN / LBRACKET/RBRACKET / LBRACE/RBRACE
   //   Quotes, Whitespace
-  <#SYM:  (~["(", ")", "[", "]", "{", "}", "'", "\"", " ", "\t","\n","\r","\f" ])>
+  <#SYM:  (~["<", ">", "(", ")", "[", "]", "{", "}", "'", "\"", " ", "\t","\n","\r","\f" ])>
 |
   <#SYM1: (~["^", "@",
              "(", ")", "[", "]", "{", "}", "'", "\"", " ", "\t","\n","\r","\f" ])>
 | <#SYM_ESC: "\\" ( " " | "'" | "\"" ) >
 |
-  <SYMBOL: <SYM1> (<SYM>)*>
+  <SYMBOL: ( "<" | ">" 
+           | (<SYM1> (<SYM>)*)
+           ) >
 }
 
 // Catch-all tokens.  Must be last.  
diff --git a/jena-arq/Vocabularies/test-manifest-x.ttl b/jena-arq/Vocabularies/test-manifest-x.ttl
index b2162ae..26c577f 100644
--- a/jena-arq/Vocabularies/test-manifest-x.ttl
+++ b/jena-arq/Vocabularies/test-manifest-x.ttl
@@ -29,6 +29,13 @@
     rdfs:subClassOf :TestSyntax ;
     rdfs:comment "Syntax tests which expect a parse failure" .
 
+:PositiveUpdateSyntaxTestARQ rdf:type rdfs:Class ;
+    rdfs:comment "Syntax tests (query)" .
+
+:NegativeUpdateSyntaxTestARQ rdf:type rdfs:Class ;
+    rdfs:subClassOf :TestSyntax ;
+    rdfs:comment "Syntax tests which expect a parse failure" .
+
 :TestSerialization rdf:type rdfs:Class ;
     rdfs:comment "Query serialization tests" .
 
diff --git a/jena-arq/src/main/java/org/apache/jena/query/Query.java b/jena-arq/src/main/java/org/apache/jena/query/Query.java
index bfe51b6..933b85b 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/Query.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/Query.java
@@ -131,12 +131,9 @@
     }
 
     // Allocate variables that are unique to this query.
-    private VarAlloc varAlloc = new VarAlloc(ARQConstants.allocVarMarker) ;
+    private VarAlloc varAlloc = new VarAlloc(ARQConstants.allocQueryVariables) ;
     private Var allocInternVar() { return varAlloc.allocVar() ; }
 
-    //private VarAlloc varAnonAlloc = new VarAlloc(ARQConstants.allocVarAnonMarker) ;
-    //public Var allocVarAnon() { return varAnonAlloc.allocVar() ; }
-
     public void setQuerySelectType()            { queryType = QueryType.SELECT ; }
     public void setQueryConstructType()         { queryType = QueryType.CONSTRUCT ; queryResultStar = true ; }
     public void setQueryDescribeType()          { queryType = QueryType.DESCRIBE; }
diff --git a/jena-arq/src/main/java/org/apache/jena/query/Syntax.java b/jena-arq/src/main/java/org/apache/jena/query/Syntax.java
index 7a68a6d..71038c4 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/Syntax.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/Syntax.java
@@ -51,32 +51,32 @@
                 = new Syntax("http://jena.hpl.hp.com/2003/07/query/SPARQL_Algebra") ;
     
     /** The system default syntax */ 
-    public static Syntax defaultSyntax = syntaxSPARQL_11 ;
+    public static Syntax defaultSyntax = syntaxARQ;
     
     /** The name of the default query language for query parsing.
      *  The default query language syntax must be capable of accepting
      *  any SPARQL query but may also accept extensions. 
      */
-    public static Syntax defaultQuerySyntax = syntaxSPARQL_11 ;
+    public static Syntax defaultQuerySyntax = defaultSyntax;
     
     /** The name of the default update language for update parsing.
      *  The default update language syntax must be capable of accepting
      *  any SPARQL query but may also accept extensions. 
      */
-    public static Syntax defaultUpdateSyntax = syntaxSPARQL_11 ;
+    public static Syntax defaultUpdateSyntax = defaultSyntax;
     
-    /** The query syntax currently that is standardized, published, SPARQL - the "default SPARQL Query" */ 
+    /** The query syntax currently that is standardized, published, SPARQL Query */ 
     public static final Syntax syntaxSPARQL = syntaxSPARQL_11 ;
 
-//    /** The update syntax currently that is standardized, published, SPARQL - the "default SPARQL Update" */ 
+//    /** The update syntax currently that is standardized, published, SPARQL Update */ 
 //    private static final Syntax syntaxSPARQL_Update = syntaxSPARQL_11_Update ;
 
     public static TranslationTable<Syntax> querySyntaxNames = new TranslationTable<>(true) ;
     static {
         querySyntaxNames.put("sparql",      syntaxSPARQL) ;
-        querySyntaxNames.put("sparql10",   syntaxSPARQL_10) ;
+        querySyntaxNames.put("sparql10",    syntaxSPARQL_10) ;
         querySyntaxNames.put("sparql_10",   syntaxSPARQL_10) ;
-        querySyntaxNames.put("sparql11",   syntaxSPARQL_11) ;
+        querySyntaxNames.put("sparql11",    syntaxSPARQL_11) ;
         querySyntaxNames.put("sparql_11",   syntaxSPARQL_11) ;
         querySyntaxNames.put("arq",         syntaxARQ) ;
         querySyntaxNames.put("alg",         syntaxAlgebra) ;
@@ -109,20 +109,17 @@
         return null ;
     }
     
-    
-    public static Syntax guessFileSyntax(String url) 
-    {
-        return guessFileSyntax(url, syntaxSPARQL) ;
+    public static Syntax guessFileSyntax(String url) {
+        return guessFileSyntax(url, defaultQuerySyntax) ;
     }
 
     /** Guess the syntax (query and update) based on filename */
-    public static Syntax guessFileSyntax(String url, Syntax defaultSyntax)
-    {
+    public static Syntax guessFileSyntax(String url, Syntax defaultSyntax) {
         if ( url.endsWith(".arq") )     return syntaxARQ ;
-        if ( url.endsWith(".rq") )      return syntaxSPARQL ;
+        if ( url.endsWith(".rq") )      return defaultQuerySyntax ;
 
         if ( url.endsWith(".aru") )     return syntaxARQ ;
-        if ( url.endsWith(".ru") )      return syntaxSPARQL_11 ;
+        if ( url.endsWith(".ru") )      return defaultUpdateSyntax ;
         
         if ( url.endsWith(".sse") )     return syntaxAlgebra ;
         
@@ -141,7 +138,7 @@
     public static Syntax guessQueryFileSyntax(String url, Syntax defaultSyntax)
     {
         if ( url.endsWith(".arq") )     return syntaxARQ ;
-        if ( url.endsWith(".rq") )      return syntaxSPARQL ;
+        if ( url.endsWith(".rq") )      return defaultQuerySyntax ;
         if ( url.endsWith(".sse") )     return syntaxAlgebra ;
         return defaultSyntax ;
     }
@@ -157,7 +154,7 @@
     public static Syntax guessUpdateFileSyntax(String url, Syntax defaultSyntax)
     {
         if ( url.endsWith(".aru") )     return syntaxARQ ;
-        if ( url.endsWith(".ru") )      return syntaxSPARQL_11 ;
+        if ( url.endsWith(".ru") )      return defaultQuerySyntax ;
         if ( url.endsWith(".sse") )     return syntaxAlgebra ;
         return defaultSyntax ;
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/out/NodeFmtLib.java b/jena-arq/src/main/java/org/apache/jena/riot/out/NodeFmtLib.java
index 579501d..ecc1393 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/out/NodeFmtLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/out/NodeFmtLib.java
@@ -18,22 +18,23 @@
 
 package org.apache.jena.riot.out;
 
-import java.net.MalformedURLException ;
-import java.util.Map ;
+import java.net.MalformedURLException;
+import java.util.Map;
+import java.util.StringJoiner;
 
-import org.apache.jena.atlas.io.IndentedLineBuffer ;
-import org.apache.jena.atlas.io.IndentedWriter ;
-import org.apache.jena.atlas.lib.Bytes ;
-import org.apache.jena.atlas.lib.Chars ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.iri.IRI ;
-import org.apache.jena.iri.IRIRelativize ;
-import org.apache.jena.rdf.model.RDFNode ;
-import org.apache.jena.riot.system.* ;
-import org.apache.jena.shared.PrefixMapping ;
-import org.apache.jena.sparql.ARQConstants ;
-import org.apache.jena.sparql.core.Quad ;
+import org.apache.jena.atlas.io.IndentedLineBuffer;
+import org.apache.jena.atlas.io.IndentedWriter;
+import org.apache.jena.atlas.lib.Bytes;
+import org.apache.jena.atlas.lib.Chars;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.iri.IRI;
+import org.apache.jena.iri.IRIRelativize;
+import org.apache.jena.rdf.model.RDFNode;
+import org.apache.jena.riot.system.*;
+import org.apache.jena.shared.PrefixMapping;
+import org.apache.jena.sparql.ARQConstants;
+import org.apache.jena.sparql.core.Quad;
 
 /** Presentation utilities for Nodes, Triples, Quads and more.
  * <p>
@@ -48,98 +49,98 @@
     // See OutputLangUtils.
     // See and use EscapeStr
     
-    private static final NodeFormatter plainFormatter = new NodeFormatterNT() ;
+    private static final NodeFormatter plainFormatter = new NodeFormatterNT();
     
-    private static PrefixMap dftPrefixMap = PrefixMapFactory.create() ;
+    private static PrefixMap dftPrefixMap = PrefixMapFactory.create();
     static {
-        PrefixMapping pm = ARQConstants.getGlobalPrefixMap() ;
-        Map<String, String> map = pm.getNsPrefixMap() ;
+        PrefixMapping pm = ARQConstants.getGlobalPrefixMap();
+        Map<String, String> map = pm.getNsPrefixMap();
         for ( Map.Entry<String, String> e : map.entrySet() )
-            dftPrefixMap.add(e.getKey(), e.getValue() ) ;
+            dftPrefixMap.add(e.getKey(), e.getValue() );
     }
 
-    public static String str(Triple t)
-    {
-        return strNodes(t.getSubject(), t.getPredicate(),t.getObject()) ;
+    public static String str(Triple t) {
+        return strNodes(t.getSubject(), t.getPredicate(), t.getObject());
     }
 
-    public static String str(Quad q)
-    {
-        return strNodes(q.getGraph(), q.getSubject(), q.getPredicate(), q.getObject()) ;
+    public static String str(Quad q) {
+        return strNodes(q.getGraph(), q.getSubject(), q.getPredicate(), q.getObject());
     }
 
-    public static String str(Node n)
-    {
-        IndentedLineBuffer sw = new IndentedLineBuffer() ;
-        str(sw, n) ;
-        return sw.toString() ; 
+    public static String str(Node n) {
+        IndentedLineBuffer sw = new IndentedLineBuffer();
+        str(sw, n);
+        return sw.toString();
+    }
+
+    // Worker
+    public static String strNodes(Node...nodes) {
+        IndentedLineBuffer sw = new IndentedLineBuffer();
+        boolean first = true;
+        for ( Node n : nodes ) {
+            if ( !first )
+                sw.append(" ");
+            first = false;
+            if ( n == null ) {
+                sw.append("null");
+                continue;
+            }
+            str(sw, n);
+        }
+        return sw.toString();
     }
 
     /** A displayable string for an RDFNode. Includes common abbreviations */
-    public static String displayStr(RDFNode obj)
-    {
-        return displayStr(obj.asNode()) ;
-    }
-    
-    public static String displayStr(Node n)
-    { 
-        return str(n, null, dftPrefixMap) ;
+    public static String displayStr(RDFNode obj) {
+        return displayStr(obj.asNode());
     }
 
-    
-    // Worker
-    public static String strNodes(Node ... nodes)
-    {
-        IndentedLineBuffer sw = new IndentedLineBuffer() ;
-        boolean first = true ;
+    public static String displayStr(Triple t) {
+        return displayStrNodes(t.getSubject(), t.getPredicate(), t.getObject());
+    }
+
+    public static String displayStr(Node n) {
+        return str(n, null, dftPrefixMap);
+    }
+
+    private static String displayStrNodes(Node...nodes) {
+        StringJoiner sj = new StringJoiner(" ");
         for ( Node n : nodes ) 
-        {
-            if ( ! first )
-                sw.append(" ") ;
-            first = false ;
-            if ( n == null ) {
-                sw.append("null") ;
-                continue;
-            }
-            str(sw, n) ;
-        }
-        return sw.toString() ; 
+            sj.add(displayStr(n));
+        return sj.toString(); 
     }
 
-    //public static String displayStr(Node n) { return serialize(n) ; }
-
-    public static void str(IndentedWriter w, Node n)
-    { serialize(w, n, null, null) ; }
-
-    public static String str(Node n, Prologue prologue)
-    {
-        return str(n, prologue.getBaseURI(), prologue.getPrefixMap()) ;
+    public static void str(IndentedWriter w, Node n) {
+        serialize(w, n, null, null);
     }
 
-    public static String str(Node n, String base, PrefixMap prefixMap)
-    {
-        IndentedLineBuffer sw = new IndentedLineBuffer() ;
-        serialize(sw, n, base, prefixMap) ;
-        return sw.toString() ;
+    public static String str(Node n, Prologue prologue) {
+        return str(n, prologue.getBaseURI(), prologue.getPrefixMap());
     }
 
-    public static void serialize(IndentedWriter w, Node n, Prologue prologue)
-    { serialize(w, n, prologue.getBaseURI(), prologue.getPrefixMap()) ; }
-    
-    public static void serialize(IndentedWriter w, Node n, String base, PrefixMap prefixMap)
-    {
-        NodeFormatter formatter ;
+    public static String str(Node n, String base, PrefixMap prefixMap) {
+        IndentedLineBuffer sw = new IndentedLineBuffer();
+        serialize(sw, n, base, prefixMap);
+        return sw.toString();
+    }
+
+    public static void serialize(IndentedWriter w, Node n, Prologue prologue) {
+        serialize(w, n, prologue.getBaseURI(), prologue.getPrefixMap());
+    }
+
+    public static void serialize(IndentedWriter w, Node n, String base, PrefixMap prefixMap) {
+        NodeFormatter formatter;
         if ( base == null && prefixMap == null )
-            formatter = plainFormatter ;
-        else 
-            formatter = new NodeFormatterTTL(base, prefixMap) ;
-        formatter.format(w, n) ;
+            formatter = plainFormatter;
+        else
+            formatter = new NodeFormatterTTL(base, prefixMap);
+        formatter.format(w, n);
     }
     
     // ---- Blank node labels.
     
     // Strict N-triples only allows [A-Za-z][A-Za-z0-9]
-    static char encodeMarkerChar = 'X' ;
+    static char encodeMarkerChar = 'X';
 
     // These two form a pair to convert bNode labels to a safe (i.e. legal N-triples form) and back agains. 
     
@@ -148,86 +149,78 @@
     // 2 - Hexify, as Xnn, anything outside ASCII A-Za-z0-9
     // 3 - X is encoded as XX
     
-    private static char LabelLeadingLetter = 'B' ; 
+    private static char LabelLeadingLetter = 'B'; 
     
-    public static String encodeBNodeLabel(String label)
-    {
-        StringBuilder buff = new StringBuilder() ;
+    public static String encodeBNodeLabel(String label) {
+        StringBuilder buff = new StringBuilder();
         // Must be at least one char and not a digit.
-        buff.append(LabelLeadingLetter) ;
-        
-        for ( int i = 0 ; i < label.length() ; i++ )
-        {
-            char ch = label.charAt(i) ;
-            if ( ch == encodeMarkerChar )
-            {
-                buff.append(ch) ;
-                buff.append(ch) ;
-            }
-            else if ( RiotChars.isA2ZN(ch) )
-                buff.append(ch) ;
+        buff.append(LabelLeadingLetter);
+
+        for ( int i = 0 ; i < label.length() ; i++ ) {
+            char ch = label.charAt(i);
+            if ( ch == encodeMarkerChar ) {
+                buff.append(ch);
+                buff.append(ch);
+            } else if ( RiotChars.isA2ZN(ch) )
+                buff.append(ch);
             else
-                Chars.encodeAsHex(buff, encodeMarkerChar, ch) ;
+                Chars.encodeAsHex(buff, encodeMarkerChar, ch);
         }
-        return buff.toString() ;
+        return buff.toString();
     }
 
     // Assumes that blank nodes only have characters in the range of 0-255
-    public static String decodeBNodeLabel(String label)
-    {
-        StringBuilder buffer = new StringBuilder() ;
+    public static String decodeBNodeLabel(String label) {
+        StringBuilder buffer = new StringBuilder();
 
         if ( label.charAt(0) != LabelLeadingLetter )
-            return label ;
-        
-        // Skip first.
-        for ( int i = 1; i < label.length(); i++ )
-        {
-            char ch = label.charAt(i) ;
-            
-            if ( ch != encodeMarkerChar )
-            {
-                buffer.append(ch) ;
-            }
-            else
-            {
-                // Maybe XX or Xnn.
-                char ch2 = label.charAt(i+1) ;
-                if ( ch2 == encodeMarkerChar )
-                {
-                    i++ ;
-                    buffer.append(ch) ;
-                    continue ;
-                }
-                
-                // Xnn
-                i++ ;
-                char hiC = label.charAt(i) ;
-                int hi = Bytes.hexCharToInt(hiC) ;
-                i++ ;
-                char loC = label.charAt(i) ;
-                int lo = Bytes.hexCharToInt(loC) ;
+            return label;
 
-                int combined = ((hi << 4) | lo) ;
-                buffer.append((char) combined) ;
+        // Skip first.
+        for ( int i = 1 ; i < label.length() ; i++ ) {
+            char ch = label.charAt(i);
+
+            if ( ch != encodeMarkerChar ) {
+                buffer.append(ch);
+            } else {
+                // Maybe XX or Xnn.
+                char ch2 = label.charAt(i + 1);
+                if ( ch2 == encodeMarkerChar ) {
+                    i++;
+                    buffer.append(ch);
+                    continue;
+                }
+
+                // Xnn
+                i++;
+                char hiC = label.charAt(i);
+                int hi = Bytes.hexCharToInt(hiC);
+                i++;
+                char loC = label.charAt(i);
+                int lo = Bytes.hexCharToInt(loC);
+
+                int combined = ((hi << 4) | lo);
+                buffer.append((char)combined);
             }
         }
 
-        return buffer.toString() ;
+        return buffer.toString();
     }
-    
+
     // ---- Relative URIs.
-    
-    static private int relFlags = IRIRelativize.SAMEDOCUMENT | IRIRelativize.CHILD ;
-    static public String abbrevByBase(String uri, String base)
-    {
+
+    static private int relFlags = IRIRelativize.SAMEDOCUMENT | IRIRelativize.CHILD;
+    static public String abbrevByBase(String uri, String base) {
         if ( base == null )
-            return null ;
-        IRI baseIRI = IRIResolver.iriFactory().construct(base) ;
-        IRI rel = baseIRI.relativize(uri, relFlags) ;
-        String r = null ;
-        try { r = rel.toASCIIString() ; }
-        catch (MalformedURLException  ex) { r = rel.toString() ; }
-        return r ;
+            return null;
+        IRI baseIRI = IRIResolver.iriFactory().construct(base);
+        IRI rel = baseIRI.relativize(uri, relFlags);
+        String r = null;
+        try {
+            r = rel.toASCIIString();
+        } catch (MalformedURLException ex) {
+            r = rel.toString();
+        }
+        return r;
     }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/ThriftConvert.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/ThriftConvert.java
index 8226e6d..2f9c8bf 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/ThriftConvert.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/ThriftConvert.java
@@ -30,6 +30,7 @@
 import org.apache.jena.datatypes.xsd.impl.RDFLangString ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.NodeFactory ;
+import org.apache.jena.graph.Node_Triple;
 import org.apache.jena.graph.Triple ;
 import org.apache.jena.riot.system.PrefixMap ;
 import org.apache.jena.riot.system.PrefixMapFactory ;
@@ -195,6 +196,24 @@
             term.setVariable(var) ;
             return ;
         }
+        
+        if ( node.isNodeTriple() ) {
+            Triple triple = Node_Triple.triple(node);
+            
+            RDF_Term sTerm = new RDF_Term();
+            toThrift(triple.getSubject(), pmap, sTerm, allowValues);
+            
+            RDF_Term pTerm = new RDF_Term();
+            toThrift(triple.getPredicate(), pmap, pTerm, allowValues);
+            
+            RDF_Term oTerm = new RDF_Term();
+            toThrift(triple.getObject(), pmap, oTerm, allowValues);
+            
+            RDF_Triple tripleTerm = new RDF_Triple(sTerm, pTerm, oTerm);
+            term.setTripleTerm(tripleTerm);
+            return ;
+        }
+        
         if ( Node.ANY.equals(node)) {
             term.setAny(ANY) ;
             return ;
@@ -270,6 +289,12 @@
             return NodeFactory.createLiteral(lex, dt) ;
         }
 
+        if ( term.isSetTripleTerm() ) {
+            RDF_Triple rt = term.getTripleTerm();
+            Triple t = convert(rt, pmap);
+            return NodeFactory.createTripleNode(t);
+        }
+        
         if ( term.isSetVariable() )
             return Var.alloc(term.getVariable().getName()) ;
         
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_ANY.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_ANY.java
index 5e65a80..6df8bfc 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_ANY.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_ANY.java
@@ -1,55 +1,29 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_ANY implements org.apache.thrift.TBase<RDF_ANY, RDF_ANY._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_ANY implements org.apache.thrift.TBase<RDF_ANY, RDF_ANY._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_ANY> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_ANY");
 
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_ANYStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_ANYTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_ANYStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_ANYTupleSchemeFactory();
 
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -57,6 +31,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         default:
@@ -70,21 +45,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -93,14 +69,14 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_ANY.class, metaDataMap);
   }
 
@@ -121,30 +97,31 @@
   public void clear() {
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_ANY)
@@ -155,41 +132,46 @@
   public boolean equals(RDF_ANY that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     return true;
   }
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_ANY other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_ANY typedOther = (RDF_ANY)other;
 
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_ANY(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_ANY(");
     boolean first = true;
 
     sb.append(")");
@@ -209,7 +191,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -217,13 +199,13 @@
     }
   }
 
-  private static class RDF_ANYStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_ANYStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_ANYStandardScheme getScheme() {
       return new RDF_ANYStandardScheme();
     }
   }
 
-  private static class RDF_ANYStandardScheme extends StandardScheme<RDF_ANY> {
+  private static class RDF_ANYStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_ANY> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_ANY struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -256,24 +238,27 @@
 
   }
 
-  private static class RDF_ANYTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_ANYTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_ANYTupleScheme getScheme() {
       return new RDF_ANYTupleScheme();
     }
   }
 
-  private static class RDF_ANYTupleScheme extends TupleScheme<RDF_ANY> {
+  private static class RDF_ANYTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_ANY> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_ANY struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_ANY struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_BNode.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_BNode.java
index ed94718..26a17c2 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_BNode.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_BNode.java
@@ -1,57 +1,31 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_BNode implements org.apache.thrift.TBase<RDF_BNode, RDF_BNode._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_BNode implements org.apache.thrift.TBase<RDF_BNode, RDF_BNode._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_BNode> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_BNode");
 
   private static final org.apache.thrift.protocol.TField LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("label", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_BNodeStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_BNodeTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_BNodeStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_BNodeTupleSchemeFactory();
 
-  public String label; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String label; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     LABEL((short)1, "label");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -59,6 +33,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // LABEL
@@ -74,21 +49,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -97,18 +73,18 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.LABEL, new org.apache.thrift.meta_data.FieldMetaData("label", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_BNode.class, metaDataMap);
   }
 
@@ -116,7 +92,7 @@
   }
 
   public RDF_BNode(
-    String label)
+    java.lang.String label)
   {
     this();
     this.label = label;
@@ -140,11 +116,12 @@
     this.label = null;
   }
 
-  public String getLabel() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getLabel() {
     return this.label;
   }
 
-  public RDF_BNode setLabel(String label) {
+  public RDF_BNode setLabel(@org.apache.thrift.annotation.Nullable java.lang.String label) {
     this.label = label;
     return this;
   }
@@ -164,43 +141,44 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case LABEL:
       if (value == null) {
         unsetLabel();
       } else {
-        setLabel((String)value);
+        setLabel((java.lang.String)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case LABEL:
       return getLabel();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     case LABEL:
       return isSetLabel();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_BNode)
@@ -211,6 +189,8 @@
   public boolean equals(RDF_BNode that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_label = true && this.isSetLabel();
     boolean that_present_label = true && that.isSetLabel();
@@ -226,23 +206,29 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetLabel()) ? 131071 : 524287);
+    if (isSetLabel())
+      hashCode = hashCode * 8191 + label.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_BNode other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_BNode typedOther = (RDF_BNode)other;
 
-    lastComparison = Boolean.valueOf(isSetLabel()).compareTo(typedOther.isSetLabel());
+    lastComparison = java.lang.Boolean.valueOf(isSetLabel()).compareTo(other.isSetLabel());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetLabel()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.label, typedOther.label);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.label, other.label);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -250,21 +236,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_BNode(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_BNode(");
     boolean first = true;
 
     sb.append("label:");
@@ -294,7 +281,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -302,13 +289,13 @@
     }
   }
 
-  private static class RDF_BNodeStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_BNodeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_BNodeStandardScheme getScheme() {
       return new RDF_BNodeStandardScheme();
     }
   }
 
-  private static class RDF_BNodeStandardScheme extends StandardScheme<RDF_BNode> {
+  private static class RDF_BNodeStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_BNode> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_BNode struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -354,27 +341,30 @@
 
   }
 
-  private static class RDF_BNodeTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_BNodeTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_BNodeTupleScheme getScheme() {
       return new RDF_BNodeTupleScheme();
     }
   }
 
-  private static class RDF_BNodeTupleScheme extends TupleScheme<RDF_BNode> {
+  private static class RDF_BNodeTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_BNode> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_BNode struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.label);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_BNode struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.label = iprot.readString();
       struct.setLabelIsSet(true);
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_DataTuple.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_DataTuple.java
index 536d660..7f10a97 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_DataTuple.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_DataTuple.java
@@ -1,57 +1,31 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_DataTuple implements org.apache.thrift.TBase<RDF_DataTuple, RDF_DataTuple._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_DataTuple implements org.apache.thrift.TBase<RDF_DataTuple, RDF_DataTuple._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_DataTuple> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_DataTuple");
 
   private static final org.apache.thrift.protocol.TField ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.LIST, (short)1);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_DataTupleStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_DataTupleTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_DataTupleStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_DataTupleTupleSchemeFactory();
 
-  public List<RDF_Term> row; // required
+  public @org.apache.thrift.annotation.Nullable java.util.List<RDF_Term> row; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     ROW((short)1, "row");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -59,6 +33,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // ROW
@@ -74,21 +49,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -97,19 +73,19 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class))));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_DataTuple.class, metaDataMap);
   }
 
@@ -117,7 +93,7 @@
   }
 
   public RDF_DataTuple(
-    List<RDF_Term> row)
+    java.util.List<RDF_Term> row)
   {
     this();
     this.row = row;
@@ -128,7 +104,7 @@
    */
   public RDF_DataTuple(RDF_DataTuple other) {
     if (other.isSetRow()) {
-      List<RDF_Term> __this__row = new ArrayList<RDF_Term>();
+      java.util.List<RDF_Term> __this__row = new java.util.ArrayList<RDF_Term>(other.row.size());
       for (RDF_Term other_element : other.row) {
         __this__row.add(new RDF_Term(other_element));
       }
@@ -149,22 +125,24 @@
     return (this.row == null) ? 0 : this.row.size();
   }
 
+  @org.apache.thrift.annotation.Nullable
   public java.util.Iterator<RDF_Term> getRowIterator() {
     return (this.row == null) ? null : this.row.iterator();
   }
 
   public void addToRow(RDF_Term elem) {
     if (this.row == null) {
-      this.row = new ArrayList<RDF_Term>();
+      this.row = new java.util.ArrayList<RDF_Term>();
     }
     this.row.add(elem);
   }
 
-  public List<RDF_Term> getRow() {
+  @org.apache.thrift.annotation.Nullable
+  public java.util.List<RDF_Term> getRow() {
     return this.row;
   }
 
-  public RDF_DataTuple setRow(List<RDF_Term> row) {
+  public RDF_DataTuple setRow(@org.apache.thrift.annotation.Nullable java.util.List<RDF_Term> row) {
     this.row = row;
     return this;
   }
@@ -184,43 +162,44 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case ROW:
       if (value == null) {
         unsetRow();
       } else {
-        setRow((List<RDF_Term>)value);
+        setRow((java.util.List<RDF_Term>)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case ROW:
       return getRow();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     case ROW:
       return isSetRow();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_DataTuple)
@@ -231,6 +210,8 @@
   public boolean equals(RDF_DataTuple that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_row = true && this.isSetRow();
     boolean that_present_row = true && that.isSetRow();
@@ -246,23 +227,29 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetRow()) ? 131071 : 524287);
+    if (isSetRow())
+      hashCode = hashCode * 8191 + row.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_DataTuple other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_DataTuple typedOther = (RDF_DataTuple)other;
 
-    lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
+    lastComparison = java.lang.Boolean.valueOf(isSetRow()).compareTo(other.isSetRow());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetRow()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, other.row);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -270,21 +257,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_DataTuple(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_DataTuple(");
     boolean first = true;
 
     sb.append("row:");
@@ -311,7 +299,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -319,13 +307,13 @@
     }
   }
 
-  private static class RDF_DataTupleStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_DataTupleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_DataTupleStandardScheme getScheme() {
       return new RDF_DataTupleStandardScheme();
     }
   }
 
-  private static class RDF_DataTupleStandardScheme extends StandardScheme<RDF_DataTuple> {
+  private static class RDF_DataTupleStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_DataTuple> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_DataTuple struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -341,13 +329,13 @@
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
                 org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
-                struct.row = new ArrayList<RDF_Term>(_list8.size);
-                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
+                struct.row = new java.util.ArrayList<RDF_Term>(_list8.size);
+                @org.apache.thrift.annotation.Nullable RDF_Term _elem9;
+                for (int _i10 = 0; _i10 < _list8.size; ++_i10)
                 {
-                  RDF_Term _elem10; // required
-                  _elem10 = new RDF_Term();
-                  _elem10.read(iprot);
-                  struct.row.add(_elem10);
+                  _elem9 = new RDF_Term();
+                  _elem9.read(iprot);
+                  struct.row.add(_elem9);
                 }
                 iprot.readListEnd();
               }
@@ -389,18 +377,18 @@
 
   }
 
-  private static class RDF_DataTupleTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_DataTupleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_DataTupleTupleScheme getScheme() {
       return new RDF_DataTupleTupleScheme();
     }
   }
 
-  private static class RDF_DataTupleTupleScheme extends TupleScheme<RDF_DataTuple> {
+  private static class RDF_DataTupleTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_DataTuple> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_DataTuple struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      java.util.BitSet optionals = new java.util.BitSet();
       if (struct.isSetRow()) {
         optionals.set(0);
       }
@@ -418,18 +406,18 @@
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_DataTuple struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(1);
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      java.util.BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
         {
           org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.row = new ArrayList<RDF_Term>(_list13.size);
-          for (int _i14 = 0; _i14 < _list13.size; ++_i14)
+          struct.row = new java.util.ArrayList<RDF_Term>(_list13.size);
+          @org.apache.thrift.annotation.Nullable RDF_Term _elem14;
+          for (int _i15 = 0; _i15 < _list13.size; ++_i15)
           {
-            RDF_Term _elem15; // required
-            _elem15 = new RDF_Term();
-            _elem15.read(iprot);
-            struct.row.add(_elem15);
+            _elem14 = new RDF_Term();
+            _elem14.read(iprot);
+            struct.row.add(_elem14);
           }
         }
         struct.setRowIsSet(true);
@@ -437,5 +425,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Decimal.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Decimal.java
index e231c5c..d28ed23 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Decimal.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Decimal.java
@@ -1,47 +1,21 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_Decimal implements org.apache.thrift.TBase<RDF_Decimal, RDF_Decimal._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_Decimal implements org.apache.thrift.TBase<RDF_Decimal, RDF_Decimal._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_Decimal> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Decimal");
 
   private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1);
   private static final org.apache.thrift.protocol.TField SCALE_FIELD_DESC = new org.apache.thrift.protocol.TField("scale", org.apache.thrift.protocol.TType.I32, (short)2);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_DecimalStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_DecimalTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_DecimalStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_DecimalTupleSchemeFactory();
 
   public long value; // required
   public int scale; // required
@@ -51,10 +25,10 @@
     VALUE((short)1, "value"),
     SCALE((short)2, "scale");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -62,6 +36,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // VALUE
@@ -79,21 +54,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -102,7 +78,7 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
@@ -111,14 +87,14 @@
   private static final int __VALUE_ISSET_ID = 0;
   private static final int __SCALE_ISSET_ID = 1;
   private byte __isset_bitfield = 0;
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.SCALE, new org.apache.thrift.meta_data.FieldMetaData("scale", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Decimal.class, metaDataMap);
   }
 
@@ -168,16 +144,16 @@
   }
 
   public void unsetValue() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID);
+    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID);
   }
 
   /** Returns true if field value is set (has been assigned a value) and false otherwise */
   public boolean isSetValue() {
-    return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID);
+    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID);
   }
 
   public void setValueIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value);
+    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value);
   }
 
   public int getScale() {
@@ -191,25 +167,25 @@
   }
 
   public void unsetScale() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCALE_ISSET_ID);
+    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCALE_ISSET_ID);
   }
 
   /** Returns true if field scale is set (has been assigned a value) and false otherwise */
   public boolean isSetScale() {
-    return EncodingUtils.testBit(__isset_bitfield, __SCALE_ISSET_ID);
+    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCALE_ISSET_ID);
   }
 
   public void setScaleIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCALE_ISSET_ID, value);
+    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCALE_ISSET_ID, value);
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case VALUE:
       if (value == null) {
         unsetValue();
       } else {
-        setValue((Long)value);
+        setValue((java.lang.Long)value);
       }
       break;
 
@@ -217,29 +193,30 @@
       if (value == null) {
         unsetScale();
       } else {
-        setScale((Integer)value);
+        setScale((java.lang.Integer)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case VALUE:
-      return Long.valueOf(getValue());
+      return getValue();
 
     case SCALE:
-      return Integer.valueOf(getScale());
+      return getScale();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -248,11 +225,11 @@
     case SCALE:
       return isSetScale();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_Decimal)
@@ -263,6 +240,8 @@
   public boolean equals(RDF_Decimal that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_value = true;
     boolean that_present_value = true;
@@ -287,33 +266,39 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value);
+
+    hashCode = hashCode * 8191 + scale;
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_Decimal other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_Decimal typedOther = (RDF_Decimal)other;
 
-    lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
+    lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetValue()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetScale()).compareTo(typedOther.isSetScale());
+    lastComparison = java.lang.Boolean.valueOf(isSetScale()).compareTo(other.isSetScale());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetScale()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scale, typedOther.scale);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scale, other.scale);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -321,21 +306,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_Decimal(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_Decimal(");
     boolean first = true;
 
     sb.append("value:");
@@ -364,7 +350,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
       __isset_bitfield = 0;
@@ -374,13 +360,13 @@
     }
   }
 
-  private static class RDF_DecimalStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_DecimalStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_DecimalStandardScheme getScheme() {
       return new RDF_DecimalStandardScheme();
     }
   }
 
-  private static class RDF_DecimalStandardScheme extends StandardScheme<RDF_Decimal> {
+  private static class RDF_DecimalStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_Decimal> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_Decimal struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -441,24 +427,24 @@
 
   }
 
-  private static class RDF_DecimalTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_DecimalTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_DecimalTupleScheme getScheme() {
       return new RDF_DecimalTupleScheme();
     }
   }
 
-  private static class RDF_DecimalTupleScheme extends TupleScheme<RDF_Decimal> {
+  private static class RDF_DecimalTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_Decimal> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Decimal struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeI64(struct.value);
       oprot.writeI32(struct.scale);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_Decimal struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.value = iprot.readI64();
       struct.setValueIsSet(true);
       struct.scale = iprot.readI32();
@@ -466,5 +452,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_IRI.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_IRI.java
index 57e4b34..4bc74ff 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_IRI.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_IRI.java
@@ -1,57 +1,31 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_IRI implements org.apache.thrift.TBase<RDF_IRI, RDF_IRI._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_IRI implements org.apache.thrift.TBase<RDF_IRI, RDF_IRI._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_IRI> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_IRI");
 
   private static final org.apache.thrift.protocol.TField IRI_FIELD_DESC = new org.apache.thrift.protocol.TField("iri", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_IRIStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_IRITupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_IRIStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_IRITupleSchemeFactory();
 
-  public String iri; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String iri; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     IRI((short)1, "iri");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -59,6 +33,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // IRI
@@ -74,21 +49,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -97,18 +73,18 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.IRI, new org.apache.thrift.meta_data.FieldMetaData("iri", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_IRI.class, metaDataMap);
   }
 
@@ -116,7 +92,7 @@
   }
 
   public RDF_IRI(
-    String iri)
+    java.lang.String iri)
   {
     this();
     this.iri = iri;
@@ -140,11 +116,12 @@
     this.iri = null;
   }
 
-  public String getIri() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getIri() {
     return this.iri;
   }
 
-  public RDF_IRI setIri(String iri) {
+  public RDF_IRI setIri(@org.apache.thrift.annotation.Nullable java.lang.String iri) {
     this.iri = iri;
     return this;
   }
@@ -164,43 +141,44 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case IRI:
       if (value == null) {
         unsetIri();
       } else {
-        setIri((String)value);
+        setIri((java.lang.String)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case IRI:
       return getIri();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     case IRI:
       return isSetIri();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_IRI)
@@ -211,6 +189,8 @@
   public boolean equals(RDF_IRI that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_iri = true && this.isSetIri();
     boolean that_present_iri = true && that.isSetIri();
@@ -226,23 +206,29 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetIri()) ? 131071 : 524287);
+    if (isSetIri())
+      hashCode = hashCode * 8191 + iri.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_IRI other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_IRI typedOther = (RDF_IRI)other;
 
-    lastComparison = Boolean.valueOf(isSetIri()).compareTo(typedOther.isSetIri());
+    lastComparison = java.lang.Boolean.valueOf(isSetIri()).compareTo(other.isSetIri());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetIri()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iri, typedOther.iri);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iri, other.iri);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -250,21 +236,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_IRI(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_IRI(");
     boolean first = true;
 
     sb.append("iri:");
@@ -294,7 +281,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -302,13 +289,13 @@
     }
   }
 
-  private static class RDF_IRIStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_IRIStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_IRIStandardScheme getScheme() {
       return new RDF_IRIStandardScheme();
     }
   }
 
-  private static class RDF_IRIStandardScheme extends StandardScheme<RDF_IRI> {
+  private static class RDF_IRIStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_IRI> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_IRI struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -354,27 +341,30 @@
 
   }
 
-  private static class RDF_IRITupleSchemeFactory implements SchemeFactory {
+  private static class RDF_IRITupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_IRITupleScheme getScheme() {
       return new RDF_IRITupleScheme();
     }
   }
 
-  private static class RDF_IRITupleScheme extends TupleScheme<RDF_IRI> {
+  private static class RDF_IRITupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_IRI> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_IRI struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.iri);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_IRI struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.iri = iprot.readString();
       struct.setIriIsSet(true);
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Literal.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Literal.java
index b104598..feb5e62 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Literal.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Literal.java
@@ -1,37 +1,14 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_Literal implements org.apache.thrift.TBase<RDF_Literal, RDF_Literal._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_Literal implements org.apache.thrift.TBase<RDF_Literal, RDF_Literal._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_Literal> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Literal");
 
   private static final org.apache.thrift.protocol.TField LEX_FIELD_DESC = new org.apache.thrift.protocol.TField("lex", org.apache.thrift.protocol.TType.STRING, (short)1);
@@ -39,16 +16,13 @@
   private static final org.apache.thrift.protocol.TField DATATYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("datatype", org.apache.thrift.protocol.TType.STRING, (short)3);
   private static final org.apache.thrift.protocol.TField DT_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("dtPrefix", org.apache.thrift.protocol.TType.STRUCT, (short)4);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_LiteralStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_LiteralTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_LiteralStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_LiteralTupleSchemeFactory();
 
-  public String lex; // required
-  public String langtag; // optional
-  public String datatype; // optional
-  public RDF_PrefixName dtPrefix; // optional
+  public @org.apache.thrift.annotation.Nullable java.lang.String lex; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String langtag; // optional
+  public @org.apache.thrift.annotation.Nullable java.lang.String datatype; // optional
+  public @org.apache.thrift.annotation.Nullable RDF_PrefixName dtPrefix; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -57,10 +31,10 @@
     DATATYPE((short)3, "datatype"),
     DT_PREFIX((short)4, "dtPrefix");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -68,6 +42,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // LEX
@@ -89,21 +64,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -112,16 +88,16 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  private _Fields optionals[] = {_Fields.LANGTAG,_Fields.DATATYPE,_Fields.DT_PREFIX};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  private static final _Fields optionals[] = {_Fields.LANGTAG,_Fields.DATATYPE,_Fields.DT_PREFIX};
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.LEX, new org.apache.thrift.meta_data.FieldMetaData("lex", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.LANGTAG, new org.apache.thrift.meta_data.FieldMetaData("langtag", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
@@ -130,7 +106,7 @@
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.DT_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("dtPrefix", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_PrefixName.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Literal.class, metaDataMap);
   }
 
@@ -138,7 +114,7 @@
   }
 
   public RDF_Literal(
-    String lex)
+    java.lang.String lex)
   {
     this();
     this.lex = lex;
@@ -174,11 +150,12 @@
     this.dtPrefix = null;
   }
 
-  public String getLex() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getLex() {
     return this.lex;
   }
 
-  public RDF_Literal setLex(String lex) {
+  public RDF_Literal setLex(@org.apache.thrift.annotation.Nullable java.lang.String lex) {
     this.lex = lex;
     return this;
   }
@@ -198,11 +175,12 @@
     }
   }
 
-  public String getLangtag() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getLangtag() {
     return this.langtag;
   }
 
-  public RDF_Literal setLangtag(String langtag) {
+  public RDF_Literal setLangtag(@org.apache.thrift.annotation.Nullable java.lang.String langtag) {
     this.langtag = langtag;
     return this;
   }
@@ -222,11 +200,12 @@
     }
   }
 
-  public String getDatatype() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getDatatype() {
     return this.datatype;
   }
 
-  public RDF_Literal setDatatype(String datatype) {
+  public RDF_Literal setDatatype(@org.apache.thrift.annotation.Nullable java.lang.String datatype) {
     this.datatype = datatype;
     return this;
   }
@@ -246,11 +225,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_PrefixName getDtPrefix() {
     return this.dtPrefix;
   }
 
-  public RDF_Literal setDtPrefix(RDF_PrefixName dtPrefix) {
+  public RDF_Literal setDtPrefix(@org.apache.thrift.annotation.Nullable RDF_PrefixName dtPrefix) {
     this.dtPrefix = dtPrefix;
     return this;
   }
@@ -270,13 +250,13 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case LEX:
       if (value == null) {
         unsetLex();
       } else {
-        setLex((String)value);
+        setLex((java.lang.String)value);
       }
       break;
 
@@ -284,7 +264,7 @@
       if (value == null) {
         unsetLangtag();
       } else {
-        setLangtag((String)value);
+        setLangtag((java.lang.String)value);
       }
       break;
 
@@ -292,7 +272,7 @@
       if (value == null) {
         unsetDatatype();
       } else {
-        setDatatype((String)value);
+        setDatatype((java.lang.String)value);
       }
       break;
 
@@ -307,7 +287,8 @@
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case LEX:
       return getLex();
@@ -322,13 +303,13 @@
       return getDtPrefix();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -341,11 +322,11 @@
     case DT_PREFIX:
       return isSetDtPrefix();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_Literal)
@@ -356,6 +337,8 @@
   public boolean equals(RDF_Literal that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_lex = true && this.isSetLex();
     boolean that_present_lex = true && that.isSetLex();
@@ -398,53 +381,71 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetLex()) ? 131071 : 524287);
+    if (isSetLex())
+      hashCode = hashCode * 8191 + lex.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetLangtag()) ? 131071 : 524287);
+    if (isSetLangtag())
+      hashCode = hashCode * 8191 + langtag.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetDatatype()) ? 131071 : 524287);
+    if (isSetDatatype())
+      hashCode = hashCode * 8191 + datatype.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetDtPrefix()) ? 131071 : 524287);
+    if (isSetDtPrefix())
+      hashCode = hashCode * 8191 + dtPrefix.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_Literal other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_Literal typedOther = (RDF_Literal)other;
 
-    lastComparison = Boolean.valueOf(isSetLex()).compareTo(typedOther.isSetLex());
+    lastComparison = java.lang.Boolean.valueOf(isSetLex()).compareTo(other.isSetLex());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetLex()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lex, typedOther.lex);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lex, other.lex);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetLangtag()).compareTo(typedOther.isSetLangtag());
+    lastComparison = java.lang.Boolean.valueOf(isSetLangtag()).compareTo(other.isSetLangtag());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetLangtag()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.langtag, typedOther.langtag);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.langtag, other.langtag);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetDatatype()).compareTo(typedOther.isSetDatatype());
+    lastComparison = java.lang.Boolean.valueOf(isSetDatatype()).compareTo(other.isSetDatatype());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetDatatype()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datatype, typedOther.datatype);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.datatype, other.datatype);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetDtPrefix()).compareTo(typedOther.isSetDtPrefix());
+    lastComparison = java.lang.Boolean.valueOf(isSetDtPrefix()).compareTo(other.isSetDtPrefix());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetDtPrefix()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dtPrefix, typedOther.dtPrefix);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dtPrefix, other.dtPrefix);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -452,21 +453,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_Literal(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_Literal(");
     boolean first = true;
 
     sb.append("lex:");
@@ -529,7 +531,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -537,13 +539,13 @@
     }
   }
 
-  private static class RDF_LiteralStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_LiteralStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_LiteralStandardScheme getScheme() {
       return new RDF_LiteralStandardScheme();
     }
   }
 
-  private static class RDF_LiteralStandardScheme extends StandardScheme<RDF_Literal> {
+  private static class RDF_LiteralStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_Literal> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_Literal struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -635,19 +637,19 @@
 
   }
 
-  private static class RDF_LiteralTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_LiteralTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_LiteralTupleScheme getScheme() {
       return new RDF_LiteralTupleScheme();
     }
   }
 
-  private static class RDF_LiteralTupleScheme extends TupleScheme<RDF_Literal> {
+  private static class RDF_LiteralTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_Literal> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Literal struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.lex);
-      BitSet optionals = new BitSet();
+      java.util.BitSet optionals = new java.util.BitSet();
       if (struct.isSetLangtag()) {
         optionals.set(0);
       }
@@ -671,10 +673,10 @@
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_Literal struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.lex = iprot.readString();
       struct.setLexIsSet(true);
-      BitSet incoming = iprot.readBitSet(3);
+      java.util.BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         struct.langtag = iprot.readString();
         struct.setLangtagIsSet(true);
@@ -691,5 +693,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixDecl.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixDecl.java
index 0d77b48..5d5b8c5 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixDecl.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixDecl.java
@@ -1,60 +1,34 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_PrefixDecl implements org.apache.thrift.TBase<RDF_PrefixDecl, RDF_PrefixDecl._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_PrefixDecl implements org.apache.thrift.TBase<RDF_PrefixDecl, RDF_PrefixDecl._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_PrefixDecl> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_PrefixDecl");
 
   private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField URI_FIELD_DESC = new org.apache.thrift.protocol.TField("uri", org.apache.thrift.protocol.TType.STRING, (short)2);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_PrefixDeclStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_PrefixDeclTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_PrefixDeclStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_PrefixDeclTupleSchemeFactory();
 
-  public String prefix; // required
-  public String uri; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String prefix; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String uri; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     PREFIX((short)1, "prefix"),
     URI((short)2, "uri");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -62,6 +36,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // PREFIX
@@ -79,21 +54,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -102,20 +78,20 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.URI, new org.apache.thrift.meta_data.FieldMetaData("uri", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_PrefixDecl.class, metaDataMap);
   }
 
@@ -123,8 +99,8 @@
   }
 
   public RDF_PrefixDecl(
-    String prefix,
-    String uri)
+    java.lang.String prefix,
+    java.lang.String uri)
   {
     this();
     this.prefix = prefix;
@@ -153,11 +129,12 @@
     this.uri = null;
   }
 
-  public String getPrefix() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getPrefix() {
     return this.prefix;
   }
 
-  public RDF_PrefixDecl setPrefix(String prefix) {
+  public RDF_PrefixDecl setPrefix(@org.apache.thrift.annotation.Nullable java.lang.String prefix) {
     this.prefix = prefix;
     return this;
   }
@@ -177,11 +154,12 @@
     }
   }
 
-  public String getUri() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getUri() {
     return this.uri;
   }
 
-  public RDF_PrefixDecl setUri(String uri) {
+  public RDF_PrefixDecl setUri(@org.apache.thrift.annotation.Nullable java.lang.String uri) {
     this.uri = uri;
     return this;
   }
@@ -201,13 +179,13 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case PREFIX:
       if (value == null) {
         unsetPrefix();
       } else {
-        setPrefix((String)value);
+        setPrefix((java.lang.String)value);
       }
       break;
 
@@ -215,14 +193,15 @@
       if (value == null) {
         unsetUri();
       } else {
-        setUri((String)value);
+        setUri((java.lang.String)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case PREFIX:
       return getPrefix();
@@ -231,13 +210,13 @@
       return getUri();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -246,11 +225,11 @@
     case URI:
       return isSetUri();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_PrefixDecl)
@@ -261,6 +240,8 @@
   public boolean equals(RDF_PrefixDecl that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_prefix = true && this.isSetPrefix();
     boolean that_present_prefix = true && that.isSetPrefix();
@@ -285,33 +266,43 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetPrefix()) ? 131071 : 524287);
+    if (isSetPrefix())
+      hashCode = hashCode * 8191 + prefix.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetUri()) ? 131071 : 524287);
+    if (isSetUri())
+      hashCode = hashCode * 8191 + uri.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_PrefixDecl other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_PrefixDecl typedOther = (RDF_PrefixDecl)other;
 
-    lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
+    lastComparison = java.lang.Boolean.valueOf(isSetPrefix()).compareTo(other.isSetPrefix());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetPrefix()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, other.prefix);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetUri()).compareTo(typedOther.isSetUri());
+    lastComparison = java.lang.Boolean.valueOf(isSetUri()).compareTo(other.isSetUri());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetUri()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uri, typedOther.uri);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uri, other.uri);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -319,21 +310,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_PrefixDecl(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_PrefixDecl(");
     boolean first = true;
 
     sb.append("prefix:");
@@ -374,7 +366,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -382,13 +374,13 @@
     }
   }
 
-  private static class RDF_PrefixDeclStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_PrefixDeclStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_PrefixDeclStandardScheme getScheme() {
       return new RDF_PrefixDeclStandardScheme();
     }
   }
 
-  private static class RDF_PrefixDeclStandardScheme extends StandardScheme<RDF_PrefixDecl> {
+  private static class RDF_PrefixDeclStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_PrefixDecl> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_PrefixDecl struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -447,24 +439,24 @@
 
   }
 
-  private static class RDF_PrefixDeclTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_PrefixDeclTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_PrefixDeclTupleScheme getScheme() {
       return new RDF_PrefixDeclTupleScheme();
     }
   }
 
-  private static class RDF_PrefixDeclTupleScheme extends TupleScheme<RDF_PrefixDecl> {
+  private static class RDF_PrefixDeclTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_PrefixDecl> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_PrefixDecl struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.prefix);
       oprot.writeString(struct.uri);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_PrefixDecl struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.prefix = iprot.readString();
       struct.setPrefixIsSet(true);
       struct.uri = iprot.readString();
@@ -472,5 +464,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixName.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixName.java
index 2df8ee1..afb5efd 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixName.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_PrefixName.java
@@ -1,60 +1,34 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_PrefixName implements org.apache.thrift.TBase<RDF_PrefixName, RDF_PrefixName._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_PrefixName implements org.apache.thrift.TBase<RDF_PrefixName, RDF_PrefixName._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_PrefixName> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_PrefixName");
 
   private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField LOCAL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("localName", org.apache.thrift.protocol.TType.STRING, (short)2);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_PrefixNameStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_PrefixNameTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_PrefixNameStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_PrefixNameTupleSchemeFactory();
 
-  public String prefix; // required
-  public String localName; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String prefix; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String localName; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     PREFIX((short)1, "prefix"),
     LOCAL_NAME((short)2, "localName");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -62,6 +36,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // PREFIX
@@ -79,21 +54,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -102,20 +78,20 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.LOCAL_NAME, new org.apache.thrift.meta_data.FieldMetaData("localName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_PrefixName.class, metaDataMap);
   }
 
@@ -123,8 +99,8 @@
   }
 
   public RDF_PrefixName(
-    String prefix,
-    String localName)
+    java.lang.String prefix,
+    java.lang.String localName)
   {
     this();
     this.prefix = prefix;
@@ -153,11 +129,12 @@
     this.localName = null;
   }
 
-  public String getPrefix() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getPrefix() {
     return this.prefix;
   }
 
-  public RDF_PrefixName setPrefix(String prefix) {
+  public RDF_PrefixName setPrefix(@org.apache.thrift.annotation.Nullable java.lang.String prefix) {
     this.prefix = prefix;
     return this;
   }
@@ -177,11 +154,12 @@
     }
   }
 
-  public String getLocalName() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getLocalName() {
     return this.localName;
   }
 
-  public RDF_PrefixName setLocalName(String localName) {
+  public RDF_PrefixName setLocalName(@org.apache.thrift.annotation.Nullable java.lang.String localName) {
     this.localName = localName;
     return this;
   }
@@ -201,13 +179,13 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case PREFIX:
       if (value == null) {
         unsetPrefix();
       } else {
-        setPrefix((String)value);
+        setPrefix((java.lang.String)value);
       }
       break;
 
@@ -215,14 +193,15 @@
       if (value == null) {
         unsetLocalName();
       } else {
-        setLocalName((String)value);
+        setLocalName((java.lang.String)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case PREFIX:
       return getPrefix();
@@ -231,13 +210,13 @@
       return getLocalName();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -246,11 +225,11 @@
     case LOCAL_NAME:
       return isSetLocalName();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_PrefixName)
@@ -261,6 +240,8 @@
   public boolean equals(RDF_PrefixName that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_prefix = true && this.isSetPrefix();
     boolean that_present_prefix = true && that.isSetPrefix();
@@ -285,33 +266,43 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetPrefix()) ? 131071 : 524287);
+    if (isSetPrefix())
+      hashCode = hashCode * 8191 + prefix.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetLocalName()) ? 131071 : 524287);
+    if (isSetLocalName())
+      hashCode = hashCode * 8191 + localName.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_PrefixName other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_PrefixName typedOther = (RDF_PrefixName)other;
 
-    lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
+    lastComparison = java.lang.Boolean.valueOf(isSetPrefix()).compareTo(other.isSetPrefix());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetPrefix()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, other.prefix);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetLocalName()).compareTo(typedOther.isSetLocalName());
+    lastComparison = java.lang.Boolean.valueOf(isSetLocalName()).compareTo(other.isSetLocalName());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetLocalName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.localName, typedOther.localName);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.localName, other.localName);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -319,21 +310,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_PrefixName(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_PrefixName(");
     boolean first = true;
 
     sb.append("prefix:");
@@ -374,7 +366,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -382,13 +374,13 @@
     }
   }
 
-  private static class RDF_PrefixNameStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_PrefixNameStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_PrefixNameStandardScheme getScheme() {
       return new RDF_PrefixNameStandardScheme();
     }
   }
 
-  private static class RDF_PrefixNameStandardScheme extends StandardScheme<RDF_PrefixName> {
+  private static class RDF_PrefixNameStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_PrefixName> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_PrefixName struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -447,24 +439,24 @@
 
   }
 
-  private static class RDF_PrefixNameTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_PrefixNameTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_PrefixNameTupleScheme getScheme() {
       return new RDF_PrefixNameTupleScheme();
     }
   }
 
-  private static class RDF_PrefixNameTupleScheme extends TupleScheme<RDF_PrefixName> {
+  private static class RDF_PrefixNameTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_PrefixName> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_PrefixName struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.prefix);
       oprot.writeString(struct.localName);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_PrefixName struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.prefix = iprot.readString();
       struct.setPrefixIsSet(true);
       struct.localName = iprot.readString();
@@ -472,5 +464,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Quad.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Quad.java
index c9abce6..3a4a262 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Quad.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Quad.java
@@ -1,37 +1,14 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_Quad implements org.apache.thrift.TBase<RDF_Quad, RDF_Quad._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_Quad implements org.apache.thrift.TBase<RDF_Quad, RDF_Quad._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_Quad> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Quad");
 
   private static final org.apache.thrift.protocol.TField S_FIELD_DESC = new org.apache.thrift.protocol.TField("S", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -39,16 +16,13 @@
   private static final org.apache.thrift.protocol.TField O_FIELD_DESC = new org.apache.thrift.protocol.TField("O", org.apache.thrift.protocol.TType.STRUCT, (short)3);
   private static final org.apache.thrift.protocol.TField G_FIELD_DESC = new org.apache.thrift.protocol.TField("G", org.apache.thrift.protocol.TType.STRUCT, (short)4);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_QuadStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_QuadTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_QuadStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_QuadTupleSchemeFactory();
 
-  public RDF_Term S; // required
-  public RDF_Term P; // required
-  public RDF_Term O; // required
-  public RDF_Term G; // optional
+  public @org.apache.thrift.annotation.Nullable RDF_Term S; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term P; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term O; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term G; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -57,10 +31,10 @@
     O((short)3, "O"),
     G((short)4, "G");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -68,6 +42,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // S
@@ -89,21 +64,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -112,16 +88,16 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  private _Fields optionals[] = {_Fields.G};
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  private static final _Fields optionals[] = {_Fields.G};
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.S, new org.apache.thrift.meta_data.FieldMetaData("S", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
     tmpMap.put(_Fields.P, new org.apache.thrift.meta_data.FieldMetaData("P", org.apache.thrift.TFieldRequirementType.REQUIRED, 
@@ -130,7 +106,7 @@
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
     tmpMap.put(_Fields.G, new org.apache.thrift.meta_data.FieldMetaData("G", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Quad.class, metaDataMap);
   }
 
@@ -178,11 +154,12 @@
     this.G = null;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getS() {
     return this.S;
   }
 
-  public RDF_Quad setS(RDF_Term S) {
+  public RDF_Quad setS(@org.apache.thrift.annotation.Nullable RDF_Term S) {
     this.S = S;
     return this;
   }
@@ -202,11 +179,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getP() {
     return this.P;
   }
 
-  public RDF_Quad setP(RDF_Term P) {
+  public RDF_Quad setP(@org.apache.thrift.annotation.Nullable RDF_Term P) {
     this.P = P;
     return this;
   }
@@ -226,11 +204,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getO() {
     return this.O;
   }
 
-  public RDF_Quad setO(RDF_Term O) {
+  public RDF_Quad setO(@org.apache.thrift.annotation.Nullable RDF_Term O) {
     this.O = O;
     return this;
   }
@@ -250,11 +229,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getG() {
     return this.G;
   }
 
-  public RDF_Quad setG(RDF_Term G) {
+  public RDF_Quad setG(@org.apache.thrift.annotation.Nullable RDF_Term G) {
     this.G = G;
     return this;
   }
@@ -274,7 +254,7 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case S:
       if (value == null) {
@@ -311,7 +291,8 @@
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case S:
       return getS();
@@ -326,13 +307,13 @@
       return getG();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -345,11 +326,11 @@
     case G:
       return isSetG();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_Quad)
@@ -360,6 +341,8 @@
   public boolean equals(RDF_Quad that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_S = true && this.isSetS();
     boolean that_present_S = true && that.isSetS();
@@ -402,53 +385,71 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetS()) ? 131071 : 524287);
+    if (isSetS())
+      hashCode = hashCode * 8191 + S.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetP()) ? 131071 : 524287);
+    if (isSetP())
+      hashCode = hashCode * 8191 + P.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetO()) ? 131071 : 524287);
+    if (isSetO())
+      hashCode = hashCode * 8191 + O.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetG()) ? 131071 : 524287);
+    if (isSetG())
+      hashCode = hashCode * 8191 + G.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_Quad other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_Quad typedOther = (RDF_Quad)other;
 
-    lastComparison = Boolean.valueOf(isSetS()).compareTo(typedOther.isSetS());
+    lastComparison = java.lang.Boolean.valueOf(isSetS()).compareTo(other.isSetS());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetS()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.S, typedOther.S);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.S, other.S);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetP()).compareTo(typedOther.isSetP());
+    lastComparison = java.lang.Boolean.valueOf(isSetP()).compareTo(other.isSetP());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetP()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.P, typedOther.P);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.P, other.P);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetO()).compareTo(typedOther.isSetO());
+    lastComparison = java.lang.Boolean.valueOf(isSetO()).compareTo(other.isSetO());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetO()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.O, typedOther.O);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.O, other.O);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetG()).compareTo(typedOther.isSetG());
+    lastComparison = java.lang.Boolean.valueOf(isSetG()).compareTo(other.isSetG());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetG()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.G, typedOther.G);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.G, other.G);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -456,21 +457,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_Quad(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_Quad(");
     boolean first = true;
 
     sb.append("S:");
@@ -532,7 +534,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -540,13 +542,13 @@
     }
   }
 
-  private static class RDF_QuadStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_QuadStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_QuadStandardScheme getScheme() {
       return new RDF_QuadStandardScheme();
     }
   }
 
-  private static class RDF_QuadStandardScheme extends StandardScheme<RDF_Quad> {
+  private static class RDF_QuadStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_Quad> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_Quad struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -637,21 +639,21 @@
 
   }
 
-  private static class RDF_QuadTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_QuadTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_QuadTupleScheme getScheme() {
       return new RDF_QuadTupleScheme();
     }
   }
 
-  private static class RDF_QuadTupleScheme extends TupleScheme<RDF_Quad> {
+  private static class RDF_QuadTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_Quad> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Quad struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.S.write(oprot);
       struct.P.write(oprot);
       struct.O.write(oprot);
-      BitSet optionals = new BitSet();
+      java.util.BitSet optionals = new java.util.BitSet();
       if (struct.isSetG()) {
         optionals.set(0);
       }
@@ -663,7 +665,7 @@
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_Quad struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.S = new RDF_Term();
       struct.S.read(iprot);
       struct.setSIsSet(true);
@@ -673,7 +675,7 @@
       struct.O = new RDF_Term();
       struct.O.read(iprot);
       struct.setOIsSet(true);
-      BitSet incoming = iprot.readBitSet(1);
+      java.util.BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
         struct.G = new RDF_Term();
         struct.G.read(iprot);
@@ -682,5 +684,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_REPEAT.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_REPEAT.java
index f075705..715ffd3 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_REPEAT.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_REPEAT.java
@@ -1,55 +1,29 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_REPEAT implements org.apache.thrift.TBase<RDF_REPEAT, RDF_REPEAT._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_REPEAT implements org.apache.thrift.TBase<RDF_REPEAT, RDF_REPEAT._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_REPEAT> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_REPEAT");
 
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_REPEATStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_REPEATTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_REPEATStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_REPEATTupleSchemeFactory();
 
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -57,6 +31,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         default:
@@ -70,21 +45,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -93,14 +69,14 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_REPEAT.class, metaDataMap);
   }
 
@@ -121,30 +97,31 @@
   public void clear() {
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_REPEAT)
@@ -155,41 +132,46 @@
   public boolean equals(RDF_REPEAT that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     return true;
   }
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_REPEAT other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_REPEAT typedOther = (RDF_REPEAT)other;
 
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_REPEAT(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_REPEAT(");
     boolean first = true;
 
     sb.append(")");
@@ -209,7 +191,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -217,13 +199,13 @@
     }
   }
 
-  private static class RDF_REPEATStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_REPEATStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_REPEATStandardScheme getScheme() {
       return new RDF_REPEATStandardScheme();
     }
   }
 
-  private static class RDF_REPEATStandardScheme extends StandardScheme<RDF_REPEAT> {
+  private static class RDF_REPEATStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_REPEAT> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_REPEAT struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -256,24 +238,27 @@
 
   }
 
-  private static class RDF_REPEATTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_REPEATTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_REPEATTupleScheme getScheme() {
       return new RDF_REPEATTupleScheme();
     }
   }
 
-  private static class RDF_REPEATTupleScheme extends TupleScheme<RDF_REPEAT> {
+  private static class RDF_REPEATTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_REPEAT> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_REPEAT struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_REPEAT struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_StreamRow.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_StreamRow.java
index 2453b04..0c9526f 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_StreamRow.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_StreamRow.java
@@ -1,36 +1,13 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
 public class RDF_StreamRow extends org.apache.thrift.TUnion<RDF_StreamRow, RDF_StreamRow._Fields> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_StreamRow");
   private static final org.apache.thrift.protocol.TField PREFIX_DECL_FIELD_DESC = new org.apache.thrift.protocol.TField("prefixDecl", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -43,10 +20,10 @@
     TRIPLE((short)2, "triple"),
     QUAD((short)3, "quad");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -54,6 +31,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // PREFIX_DECL
@@ -73,21 +51,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -96,21 +75,21 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.PREFIX_DECL, new org.apache.thrift.meta_data.FieldMetaData("prefixDecl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.PREFIX_DECL, new org.apache.thrift.meta_data.FieldMetaData("prefixDecl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_PrefixDecl.class)));
-    tmpMap.put(_Fields.TRIPLE, new org.apache.thrift.meta_data.FieldMetaData("triple", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.TRIPLE, new org.apache.thrift.meta_data.FieldMetaData("triple", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Triple.class)));
-    tmpMap.put(_Fields.QUAD, new org.apache.thrift.meta_data.FieldMetaData("quad", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.QUAD, new org.apache.thrift.meta_data.FieldMetaData("quad", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Quad.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_StreamRow.class, metaDataMap);
   }
 
@@ -118,7 +97,7 @@
     super();
   }
 
-  public RDF_StreamRow(_Fields setField, Object value) {
+  public RDF_StreamRow(_Fields setField, java.lang.Object value) {
     super(setField, value);
   }
 
@@ -149,30 +128,30 @@
 
 
   @Override
-  protected void checkType(_Fields setField, Object value) throws ClassCastException {
+  protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
     switch (setField) {
       case PREFIX_DECL:
         if (value instanceof RDF_PrefixDecl) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_PrefixDecl for field 'prefixDecl', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_PrefixDecl for field 'prefixDecl', but got " + value.getClass().getSimpleName());
       case TRIPLE:
         if (value instanceof RDF_Triple) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_Triple for field 'triple', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_Triple for field 'triple', but got " + value.getClass().getSimpleName());
       case QUAD:
         if (value instanceof RDF_Quad) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_Quad for field 'quad', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_Quad for field 'quad', but got " + value.getClass().getSimpleName());
       default:
-        throw new IllegalArgumentException("Unknown field id " + setField);
+        throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
     }
   }
 
   @Override
-  protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
+  protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
     _Fields setField = _Fields.findByThriftId(field.id);
     if (setField != null) {
       switch (setField) {
@@ -207,9 +186,10 @@
             return null;
           }
         default:
-          throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
+          throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
       }
     } else {
+      org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
       return null;
     }
   }
@@ -230,12 +210,12 @@
         quad.write(oprot);
         return;
       default:
-        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
+        throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
     }
   }
 
   @Override
-  protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
+  protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
     _Fields setField = _Fields.findByThriftId(fieldID);
     if (setField != null) {
       switch (setField) {
@@ -255,10 +235,10 @@
           quad.read(iprot);
           return quad;
         default:
-          throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
+          throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
       }
     } else {
-      throw new TProtocolException("Couldn't find a field with field id " + fieldID);
+      throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
     }
   }
 
@@ -278,7 +258,7 @@
         quad.write(oprot);
         return;
       default:
-        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
+        throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
     }
   }
 
@@ -292,7 +272,7 @@
       case QUAD:
         return QUAD_FIELD_DESC;
       default:
-        throw new IllegalArgumentException("Unknown field id " + setField);
+        throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
     }
   }
 
@@ -306,6 +286,7 @@
     return _Fields.findByThriftIdOrThrow(id);
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
@@ -315,12 +296,12 @@
     if (getSetField() == _Fields.PREFIX_DECL) {
       return (RDF_PrefixDecl)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'prefixDecl' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'prefixDecl' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setPrefixDecl(RDF_PrefixDecl value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.PREFIX_DECL;
     value_ = value;
   }
@@ -329,12 +310,12 @@
     if (getSetField() == _Fields.TRIPLE) {
       return (RDF_Triple)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'triple' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'triple' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setTriple(RDF_Triple value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.TRIPLE;
     value_ = value;
   }
@@ -343,12 +324,12 @@
     if (getSetField() == _Fields.QUAD) {
       return (RDF_Quad)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'quad' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'quad' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setQuad(RDF_Quad value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.QUAD;
     value_ = value;
   }
@@ -368,7 +349,7 @@
   }
 
 
-  public boolean equals(Object other) {
+  public boolean equals(java.lang.Object other) {
     if (other instanceof RDF_StreamRow) {
       return equals((RDF_StreamRow)other);
     } else {
@@ -390,14 +371,22 @@
   }
 
 
-  /**
-   * If you'd like this to perform more respectably, use the hashcode generator option.
-   */
   @Override
   public int hashCode() {
-    return 0;
+    java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
+    list.add(this.getClass().getName());
+    org.apache.thrift.TFieldIdEnum setField = getSetField();
+    if (setField != null) {
+      list.add(setField.getThriftFieldId());
+      java.lang.Object value = getFieldValue();
+      if (value instanceof org.apache.thrift.TEnum) {
+        list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
+      } else {
+        list.add(value);
+      }
+    }
+    return list.hashCode();
   }
-
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
     try {
       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
@@ -407,7 +396,7 @@
   }
 
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Term.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Term.java
index 6fd9bad..69ad8b0 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Term.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Term.java
@@ -1,36 +1,13 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
 public class RDF_Term extends org.apache.thrift.TUnion<RDF_Term, RDF_Term._Fields> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Term");
   private static final org.apache.thrift.protocol.TField IRI_FIELD_DESC = new org.apache.thrift.protocol.TField("iri", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -41,6 +18,7 @@
   private static final org.apache.thrift.protocol.TField ANY_FIELD_DESC = new org.apache.thrift.protocol.TField("any", org.apache.thrift.protocol.TType.STRUCT, (short)6);
   private static final org.apache.thrift.protocol.TField UNDEFINED_FIELD_DESC = new org.apache.thrift.protocol.TField("undefined", org.apache.thrift.protocol.TType.STRUCT, (short)7);
   private static final org.apache.thrift.protocol.TField REPEAT_FIELD_DESC = new org.apache.thrift.protocol.TField("repeat", org.apache.thrift.protocol.TType.STRUCT, (short)8);
+  private static final org.apache.thrift.protocol.TField TRIPLE_TERM_FIELD_DESC = new org.apache.thrift.protocol.TField("tripleTerm", org.apache.thrift.protocol.TType.STRUCT, (short)9);
   private static final org.apache.thrift.protocol.TField VAL_INTEGER_FIELD_DESC = new org.apache.thrift.protocol.TField("valInteger", org.apache.thrift.protocol.TType.I64, (short)10);
   private static final org.apache.thrift.protocol.TField VAL_DOUBLE_FIELD_DESC = new org.apache.thrift.protocol.TField("valDouble", org.apache.thrift.protocol.TType.DOUBLE, (short)11);
   private static final org.apache.thrift.protocol.TField VAL_DECIMAL_FIELD_DESC = new org.apache.thrift.protocol.TField("valDecimal", org.apache.thrift.protocol.TType.STRUCT, (short)12);
@@ -55,14 +33,15 @@
     ANY((short)6, "any"),
     UNDEFINED((short)7, "undefined"),
     REPEAT((short)8, "repeat"),
+    TRIPLE_TERM((short)9, "tripleTerm"),
     VAL_INTEGER((short)10, "valInteger"),
     VAL_DOUBLE((short)11, "valDouble"),
     VAL_DECIMAL((short)12, "valDecimal");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -70,6 +49,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // IRI
@@ -88,6 +68,8 @@
           return UNDEFINED;
         case 8: // REPEAT
           return REPEAT;
+        case 9: // TRIPLE_TERM
+          return TRIPLE_TERM;
         case 10: // VAL_INTEGER
           return VAL_INTEGER;
         case 11: // VAL_DOUBLE
@@ -105,21 +87,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -128,37 +111,39 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    tmpMap.put(_Fields.IRI, new org.apache.thrift.meta_data.FieldMetaData("iri", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.IRI, new org.apache.thrift.meta_data.FieldMetaData("iri", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_IRI.class)));
-    tmpMap.put(_Fields.BNODE, new org.apache.thrift.meta_data.FieldMetaData("bnode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.BNODE, new org.apache.thrift.meta_data.FieldMetaData("bnode", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_BNode.class)));
-    tmpMap.put(_Fields.LITERAL, new org.apache.thrift.meta_data.FieldMetaData("literal", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.LITERAL, new org.apache.thrift.meta_data.FieldMetaData("literal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Literal.class)));
-    tmpMap.put(_Fields.PREFIX_NAME, new org.apache.thrift.meta_data.FieldMetaData("prefixName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.PREFIX_NAME, new org.apache.thrift.meta_data.FieldMetaData("prefixName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_PrefixName.class)));
-    tmpMap.put(_Fields.VARIABLE, new org.apache.thrift.meta_data.FieldMetaData("variable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.VARIABLE, new org.apache.thrift.meta_data.FieldMetaData("variable", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_VAR.class)));
-    tmpMap.put(_Fields.ANY, new org.apache.thrift.meta_data.FieldMetaData("any", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.ANY, new org.apache.thrift.meta_data.FieldMetaData("any", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_ANY.class)));
-    tmpMap.put(_Fields.UNDEFINED, new org.apache.thrift.meta_data.FieldMetaData("undefined", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.UNDEFINED, new org.apache.thrift.meta_data.FieldMetaData("undefined", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_UNDEF.class)));
-    tmpMap.put(_Fields.REPEAT, new org.apache.thrift.meta_data.FieldMetaData("repeat", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.REPEAT, new org.apache.thrift.meta_data.FieldMetaData("repeat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_REPEAT.class)));
-    tmpMap.put(_Fields.VAL_INTEGER, new org.apache.thrift.meta_data.FieldMetaData("valInteger", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.TRIPLE_TERM, new org.apache.thrift.meta_data.FieldMetaData("tripleTerm", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "RDF_Triple")));
+    tmpMap.put(_Fields.VAL_INTEGER, new org.apache.thrift.meta_data.FieldMetaData("valInteger", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    tmpMap.put(_Fields.VAL_DOUBLE, new org.apache.thrift.meta_data.FieldMetaData("valDouble", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.VAL_DOUBLE, new org.apache.thrift.meta_data.FieldMetaData("valDouble", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-    tmpMap.put(_Fields.VAL_DECIMAL, new org.apache.thrift.meta_data.FieldMetaData("valDecimal", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.VAL_DECIMAL, new org.apache.thrift.meta_data.FieldMetaData("valDecimal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Decimal.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Term.class, metaDataMap);
   }
 
@@ -166,7 +151,7 @@
     super();
   }
 
-  public RDF_Term(_Fields setField, Object value) {
+  public RDF_Term(_Fields setField, java.lang.Object value) {
     super(setField, value);
   }
 
@@ -225,6 +210,12 @@
     return x;
   }
 
+  public static RDF_Term tripleTerm(RDF_Triple value) {
+    RDF_Term x = new RDF_Term();
+    x.setTripleTerm(value);
+    return x;
+  }
+
   public static RDF_Term valInteger(long value) {
     RDF_Term x = new RDF_Term();
     x.setValInteger(value);
@@ -245,70 +236,75 @@
 
 
   @Override
-  protected void checkType(_Fields setField, Object value) throws ClassCastException {
+  protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
     switch (setField) {
       case IRI:
         if (value instanceof RDF_IRI) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_IRI for field 'iri', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_IRI for field 'iri', but got " + value.getClass().getSimpleName());
       case BNODE:
         if (value instanceof RDF_BNode) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_BNode for field 'bnode', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_BNode for field 'bnode', but got " + value.getClass().getSimpleName());
       case LITERAL:
         if (value instanceof RDF_Literal) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_Literal for field 'literal', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_Literal for field 'literal', but got " + value.getClass().getSimpleName());
       case PREFIX_NAME:
         if (value instanceof RDF_PrefixName) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_PrefixName for field 'prefixName', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_PrefixName for field 'prefixName', but got " + value.getClass().getSimpleName());
       case VARIABLE:
         if (value instanceof RDF_VAR) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_VAR for field 'variable', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_VAR for field 'variable', but got " + value.getClass().getSimpleName());
       case ANY:
         if (value instanceof RDF_ANY) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_ANY for field 'any', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_ANY for field 'any', but got " + value.getClass().getSimpleName());
       case UNDEFINED:
         if (value instanceof RDF_UNDEF) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_UNDEF for field 'undefined', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_UNDEF for field 'undefined', but got " + value.getClass().getSimpleName());
       case REPEAT:
         if (value instanceof RDF_REPEAT) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_REPEAT for field 'repeat', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_REPEAT for field 'repeat', but got " + value.getClass().getSimpleName());
+      case TRIPLE_TERM:
+        if (value instanceof RDF_Triple) {
+          break;
+        }
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_Triple for field 'tripleTerm', but got " + value.getClass().getSimpleName());
       case VAL_INTEGER:
-        if (value instanceof Long) {
+        if (value instanceof java.lang.Long) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type Long for field 'valInteger', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type java.lang.Long for field 'valInteger', but got " + value.getClass().getSimpleName());
       case VAL_DOUBLE:
-        if (value instanceof Double) {
+        if (value instanceof java.lang.Double) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type Double for field 'valDouble', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type java.lang.Double for field 'valDouble', but got " + value.getClass().getSimpleName());
       case VAL_DECIMAL:
         if (value instanceof RDF_Decimal) {
           break;
         }
-        throw new ClassCastException("Was expecting value of type RDF_Decimal for field 'valDecimal', but got " + value.getClass().getSimpleName());
+        throw new java.lang.ClassCastException("Was expecting value of type RDF_Decimal for field 'valDecimal', but got " + value.getClass().getSimpleName());
       default:
-        throw new IllegalArgumentException("Unknown field id " + setField);
+        throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
     }
   }
 
   @Override
-  protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
+  protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
     _Fields setField = _Fields.findByThriftId(field.id);
     if (setField != null) {
       switch (setField) {
@@ -392,9 +388,19 @@
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
             return null;
           }
+        case TRIPLE_TERM:
+          if (field.type == TRIPLE_TERM_FIELD_DESC.type) {
+            RDF_Triple tripleTerm;
+            tripleTerm = new RDF_Triple();
+            tripleTerm.read(iprot);
+            return tripleTerm;
+          } else {
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+            return null;
+          }
         case VAL_INTEGER:
           if (field.type == VAL_INTEGER_FIELD_DESC.type) {
-            Long valInteger;
+            java.lang.Long valInteger;
             valInteger = iprot.readI64();
             return valInteger;
           } else {
@@ -403,7 +409,7 @@
           }
         case VAL_DOUBLE:
           if (field.type == VAL_DOUBLE_FIELD_DESC.type) {
-            Double valDouble;
+            java.lang.Double valDouble;
             valDouble = iprot.readDouble();
             return valDouble;
           } else {
@@ -421,9 +427,10 @@
             return null;
           }
         default:
-          throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
+          throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
       }
     } else {
+      org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
       return null;
     }
   }
@@ -463,12 +470,16 @@
         RDF_REPEAT repeat = (RDF_REPEAT)value_;
         repeat.write(oprot);
         return;
+      case TRIPLE_TERM:
+        RDF_Triple tripleTerm = (RDF_Triple)value_;
+        tripleTerm.write(oprot);
+        return;
       case VAL_INTEGER:
-        Long valInteger = (Long)value_;
+        java.lang.Long valInteger = (java.lang.Long)value_;
         oprot.writeI64(valInteger);
         return;
       case VAL_DOUBLE:
-        Double valDouble = (Double)value_;
+        java.lang.Double valDouble = (java.lang.Double)value_;
         oprot.writeDouble(valDouble);
         return;
       case VAL_DECIMAL:
@@ -476,12 +487,12 @@
         valDecimal.write(oprot);
         return;
       default:
-        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
+        throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
     }
   }
 
   @Override
-  protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
+  protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
     _Fields setField = _Fields.findByThriftId(fieldID);
     if (setField != null) {
       switch (setField) {
@@ -525,12 +536,17 @@
           repeat = new RDF_REPEAT();
           repeat.read(iprot);
           return repeat;
+        case TRIPLE_TERM:
+          RDF_Triple tripleTerm;
+          tripleTerm = new RDF_Triple();
+          tripleTerm.read(iprot);
+          return tripleTerm;
         case VAL_INTEGER:
-          Long valInteger;
+          java.lang.Long valInteger;
           valInteger = iprot.readI64();
           return valInteger;
         case VAL_DOUBLE:
-          Double valDouble;
+          java.lang.Double valDouble;
           valDouble = iprot.readDouble();
           return valDouble;
         case VAL_DECIMAL:
@@ -539,10 +555,10 @@
           valDecimal.read(iprot);
           return valDecimal;
         default:
-          throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
+          throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
       }
     } else {
-      throw new TProtocolException("Couldn't find a field with field id " + fieldID);
+      throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
     }
   }
 
@@ -581,12 +597,16 @@
         RDF_REPEAT repeat = (RDF_REPEAT)value_;
         repeat.write(oprot);
         return;
+      case TRIPLE_TERM:
+        RDF_Triple tripleTerm = (RDF_Triple)value_;
+        tripleTerm.write(oprot);
+        return;
       case VAL_INTEGER:
-        Long valInteger = (Long)value_;
+        java.lang.Long valInteger = (java.lang.Long)value_;
         oprot.writeI64(valInteger);
         return;
       case VAL_DOUBLE:
-        Double valDouble = (Double)value_;
+        java.lang.Double valDouble = (java.lang.Double)value_;
         oprot.writeDouble(valDouble);
         return;
       case VAL_DECIMAL:
@@ -594,7 +614,7 @@
         valDecimal.write(oprot);
         return;
       default:
-        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
+        throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
     }
   }
 
@@ -617,6 +637,8 @@
         return UNDEFINED_FIELD_DESC;
       case REPEAT:
         return REPEAT_FIELD_DESC;
+      case TRIPLE_TERM:
+        return TRIPLE_TERM_FIELD_DESC;
       case VAL_INTEGER:
         return VAL_INTEGER_FIELD_DESC;
       case VAL_DOUBLE:
@@ -624,7 +646,7 @@
       case VAL_DECIMAL:
         return VAL_DECIMAL_FIELD_DESC;
       default:
-        throw new IllegalArgumentException("Unknown field id " + setField);
+        throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
     }
   }
 
@@ -638,6 +660,7 @@
     return _Fields.findByThriftIdOrThrow(id);
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
@@ -647,12 +670,12 @@
     if (getSetField() == _Fields.IRI) {
       return (RDF_IRI)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'iri' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'iri' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setIri(RDF_IRI value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.IRI;
     value_ = value;
   }
@@ -661,12 +684,12 @@
     if (getSetField() == _Fields.BNODE) {
       return (RDF_BNode)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'bnode' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'bnode' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setBnode(RDF_BNode value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.BNODE;
     value_ = value;
   }
@@ -675,12 +698,12 @@
     if (getSetField() == _Fields.LITERAL) {
       return (RDF_Literal)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'literal' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'literal' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setLiteral(RDF_Literal value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.LITERAL;
     value_ = value;
   }
@@ -689,12 +712,12 @@
     if (getSetField() == _Fields.PREFIX_NAME) {
       return (RDF_PrefixName)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'prefixName' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'prefixName' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setPrefixName(RDF_PrefixName value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.PREFIX_NAME;
     value_ = value;
   }
@@ -703,12 +726,12 @@
     if (getSetField() == _Fields.VARIABLE) {
       return (RDF_VAR)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'variable' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'variable' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setVariable(RDF_VAR value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.VARIABLE;
     value_ = value;
   }
@@ -717,12 +740,12 @@
     if (getSetField() == _Fields.ANY) {
       return (RDF_ANY)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'any' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'any' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setAny(RDF_ANY value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.ANY;
     value_ = value;
   }
@@ -731,12 +754,12 @@
     if (getSetField() == _Fields.UNDEFINED) {
       return (RDF_UNDEF)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'undefined' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'undefined' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setUndefined(RDF_UNDEF value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.UNDEFINED;
     value_ = value;
   }
@@ -745,21 +768,35 @@
     if (getSetField() == _Fields.REPEAT) {
       return (RDF_REPEAT)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'repeat' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'repeat' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setRepeat(RDF_REPEAT value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.REPEAT;
     value_ = value;
   }
 
+  public RDF_Triple getTripleTerm() {
+    if (getSetField() == _Fields.TRIPLE_TERM) {
+      return (RDF_Triple)getFieldValue();
+    } else {
+      throw new java.lang.RuntimeException("Cannot get field 'tripleTerm' because union is currently set to " + getFieldDesc(getSetField()).name);
+    }
+  }
+
+  public void setTripleTerm(RDF_Triple value) {
+    if (value == null) throw new java.lang.NullPointerException();
+    setField_ = _Fields.TRIPLE_TERM;
+    value_ = value;
+  }
+
   public long getValInteger() {
     if (getSetField() == _Fields.VAL_INTEGER) {
-      return (Long)getFieldValue();
+      return (java.lang.Long)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'valInteger' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'valInteger' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
@@ -770,9 +807,9 @@
 
   public double getValDouble() {
     if (getSetField() == _Fields.VAL_DOUBLE) {
-      return (Double)getFieldValue();
+      return (java.lang.Double)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'valDouble' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'valDouble' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
@@ -785,12 +822,12 @@
     if (getSetField() == _Fields.VAL_DECIMAL) {
       return (RDF_Decimal)getFieldValue();
     } else {
-      throw new RuntimeException("Cannot get field 'valDecimal' because union is currently set to " + getFieldDesc(getSetField()).name);
+      throw new java.lang.RuntimeException("Cannot get field 'valDecimal' because union is currently set to " + getFieldDesc(getSetField()).name);
     }
   }
 
   public void setValDecimal(RDF_Decimal value) {
-    if (value == null) throw new NullPointerException();
+    if (value == null) throw new java.lang.NullPointerException();
     setField_ = _Fields.VAL_DECIMAL;
     value_ = value;
   }
@@ -835,6 +872,11 @@
   }
 
 
+  public boolean isSetTripleTerm() {
+    return setField_ == _Fields.TRIPLE_TERM;
+  }
+
+
   public boolean isSetValInteger() {
     return setField_ == _Fields.VAL_INTEGER;
   }
@@ -850,7 +892,7 @@
   }
 
 
-  public boolean equals(Object other) {
+  public boolean equals(java.lang.Object other) {
     if (other instanceof RDF_Term) {
       return equals((RDF_Term)other);
     } else {
@@ -872,14 +914,22 @@
   }
 
 
-  /**
-   * If you'd like this to perform more respectably, use the hashcode generator option.
-   */
   @Override
   public int hashCode() {
-    return 0;
+    java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
+    list.add(this.getClass().getName());
+    org.apache.thrift.TFieldIdEnum setField = getSetField();
+    if (setField != null) {
+      list.add(setField.getThriftFieldId());
+      java.lang.Object value = getFieldValue();
+      if (value instanceof org.apache.thrift.TEnum) {
+        list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
+      } else {
+        list.add(value);
+      }
+    }
+    return list.hashCode();
   }
-
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
     try {
       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
@@ -889,7 +939,7 @@
   }
 
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Triple.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Triple.java
index 7a58bfa..61cd266 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Triple.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_Triple.java
@@ -1,52 +1,26 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_Triple implements org.apache.thrift.TBase<RDF_Triple, RDF_Triple._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_Triple implements org.apache.thrift.TBase<RDF_Triple, RDF_Triple._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_Triple> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Triple");
 
   private static final org.apache.thrift.protocol.TField S_FIELD_DESC = new org.apache.thrift.protocol.TField("S", org.apache.thrift.protocol.TType.STRUCT, (short)1);
   private static final org.apache.thrift.protocol.TField P_FIELD_DESC = new org.apache.thrift.protocol.TField("P", org.apache.thrift.protocol.TType.STRUCT, (short)2);
   private static final org.apache.thrift.protocol.TField O_FIELD_DESC = new org.apache.thrift.protocol.TField("O", org.apache.thrift.protocol.TType.STRUCT, (short)3);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_TripleStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_TripleTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_TripleStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_TripleTupleSchemeFactory();
 
-  public RDF_Term S; // required
-  public RDF_Term P; // required
-  public RDF_Term O; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term S; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term P; // required
+  public @org.apache.thrift.annotation.Nullable RDF_Term O; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -54,10 +28,10 @@
     P((short)2, "P"),
     O((short)3, "O");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -65,6 +39,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // S
@@ -84,21 +59,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -107,22 +83,22 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.S, new org.apache.thrift.meta_data.FieldMetaData("S", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
     tmpMap.put(_Fields.P, new org.apache.thrift.meta_data.FieldMetaData("P", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
     tmpMap.put(_Fields.O, new org.apache.thrift.meta_data.FieldMetaData("O", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Triple.class, metaDataMap);
   }
 
@@ -166,11 +142,12 @@
     this.O = null;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getS() {
     return this.S;
   }
 
-  public RDF_Triple setS(RDF_Term S) {
+  public RDF_Triple setS(@org.apache.thrift.annotation.Nullable RDF_Term S) {
     this.S = S;
     return this;
   }
@@ -190,11 +167,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getP() {
     return this.P;
   }
 
-  public RDF_Triple setP(RDF_Term P) {
+  public RDF_Triple setP(@org.apache.thrift.annotation.Nullable RDF_Term P) {
     this.P = P;
     return this;
   }
@@ -214,11 +192,12 @@
     }
   }
 
+  @org.apache.thrift.annotation.Nullable
   public RDF_Term getO() {
     return this.O;
   }
 
-  public RDF_Triple setO(RDF_Term O) {
+  public RDF_Triple setO(@org.apache.thrift.annotation.Nullable RDF_Term O) {
     this.O = O;
     return this;
   }
@@ -238,7 +217,7 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case S:
       if (value == null) {
@@ -267,7 +246,8 @@
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case S:
       return getS();
@@ -279,13 +259,13 @@
       return getO();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
@@ -296,11 +276,11 @@
     case O:
       return isSetO();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_Triple)
@@ -311,6 +291,8 @@
   public boolean equals(RDF_Triple that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_S = true && this.isSetS();
     boolean that_present_S = true && that.isSetS();
@@ -344,43 +326,57 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetS()) ? 131071 : 524287);
+    if (isSetS())
+      hashCode = hashCode * 8191 + S.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetP()) ? 131071 : 524287);
+    if (isSetP())
+      hashCode = hashCode * 8191 + P.hashCode();
+
+    hashCode = hashCode * 8191 + ((isSetO()) ? 131071 : 524287);
+    if (isSetO())
+      hashCode = hashCode * 8191 + O.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_Triple other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_Triple typedOther = (RDF_Triple)other;
 
-    lastComparison = Boolean.valueOf(isSetS()).compareTo(typedOther.isSetS());
+    lastComparison = java.lang.Boolean.valueOf(isSetS()).compareTo(other.isSetS());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetS()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.S, typedOther.S);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.S, other.S);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetP()).compareTo(typedOther.isSetP());
+    lastComparison = java.lang.Boolean.valueOf(isSetP()).compareTo(other.isSetP());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetP()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.P, typedOther.P);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.P, other.P);
       if (lastComparison != 0) {
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetO()).compareTo(typedOther.isSetO());
+    lastComparison = java.lang.Boolean.valueOf(isSetO()).compareTo(other.isSetO());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetO()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.O, typedOther.O);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.O, other.O);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -388,21 +384,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_Triple(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_Triple(");
     boolean first = true;
 
     sb.append("S:");
@@ -454,7 +451,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -462,13 +459,13 @@
     }
   }
 
-  private static class RDF_TripleStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_TripleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_TripleStandardScheme getScheme() {
       return new RDF_TripleStandardScheme();
     }
   }
 
-  private static class RDF_TripleStandardScheme extends StandardScheme<RDF_Triple> {
+  private static class RDF_TripleStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_Triple> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_Triple struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -543,17 +540,17 @@
 
   }
 
-  private static class RDF_TripleTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_TripleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_TripleTupleScheme getScheme() {
       return new RDF_TripleTupleScheme();
     }
   }
 
-  private static class RDF_TripleTupleScheme extends TupleScheme<RDF_Triple> {
+  private static class RDF_TripleTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_Triple> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Triple struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.S.write(oprot);
       struct.P.write(oprot);
       struct.O.write(oprot);
@@ -561,7 +558,7 @@
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_Triple struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.S = new RDF_Term();
       struct.S.read(iprot);
       struct.setSIsSet(true);
@@ -574,5 +571,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_UNDEF.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_UNDEF.java
index 934ade4..1afc280 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_UNDEF.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_UNDEF.java
@@ -1,55 +1,29 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_UNDEF implements org.apache.thrift.TBase<RDF_UNDEF, RDF_UNDEF._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_UNDEF implements org.apache.thrift.TBase<RDF_UNDEF, RDF_UNDEF._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_UNDEF> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_UNDEF");
 
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_UNDEFStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_UNDEFTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_UNDEFStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_UNDEFTupleSchemeFactory();
 
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -57,6 +31,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         default:
@@ -70,21 +45,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -93,14 +69,14 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_UNDEF.class, metaDataMap);
   }
 
@@ -121,30 +97,31 @@
   public void clear() {
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_UNDEF)
@@ -155,41 +132,46 @@
   public boolean equals(RDF_UNDEF that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     return true;
   }
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_UNDEF other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_UNDEF typedOther = (RDF_UNDEF)other;
 
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_UNDEF(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_UNDEF(");
     boolean first = true;
 
     sb.append(")");
@@ -209,7 +191,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -217,13 +199,13 @@
     }
   }
 
-  private static class RDF_UNDEFStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_UNDEFStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_UNDEFStandardScheme getScheme() {
       return new RDF_UNDEFStandardScheme();
     }
   }
 
-  private static class RDF_UNDEFStandardScheme extends StandardScheme<RDF_UNDEF> {
+  private static class RDF_UNDEFStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_UNDEF> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_UNDEF struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -256,24 +238,27 @@
 
   }
 
-  private static class RDF_UNDEFTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_UNDEFTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_UNDEFTupleScheme getScheme() {
       return new RDF_UNDEFTupleScheme();
     }
   }
 
-  private static class RDF_UNDEFTupleScheme extends TupleScheme<RDF_UNDEF> {
+  private static class RDF_UNDEFTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_UNDEF> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_UNDEF struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_UNDEF struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VAR.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VAR.java
index 280f9d5..725a413 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VAR.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VAR.java
@@ -1,57 +1,31 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_VAR implements org.apache.thrift.TBase<RDF_VAR, RDF_VAR._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_VAR implements org.apache.thrift.TBase<RDF_VAR, RDF_VAR._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_VAR> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_VAR");
 
   private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_VARStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_VARTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_VARStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_VARTupleSchemeFactory();
 
-  public String name; // required
+  public @org.apache.thrift.annotation.Nullable java.lang.String name; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     NAME((short)1, "name");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -59,6 +33,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // NAME
@@ -74,21 +49,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -97,18 +73,18 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_VAR.class, metaDataMap);
   }
 
@@ -116,7 +92,7 @@
   }
 
   public RDF_VAR(
-    String name)
+    java.lang.String name)
   {
     this();
     this.name = name;
@@ -140,11 +116,12 @@
     this.name = null;
   }
 
-  public String getName() {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.String getName() {
     return this.name;
   }
 
-  public RDF_VAR setName(String name) {
+  public RDF_VAR setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
     this.name = name;
     return this;
   }
@@ -164,43 +141,44 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case NAME:
       if (value == null) {
         unsetName();
       } else {
-        setName((String)value);
+        setName((java.lang.String)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case NAME:
       return getName();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     case NAME:
       return isSetName();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_VAR)
@@ -211,6 +189,8 @@
   public boolean equals(RDF_VAR that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_name = true && this.isSetName();
     boolean that_present_name = true && that.isSetName();
@@ -226,23 +206,29 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
+    if (isSetName())
+      hashCode = hashCode * 8191 + name.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_VAR other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_VAR typedOther = (RDF_VAR)other;
 
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
+    lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetName()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -250,21 +236,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_VAR(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_VAR(");
     boolean first = true;
 
     sb.append("name:");
@@ -294,7 +281,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -302,13 +289,13 @@
     }
   }
 
-  private static class RDF_VARStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_VARStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_VARStandardScheme getScheme() {
       return new RDF_VARStandardScheme();
     }
   }
 
-  private static class RDF_VARStandardScheme extends StandardScheme<RDF_VAR> {
+  private static class RDF_VARStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_VAR> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_VAR struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -354,27 +341,30 @@
 
   }
 
-  private static class RDF_VARTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_VARTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_VARTupleScheme getScheme() {
       return new RDF_VARTupleScheme();
     }
   }
 
-  private static class RDF_VARTupleScheme extends TupleScheme<RDF_VAR> {
+  private static class RDF_VARTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_VAR> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_VAR struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       oprot.writeString(struct.name);
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_VAR struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
       struct.name = iprot.readString();
       struct.setNameIsSet(true);
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VarTuple.java b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VarTuple.java
index 0700e00..02aa9c5 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VarTuple.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/thrift/wire/RDF_VarTuple.java
@@ -1,57 +1,31 @@
 /**
- * Autogenerated by Thrift Compiler (0.9.0)
+ * Autogenerated by Thrift Compiler (0.13.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  *  @generated
  */
 package org.apache.jena.riot.thrift.wire;
 
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 @SuppressWarnings("all")
-public class RDF_VarTuple implements org.apache.thrift.TBase<RDF_VarTuple, RDF_VarTuple._Fields>, java.io.Serializable, Cloneable {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-05-24")
+public class RDF_VarTuple implements org.apache.thrift.TBase<RDF_VarTuple, RDF_VarTuple._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_VarTuple> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_VarTuple");
 
   private static final org.apache.thrift.protocol.TField VARS_FIELD_DESC = new org.apache.thrift.protocol.TField("vars", org.apache.thrift.protocol.TType.LIST, (short)1);
 
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new RDF_VarTupleStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new RDF_VarTupleTupleSchemeFactory());
-  }
+  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_VarTupleStandardSchemeFactory();
+  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_VarTupleTupleSchemeFactory();
 
-  public List<RDF_VAR> vars; // required
+  public @org.apache.thrift.annotation.Nullable java.util.List<RDF_VAR> vars; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     VARS((short)1, "vars");
 
-    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
     static {
-      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
         byName.put(field.getFieldName(), field);
       }
     }
@@ -59,6 +33,7 @@
     /**
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
+    @org.apache.thrift.annotation.Nullable
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
         case 1: // VARS
@@ -74,21 +49,22 @@
      */
     public static _Fields findByThriftIdOrThrow(int fieldId) {
       _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
       return fields;
     }
 
     /**
      * Find the _Fields constant that matches name, or null if its not found.
      */
-    public static _Fields findByName(String name) {
+    @org.apache.thrift.annotation.Nullable
+    public static _Fields findByName(java.lang.String name) {
       return byName.get(name);
     }
 
     private final short _thriftId;
-    private final String _fieldName;
+    private final java.lang.String _fieldName;
 
-    _Fields(short thriftId, String fieldName) {
+    _Fields(short thriftId, java.lang.String fieldName) {
       _thriftId = thriftId;
       _fieldName = fieldName;
     }
@@ -97,19 +73,19 @@
       return _thriftId;
     }
 
-    public String getFieldName() {
+    public java.lang.String getFieldName() {
       return _fieldName;
     }
   }
 
   // isset id assignments
-  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.VARS, new org.apache.thrift.meta_data.FieldMetaData("vars", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_VAR.class))));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_VarTuple.class, metaDataMap);
   }
 
@@ -117,7 +93,7 @@
   }
 
   public RDF_VarTuple(
-    List<RDF_VAR> vars)
+    java.util.List<RDF_VAR> vars)
   {
     this();
     this.vars = vars;
@@ -128,7 +104,7 @@
    */
   public RDF_VarTuple(RDF_VarTuple other) {
     if (other.isSetVars()) {
-      List<RDF_VAR> __this__vars = new ArrayList<RDF_VAR>();
+      java.util.List<RDF_VAR> __this__vars = new java.util.ArrayList<RDF_VAR>(other.vars.size());
       for (RDF_VAR other_element : other.vars) {
         __this__vars.add(new RDF_VAR(other_element));
       }
@@ -149,22 +125,24 @@
     return (this.vars == null) ? 0 : this.vars.size();
   }
 
+  @org.apache.thrift.annotation.Nullable
   public java.util.Iterator<RDF_VAR> getVarsIterator() {
     return (this.vars == null) ? null : this.vars.iterator();
   }
 
   public void addToVars(RDF_VAR elem) {
     if (this.vars == null) {
-      this.vars = new ArrayList<RDF_VAR>();
+      this.vars = new java.util.ArrayList<RDF_VAR>();
     }
     this.vars.add(elem);
   }
 
-  public List<RDF_VAR> getVars() {
+  @org.apache.thrift.annotation.Nullable
+  public java.util.List<RDF_VAR> getVars() {
     return this.vars;
   }
 
-  public RDF_VarTuple setVars(List<RDF_VAR> vars) {
+  public RDF_VarTuple setVars(@org.apache.thrift.annotation.Nullable java.util.List<RDF_VAR> vars) {
     this.vars = vars;
     return this;
   }
@@ -184,43 +162,44 @@
     }
   }
 
-  public void setFieldValue(_Fields field, Object value) {
+  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
     switch (field) {
     case VARS:
       if (value == null) {
         unsetVars();
       } else {
-        setVars((List<RDF_VAR>)value);
+        setVars((java.util.List<RDF_VAR>)value);
       }
       break;
 
     }
   }
 
-  public Object getFieldValue(_Fields field) {
+  @org.apache.thrift.annotation.Nullable
+  public java.lang.Object getFieldValue(_Fields field) {
     switch (field) {
     case VARS:
       return getVars();
 
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
     if (field == null) {
-      throw new IllegalArgumentException();
+      throw new java.lang.IllegalArgumentException();
     }
 
     switch (field) {
     case VARS:
       return isSetVars();
     }
-    throw new IllegalStateException();
+    throw new java.lang.IllegalStateException();
   }
 
   @Override
-  public boolean equals(Object that) {
+  public boolean equals(java.lang.Object that) {
     if (that == null)
       return false;
     if (that instanceof RDF_VarTuple)
@@ -231,6 +210,8 @@
   public boolean equals(RDF_VarTuple that) {
     if (that == null)
       return false;
+    if (this == that)
+      return true;
 
     boolean this_present_vars = true && this.isSetVars();
     boolean that_present_vars = true && that.isSetVars();
@@ -246,23 +227,29 @@
 
   @Override
   public int hashCode() {
-    return 0;
+    int hashCode = 1;
+
+    hashCode = hashCode * 8191 + ((isSetVars()) ? 131071 : 524287);
+    if (isSetVars())
+      hashCode = hashCode * 8191 + vars.hashCode();
+
+    return hashCode;
   }
 
+  @Override
   public int compareTo(RDF_VarTuple other) {
     if (!getClass().equals(other.getClass())) {
       return getClass().getName().compareTo(other.getClass().getName());
     }
 
     int lastComparison = 0;
-    RDF_VarTuple typedOther = (RDF_VarTuple)other;
 
-    lastComparison = Boolean.valueOf(isSetVars()).compareTo(typedOther.isSetVars());
+    lastComparison = java.lang.Boolean.valueOf(isSetVars()).compareTo(other.isSetVars());
     if (lastComparison != 0) {
       return lastComparison;
     }
     if (isSetVars()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vars, typedOther.vars);
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vars, other.vars);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -270,21 +257,22 @@
     return 0;
   }
 
+  @org.apache.thrift.annotation.Nullable
   public _Fields fieldForId(int fieldId) {
     return _Fields.findByThriftId(fieldId);
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    scheme(iprot).read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    scheme(oprot).write(oprot, this);
   }
 
   @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RDF_VarTuple(");
+  public java.lang.String toString() {
+    java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_VarTuple(");
     boolean first = true;
 
     sb.append("vars:");
@@ -311,7 +299,7 @@
     }
   }
 
-  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
     try {
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
@@ -319,13 +307,13 @@
     }
   }
 
-  private static class RDF_VarTupleStandardSchemeFactory implements SchemeFactory {
+  private static class RDF_VarTupleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_VarTupleStandardScheme getScheme() {
       return new RDF_VarTupleStandardScheme();
     }
   }
 
-  private static class RDF_VarTupleStandardScheme extends StandardScheme<RDF_VarTuple> {
+  private static class RDF_VarTupleStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_VarTuple> {
 
     public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_VarTuple struct) throws org.apache.thrift.TException {
       org.apache.thrift.protocol.TField schemeField;
@@ -341,13 +329,13 @@
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
                 org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
-                struct.vars = new ArrayList<RDF_VAR>(_list0.size);
-                for (int _i1 = 0; _i1 < _list0.size; ++_i1)
+                struct.vars = new java.util.ArrayList<RDF_VAR>(_list0.size);
+                @org.apache.thrift.annotation.Nullable RDF_VAR _elem1;
+                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                 {
-                  RDF_VAR _elem2; // required
-                  _elem2 = new RDF_VAR();
-                  _elem2.read(iprot);
-                  struct.vars.add(_elem2);
+                  _elem1 = new RDF_VAR();
+                  _elem1.read(iprot);
+                  struct.vars.add(_elem1);
                 }
                 iprot.readListEnd();
               }
@@ -389,18 +377,18 @@
 
   }
 
-  private static class RDF_VarTupleTupleSchemeFactory implements SchemeFactory {
+  private static class RDF_VarTupleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
     public RDF_VarTupleTupleScheme getScheme() {
       return new RDF_VarTupleTupleScheme();
     }
   }
 
-  private static class RDF_VarTupleTupleScheme extends TupleScheme<RDF_VarTuple> {
+  private static class RDF_VarTupleTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_VarTuple> {
 
     @Override
     public void write(org.apache.thrift.protocol.TProtocol prot, RDF_VarTuple struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
+      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      java.util.BitSet optionals = new java.util.BitSet();
       if (struct.isSetVars()) {
         optionals.set(0);
       }
@@ -418,18 +406,18 @@
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, RDF_VarTuple struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(1);
+      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      java.util.BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
         {
           org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.vars = new ArrayList<RDF_VAR>(_list5.size);
-          for (int _i6 = 0; _i6 < _list5.size; ++_i6)
+          struct.vars = new java.util.ArrayList<RDF_VAR>(_list5.size);
+          @org.apache.thrift.annotation.Nullable RDF_VAR _elem6;
+          for (int _i7 = 0; _i7 < _list5.size; ++_i7)
           {
-            RDF_VAR _elem7; // required
-            _elem7 = new RDF_VAR();
-            _elem7.read(iprot);
-            struct.vars.add(_elem7);
+            _elem6 = new RDF_VAR();
+            _elem6.read(iprot);
+            struct.vars.add(_elem6);
           }
         }
         struct.setVarsIsSet(true);
@@ -437,5 +425,8 @@
     }
   }
 
+  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+  }
 }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java b/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
index d29fe17..ade0820 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
@@ -172,9 +172,6 @@
     // Secondary marker for globally allocated variables.
     private static final String globalVar =     "." ;
 
-    /** Marker for variables replacing blank nodes in SPARQL Update patterns */
-    public static final String allocVarBNodeToVar =  "~" ;
-
     /** Marker for variables renamed to make variables hidden by scope have globally unique names */
     public static final String allocVarScopeHiding =  "/" ;
 
@@ -187,13 +184,16 @@
     // These strings are without the leading "?"
 
     // Put each constant here and not in the place the variable allocator created.
-    // Alwats 0, 1, 2, 3 after these prefixes.
+    // Always 0, 1, 2, 3 after these prefixes.
 
-    public static final String allocGlobalVarMarker     = allocVarMarker+globalVar ;    // VarAlloc
+    //public static final String allocGlobalVarMarker     = allocVarMarker+globalVar ;    // VarAlloc
     public static final String allocPathVariables       = allocVarAnonMarker+"P" ;      // PathCompiler
     public static final String allocQueryVariables      = allocVarMarker ;              // Query
+    
+    /** Marker for RDF* variables */
+    public static final String allocVarTripleTerm      = "~";                           // RX, SolverRX
+    
     public static final String allocParserAnonVars      = allocVarAnonMarker ;          // LabelToModeMap
-
     // SSE
     public static final String allocSSEUnamedVars       = "_" ;                         // ParseHandlerPlain - SSE token "?" - legal SPARQL
     public static final String allocSSEAnonVars         = allocVarAnonMarker ;          // ParseHandlerPlain - SSE token "??"
@@ -219,6 +219,8 @@
     /** Context key for the dataset for the current query execution. */
     public static final Symbol sysCurrentDataset        = Symbol.create(systemVarNS+"dataset") ;
 
+    public static final Symbol sysVarAllocRDFStar       = Symbol.create(systemVarNS+"varAllocRDFStar") ;
+    
     /** Context key for the dataset description (if any).
      *  See the <a href="http://www.w3.org/TR/sparql11-protocol">SPARQL protocol</a>.
      *  <p>
@@ -264,7 +266,7 @@
     /** Context symbol for a supplied {@link Prologue} (used for text out of result sets). */
     public static final Symbol symPrologue                 = SystemARQ.allocSymbol("prologue");
 
-    /** Context key for making all SELECT queries have DISTINCT applied, whether stated ot not */
+    /** Context key for making all SELECT queries have DISTINCT applied, whether stated or not */
     public static final Symbol autoDistinct             = SystemARQ.allocSymbol("autoDistinct") ;
 
     // Context keys : some here, some in ARQ - sort out
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
index 41fbef3..071f21c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
@@ -18,71 +18,76 @@
 
 package org.apache.jena.sparql.algebra;
 
-import java.util.* ;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.List;
 
-import org.apache.jena.atlas.lib.Lib ;
-import org.apache.jena.atlas.lib.Pair ;
-import org.apache.jena.atlas.logging.Log ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.query.ARQ ;
-import org.apache.jena.query.Query ;
-import org.apache.jena.query.SortCondition ;
-import org.apache.jena.sparql.ARQInternalErrorException ;
-import org.apache.jena.sparql.algebra.op.* ;
-import org.apache.jena.sparql.algebra.optimize.TransformSimplify ;
-import org.apache.jena.sparql.core.* ;
-import org.apache.jena.sparql.engine.binding.Binding ;
-import org.apache.jena.sparql.expr.* ;
-import org.apache.jena.sparql.path.PathLib ;
-import org.apache.jena.sparql.syntax.* ;
-import org.apache.jena.sparql.util.Context ;
+import org.apache.jena.atlas.lib.Lib;
+import org.apache.jena.atlas.lib.Pair;
+import org.apache.jena.atlas.logging.Log;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.ARQ;
+import org.apache.jena.query.Query;
+import org.apache.jena.query.SortCondition;
+import org.apache.jena.sparql.ARQInternalErrorException;
+import org.apache.jena.sparql.algebra.op.*;
+import org.apache.jena.sparql.algebra.optimize.TransformSimplify;
+import org.apache.jena.sparql.core.*;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.expr.*;
+import org.apache.jena.sparql.path.PathLib;
+import org.apache.jena.sparql.syntax.*;
+import org.apache.jena.sparql.util.Context;
 
 /**
  * Class used to compile SPARQL queries into SPARQL algebra.
  * This is the SPARQL standard defined process of abstract syntax to algebra.
  */
-public class AlgebraGenerator 
+public class AlgebraGenerator
 {
-    // Fixed filter position means leave exactly where it is syntactically (illegal SPARQL)
-    // Helpful only to write exactly what you mean and test the full query compiler.
-    private boolean fixedFilterPosition = false ;
-    private Context context ;
-    private final int subQueryDepth ;
-    
+    private final Context context;
+    private final int subQueryDepth;
+
     // simplifyInAlgebraGeneration=true is the alternative reading of
-    // the DAWG Algebra translation algorithm. 
+    // the DAWG Algebra translation algorithm.
 
     // If we simplify during algebra generation, it changes the SPARQL for OPTIONAL {{ FILTER }}
     // The  {{}} results in (join unit (filter ...)) the filter is not moved
-    // into the LeftJoin.  
-    
-    static final private boolean applySimplification = true ;                   // False allows raw algebra to be generated (testing) 
-    static final private boolean simplifyTooEarlyInAlgebraGeneration = false ;  // False is the correct setting. 
+    // into the LeftJoin.
+
+    // Fixed filter position means leave exactly where it is syntactically (illegal SPARQL)
+    // Helpful only to write exactly what you mean and test the full query compiler.
+    static private final boolean fixedFilterPosition                 = false;
+
+    // False allows raw algebra to be generated (testing)
+    static final private boolean applySimplification                 = true;
+
+    // False is the correct setting.
+    static final private boolean simplifyTooEarlyInAlgebraGeneration = false;
 
     /**
      * Create a new generator
      * @param context Context
      */
-    public AlgebraGenerator(Context context)
-    {
-        this (context != null ? context : ARQ.getContext().copy(), 0) ;
+    public AlgebraGenerator(Context context) {
+        this (context != null ? context : ARQ.getContext().copy(), 0);
     }
-    
+
     /**
      * Create a new generator
      */
-    public AlgebraGenerator() { this(null) ; } 
-    
-    protected AlgebraGenerator(Context context, int depth)
-    {
-        this.context = context ;
-        this.subQueryDepth = depth ;
+    public AlgebraGenerator() { this(null); }
+
+    protected AlgebraGenerator(Context context, int depth) {
+        this.context = context;
+        this.subQueryDepth = depth;
     }
-    
+
     //-- Public operations.  Do not call recursively (call compileElement).
     // These operations apply the simplification step which is done, once, at the end.
-    
+
     /**
      * Compile a query
      * <p>
@@ -91,71 +96,70 @@
      * @param query Query to compile
      * @return Compiled algebra
      */
-    public Op compile(Query query)
-    {
-        Op op = compile(query.getQueryPattern()) ;     // Not compileElement - may need to apply simplification.
-        
-        op = compileModifiers(query, op) ;
-        return op ;
+    public Op compile(Query query) {
+        Op op = compile(query.getQueryPattern());     // Not compileElement - may need to apply simplification.
+
+        op = compileModifiers(query, op);
+        return op;
     }
-    
-    protected static Transform simplify = new TransformSimplify() ;
-    
+
+    protected static Transform simplify = new TransformSimplify();
+
     /**
      * Compile any structural element
      * @param elt Element
      * @return Compiled algebra
      */
-    public Op compile(Element elt)
-    {
-        Op op = compileElement(elt) ;
-        Op op2 = op ;
+    public Op compile(Element elt) {
+        Op op = compileElement(elt);
+        Op op2 = op;
         if ( ! simplifyTooEarlyInAlgebraGeneration && applySimplification && simplify != null )
-            op2 = simplify(op) ;
+            op2 = simplify(op);
         return op2;
     }
-    
-    protected static Op simplify(Op op)
-    {
-        return Transformer.transform(simplify, op) ;
+
+    protected static Op simplify(Op op) {
+        return Transformer.transform(simplify, op);
     }
 
     // This is the operation to call for recursive application.
-    protected Op compileElement(Element elt)
-    {
+    protected Op compileElement(Element elt) {
         if ( elt instanceof ElementGroup )
-            return compileElementGroup((ElementGroup)elt) ;
-      
+            return compileElementGroup((ElementGroup)elt);
+
         if ( elt instanceof ElementUnion )
-            return compileElementUnion((ElementUnion)elt) ;
-      
+            return compileElementUnion((ElementUnion)elt);
+
         if ( elt instanceof ElementNamedGraph )
-            return compileElementGraph((ElementNamedGraph)elt) ; 
-      
+            return compileElementGraph((ElementNamedGraph)elt);
+
         if ( elt instanceof ElementService )
-            return compileElementService((ElementService)elt) ; 
-        
+            return compileElementService((ElementService)elt);
+
         // This is only here for queries built programmatically
-        // (triple patterns not in a group) 
+        // (triple patterns not in a group)
         if ( elt instanceof ElementTriplesBlock )
-            return compileBasicPattern(((ElementTriplesBlock)elt).getPattern()) ;
-        
+            return compileBasicPattern(((ElementTriplesBlock)elt).getPattern());
+
+        if ( elt instanceof ElementFind )
+            return compileFind((ElementFind)elt);
+
         // Ditto.
         if ( elt instanceof ElementPathBlock )
-            return compilePathBlock(((ElementPathBlock)elt).getPattern()) ;
+            return compilePathBlock(((ElementPathBlock)elt).getPattern());
 
         if ( elt instanceof ElementSubQuery )
-            return compileElementSubquery((ElementSubQuery)elt) ; 
-        
+            return compileElementSubquery((ElementSubQuery)elt);
+
         if ( elt instanceof ElementData )
-            return compileElementData((ElementData)elt) ; 
+            return compileElementData((ElementData)elt);
 
         if ( elt == null )
-            return OpNull.create() ;
+            return OpNull.create();
 
         return compileUnknownElement(elt, "compile(Element)/Not a structural element: "+Lib.className(elt));
     }
-    
+
     /**
      * Future extension point to allow the algebra generator to be more easily extended to understand new {@link Element} implementations
      * that user defined language extensions may introduce.
@@ -166,12 +170,11 @@
      * @param error Error message if unable to compile the given element type
      * @return Algebra
      */
-    protected Op compileUnknownElement(Element elt, String error)
-    {
-        broken(error) ;
+    protected Op compileUnknownElement(Element elt, String error) {
+        broken(error);
         return null;
     }
-    
+
     //Produce the algebra for a single group.
     //<a href="http://www.w3.org/TR/rdf-sparql-query/#sparqlQuery">Translation to the SPARQL Algebra</a>
     //
@@ -183,306 +186,262 @@
     // Step : (Groups and unions) Was done during parsing to get ElementUnion.
     // Step : Graph Patterns [compileOneInGroup]
     // Step : Filters [here]
-    // Simplification: Done later 
+    // Simplification: Done later
     // If simplification is done now, it changes OPTIONAL { { ?x :p ?w . FILTER(?w>23) } } because it removes the
-    //   (join Z (filter...)) that in turn stops the filter getting moved into the LeftJoin.  
-    //   It need a depth of 2 or more {{ }} for this to happen. 
-    
-    protected Op compileElementGroup(ElementGroup groupElt)
-    {
-        Pair<List<Expr>, List<Element>> pair = prepareGroup(groupElt) ;
-        List<Expr> filters = pair.getLeft() ;
-        List<Element> groupElts = pair.getRight() ;
+    //   (join Z (filter...)) that in turn stops the filter getting moved into the LeftJoin.
+    //   It need a depth of 2 or more {{ }} for this to happen.
+
+    protected Op compileElementGroup(ElementGroup groupElt) {
+        Pair<List<Expr>, List<Element>> pair = prepareGroup(groupElt);
+        List<Expr> filters = pair.getLeft();
+        List<Element> groupElts = pair.getRight();
 
         // Compile the consolidated group elements.
         // "current" is the completed part only - there may be thing pushed into the accumulator.
-        Op current = OpTable.unit() ;
-        Deque<Op> acc = new ArrayDeque<>() ;
+        Op current = OpTable.unit();
+        Deque<Op> acc = new ArrayDeque<>();
 
-        for ( Element elt : groupElts )
-        {
-            if ( elt != null )
-            {
-                current = compileOneInGroup( elt, current, acc );
+        for ( Element elt : groupElts ) {
+            if ( elt != null ) {
+                current = compileOneInGroup(elt, current, acc);
             }
         }
-        
+
         // Deal with any remaining ops.
-        //current = joinOpAcc(current, acc) ;
-        
-        if ( filters != null )
-        {
+        //current = joinOpAcc(current, acc);
+
+        if ( filters != null ) {
             // Put filters round the group.
             for ( Expr expr : filters )
-                current = OpFilter.filter(expr, current) ;
+                current = OpFilter.filter(expr, current);
         }
-        return current ;
+        return current;
     }
 
     /* Extract filters, merge adjacent BGPs, do BIND.
      * When extracting filters, BGP or PathBlocks may become adjacent
-     * so merge them into one. 
-     * Return a list of elements with any filters at the end. 
+     * so merge them into one.
+     * Return a list of elements with any filters at the end.
      */
-    
-    protected Pair<List<Expr>, List<Element>> prepareGroup(ElementGroup groupElt)
-    {
-        List<Element> groupElts = new ArrayList<>() ;
-        
-        PathBlock currentPathBlock = null ;
-        List<Expr> filters = null ;
-        
-        for (Element elt : groupElt.getElements() )
-        {
-            if ( ! fixedFilterPosition && elt instanceof ElementFilter )
-            {
-                // For fixed position filters, drop through to general element processing.
+
+    protected Pair<List<Expr>, List<Element>> prepareGroup(ElementGroup groupElt) {
+        List<Element> groupElts = new ArrayList<>();
+
+        PathBlock currentPathBlock = null;
+        List<Expr> filters = null;
+
+        for ( Element elt : groupElt.getElements() ) {
+            if ( !fixedFilterPosition && elt instanceof ElementFilter ) {
+                // For fixed position filters, drop through to general element
+                // processing.
                 // It's also illegal SPARQL - filters operate over the whole group.
-                ElementFilter f = (ElementFilter)elt ;
+                ElementFilter f = (ElementFilter)elt;
                 if ( filters == null )
-                    filters = new ArrayList<>() ;
-                filters.add(f.getExpr()) ;
+                    filters = new ArrayList<>();
+                filters.add(f.getExpr());
                 // Collect filters but do not place them yet.
-                continue ;
+                continue;
             }
 
-            // The parser does not generate ElementTriplesBlock (SPARQL 1.1) 
-            // but SPARQL 1.0 does and also we cope for programmatically built queries
-            
-            if ( elt instanceof ElementTriplesBlock )
-            {
-                ElementTriplesBlock etb = (ElementTriplesBlock)elt ;
+            // The parser does not generate ElementTriplesBlock (SPARQL 1.1)
+            // but SPARQL 1.0 does and also we cope for programmatically built
+            // queries
 
-                if ( currentPathBlock == null )
-                {
-                    ElementPathBlock etb2 = new ElementPathBlock() ;
-                    currentPathBlock = etb2.getPattern() ;
-                    groupElts.add(etb2) ;
+            if ( elt instanceof ElementTriplesBlock ) {
+                ElementTriplesBlock etb = (ElementTriplesBlock)elt;
+
+                if ( currentPathBlock == null ) {
+                    ElementPathBlock etb2 = new ElementPathBlock();
+                    currentPathBlock = etb2.getPattern();
+                    groupElts.add(etb2);
                 }
-                
-                for ( Triple t : etb.getPattern())
-                    currentPathBlock.add(new TriplePath(t)) ;
-                continue ;
+
+                for ( Triple t : etb.getPattern() )
+                    currentPathBlock.add(new TriplePath(t));
+                continue;
             }
-            
+
             // To PathLib
-            
-            if ( elt instanceof ElementPathBlock )
-            {
-                ElementPathBlock epb = (ElementPathBlock)elt ;
-                
-                if ( currentPathBlock == null )
-                {
-                    ElementPathBlock etb2 = new ElementPathBlock() ;
-                    currentPathBlock = etb2.getPattern() ;
-                    groupElts.add(etb2) ;
+
+            if ( elt instanceof ElementPathBlock ) {
+                ElementPathBlock epb = (ElementPathBlock)elt;
+
+                if ( currentPathBlock == null ) {
+                    ElementPathBlock etb2 = new ElementPathBlock();
+                    currentPathBlock = etb2.getPattern();
+                    groupElts.add(etb2);
                 }
 
-                currentPathBlock.addAll(epb.getPattern()) ;
-                continue ;
+                currentPathBlock.addAll(epb.getPattern());
+                continue;
             }
-            
+
             // else
-            
+
             // Not BGP, path or filters.
             // Clear any BGP-related triple accumulators.
-            currentPathBlock = null ;
+            currentPathBlock = null;
             // Add this element
-            groupElts.add(elt) ;
+            groupElts.add(elt);
         }
-        return Pair.create(filters, groupElts) ;
+        return Pair.create(filters, groupElts);
     }
-    
-    protected Op compileOneInGroup(Element elt, Op current, Deque<Op> acc)
-    {
-        // Elements that operate over their left hand size (query syntax). 
-        
-        if ( elt instanceof ElementAssign )
-        {
-            ElementAssign assign = (ElementAssign)elt ;
-            return OpAssign.assign(current, assign.getVar(), assign.getExpr()) ;
+
+    protected Op compileOneInGroup(Element elt, Op current, Deque<Op> acc) {
+        // Elements that operate over their left hand size (query syntax).
+
+        if ( elt instanceof ElementAssign ) {
+            ElementAssign assign = (ElementAssign)elt;
+            return OpAssign.assign(current, assign.getVar(), assign.getExpr());
         }
 
-        if ( elt instanceof ElementBind )
-        {
-            ElementBind bind = (ElementBind)elt ;
-            return OpExtend.create(current, bind.getVar(), bind.getExpr()) ;
+        if ( elt instanceof ElementBind ) {
+            ElementBind bind = (ElementBind)elt;
+            return OpExtend.create(current, bind.getVar(), bind.getExpr());
         }
 
-        if ( elt instanceof ElementOptional )
-        {
-            ElementOptional eltOpt = (ElementOptional)elt ;
-            return compileElementOptional(eltOpt, current) ;
+        if ( elt instanceof ElementOptional ) {
+            ElementOptional eltOpt = (ElementOptional)elt;
+            return compileElementOptional(eltOpt, current);
         }
-        
-        if ( elt instanceof ElementMinus )
-        {
-            ElementMinus elt2 = (ElementMinus)elt ;
-            Op op = compileElementMinus(current, elt2) ;
-            return op ;
+
+        if ( elt instanceof ElementMinus ) {
+            ElementMinus elt2 = (ElementMinus)elt;
+            Op op = compileElementMinus(current, elt2);
+            return op;
         }
 
         // All elements that simply "join" into the algebra.
-        if ( elt instanceof ElementGroup        || 
-             elt instanceof ElementNamedGraph   ||
-             elt instanceof ElementService      ||
-             elt instanceof ElementUnion        || 
-             elt instanceof ElementSubQuery     ||
-             elt instanceof ElementData         ||
-             elt instanceof ElementTriplesBlock ||
-             elt instanceof ElementPathBlock
-            )
-        {
-            Op op = compileElement(elt) ;
-            return join(current, op) ;
+        if ( elt instanceof ElementGroup || elt instanceof ElementNamedGraph || elt instanceof ElementService || elt instanceof ElementUnion
+             || elt instanceof ElementSubQuery || elt instanceof ElementData || elt instanceof ElementTriplesBlock
+             || elt instanceof ElementPathBlock || elt instanceof ElementFind ) {
+            Op op = compileElement(elt);
+            return join(current, op);
         }
-        
+
         // Specials.
-        
-        if ( elt instanceof ElementExists )
-        {
-            ElementExists elt2 = (ElementExists)elt ;
-            Op op = compileElementExists(current, elt2) ;
-            return op ;
+
+        if ( elt instanceof ElementExists ) {
+            ElementExists elt2 = (ElementExists)elt;
+            Op op = compileElementExists(current, elt2);
+            return op;
         }
-        
-        if ( elt instanceof ElementNotExists )
-        {
-            ElementNotExists elt2 = (ElementNotExists)elt ;
-            Op op = compileElementNotExists(current, elt2) ;
-            return op ;
+
+        if ( elt instanceof ElementNotExists ) {
+            ElementNotExists elt2 = (ElementNotExists)elt;
+            Op op = compileElementNotExists(current, elt2);
+            return op;
         }
-        
+
         // Filters were collected together by prepareGroup
-        // This only handles filters left in place by some magic. 
-        if ( elt instanceof ElementFilter )
-        {
-            ElementFilter f = (ElementFilter)elt ;
-            return OpFilter.filter(f.getExpr(), current) ;
+        // This only handles filters left in place by some magic.
+        if ( elt instanceof ElementFilter ) {
+            ElementFilter f = (ElementFilter)elt;
+            return OpFilter.filter(f.getExpr(), current);
         }
-    
-//        // SPARQL 1.1 UNION -- did not make it into SPARQL 
-//        if ( elt instanceof ElementUnion )
-//        {
-//            ElementUnion elt2 = (ElementUnion)elt ;
-//            if ( elt2.getElements().size() == 1 )
-//            {
-//                Op op = compileElementUnion(current, elt2) ;
-//                return op ;
-//            }
-//        }
-        
-        
         return compileUnknownElement(elt, "compile/Element not recognized: "+Lib.className(elt));
     }
 
-    protected Op compileElementUnion(ElementUnion el)
-    { 
-        Op current = null ;
-        
-        for ( Element subElt: el.getElements() )
-        {
-            Op op = compileElement(subElt) ;
-            current = union(current, op) ;
+    protected Op compileElementUnion(ElementUnion el) {
+        Op current = null;
+
+        for ( Element subElt : el.getElements() ) {
+            Op op = compileElement(subElt);
+            current = union(current, op);
         }
-        return current ;
+        return current;
     }
 
-    protected Op compileElementNotExists(Op current, ElementNotExists elt2)
-    {
-        Op op = compile(elt2.getElement()) ;    // "compile", not "compileElement" -- do simpliifcation  
-        Expr expr = new E_Exists(elt2, op) ;
-        expr = new E_LogicalNot(expr) ;
-        return OpFilter.filter(expr, current) ;
+    protected Op compileElementNotExists(Op current, ElementNotExists elt2) {
+        Op op = compile(elt2.getElement());    // "compile", not "compileElement" --
+                                               // do simpliifcation
+        Expr expr = new E_Exists(elt2, op);
+        expr = new E_LogicalNot(expr);
+        return OpFilter.filter(expr, current);
     }
 
-    protected Op compileElementExists(Op current, ElementExists elt2)
-    {
-        Op op = compile(elt2.getElement()) ;    // "compile", not "compileElement" -- do simpliifcation 
-        Expr expr = new E_Exists(elt2, op) ;
-        return OpFilter.filter(expr, current) ;
+    protected Op compileElementExists(Op current, ElementExists elt2) {
+        Op op = compile(elt2.getElement());    // "compile", not "compileElement" --
+                                               // do simpliifcation
+        Expr expr = new E_Exists(elt2, op);
+        return OpFilter.filter(expr, current);
     }
 
-    protected Op compileElementMinus(Op current, ElementMinus elt2)
-    {
-        Op op = compile(elt2.getMinusElement()) ;
-        Op opMinus = OpMinus.create(current, op) ;
-        return opMinus ;
+    protected Op compileElementMinus(Op current, ElementMinus elt2) {
+        Op op = compile(elt2.getMinusElement());
+        Op opMinus = OpMinus.create(current, op);
+        return opMinus;
     }
 
-    protected Op compileElementData(ElementData elt)
-    {
-        return OpTable.create(elt.getTable()) ;
+    protected Op compileElementData(ElementData elt) {
+        return OpTable.create(elt.getTable());
     }
 
-    protected Op compileElementUnion(Op current, ElementUnion elt2)
-    {
+    protected Op compileElementUnion(Op current, ElementUnion elt2) {
         // Special SPARQL 1.1 case.
-        Op op = compile(elt2.getElements().get(0)) ;
-        Op opUnion = OpUnion.create(current, op) ;
-        return opUnion ;
+        Op op = compile(elt2.getElements().get(0));
+        Op opUnion = OpUnion.create(current, op);
+        return opUnion;
     }
 
-    protected Op compileElementOptional(ElementOptional eltOpt, Op current)
-    {
-        Element subElt = eltOpt.getOptionalElement() ;
-        Op op = compileElement(subElt) ;
-        
-        ExprList exprs = null ;
-        if ( op instanceof OpFilter )
-        {
-            OpFilter f = (OpFilter)op ;
-            //f = OpFilter.tidy(f) ;  // Collapse filter(filter(..))
-            Op sub = f.getSubOp() ;
+    protected Op compileElementOptional(ElementOptional eltOpt, Op current) {
+        Element subElt = eltOpt.getOptionalElement();
+        Op op = compileElement(subElt);
+
+        ExprList exprs = null;
+        if ( op instanceof OpFilter ) {
+            OpFilter f = (OpFilter)op;
+            // f = OpFilter.tidy(f); // Collapse filter(filter(..))
+            Op sub = f.getSubOp();
             if ( sub instanceof OpFilter )
-                broken("compile/Optional/nested filters - unfinished") ; 
-            exprs = f.getExprs() ;
-            op = sub ;
+                broken("compile/Optional/nested filters - unfinished");
+            exprs = f.getExprs();
+            op = sub;
         }
-        current = OpLeftJoin.create(current, op, exprs) ;
-        return current ;
+        current = OpLeftJoin.create(current, op, exprs);
+        return current;
     }
-    
-    protected Op compileBasicPattern(BasicPattern pattern)
-    {
-        return new OpBGP(pattern) ;
+
+    protected Op compileBasicPattern(BasicPattern pattern) {
+        return new OpBGP(pattern);
     }
-    
-    protected Op compilePathBlock(PathBlock pathBlock)
-    {
+
+    protected Op compilePathBlock(PathBlock pathBlock) {
         // Empty path block : the parser does not generate this case.
         if ( pathBlock.size() == 0 )
-            return OpTable.unit() ;
+            return OpTable.unit();
 
         // Always turns the most basic paths to triples.
-        return PathLib.pathToTriples(pathBlock) ;
+        return PathLib.pathToTriples(pathBlock);
     }
 
-    protected Op compileElementGraph(ElementNamedGraph eltGraph)
-    {
-        Node graphNode = eltGraph.getGraphNameNode() ;
-        Op sub = compileElement(eltGraph.getElement()) ;
-        return new OpGraph(graphNode, sub) ;
+    protected Op compileFind(ElementFind elFind) {
+        Var var = elFind.getVar();
+        Triple triple = elFind.getTriple();
+        return new OpFind(triple, var);
     }
 
-    protected Op compileElementService(ElementService eltService)
-    {
-        Node serviceNode = eltService.getServiceNode() ;
-        Op sub = compileElement(eltService.getElement()) ;
-        return new OpService(serviceNode, sub, eltService, eltService.getSilent()) ;
+    protected Op compileElementGraph(ElementNamedGraph eltGraph) {
+        Node graphNode = eltGraph.getGraphNameNode();
+        Op sub = compileElement(eltGraph.getElement());
+        return new OpGraph(graphNode, sub);
     }
-    
-    protected Op compileElementSubquery(ElementSubQuery eltSubQuery)
-    {
-        AlgebraGenerator gen = new AlgebraGenerator(context, subQueryDepth+1) ;
-        return gen.compile(eltSubQuery.getQuery()) ;
+
+    protected Op compileElementService(ElementService eltService) {
+        Node serviceNode = eltService.getServiceNode();
+        Op sub = compileElement(eltService.getElement());
+        return new OpService(serviceNode, sub, eltService, eltService.getSilent());
     }
-    
+
+    protected Op compileElementSubquery(ElementSubQuery eltSubQuery) {
+        AlgebraGenerator gen = new AlgebraGenerator(context, subQueryDepth + 1);
+        return gen.compile(eltSubQuery.getQuery());
+    }
+
     /** Compile query modifiers */
-    protected Op compileModifiers(Query query, Op pattern)
-    {
+    protected Op compileModifiers(Query query, Op pattern) {
          /* The modifier order in algebra is:
-          * 
+          *
           * Limit/Offset
           *   Distinct/reduce
           *     project
@@ -492,139 +451,129 @@
           *             select expressions
           *               group
           */
-        
+
         // Preparation: sort SELECT clause into assignments and projects.
-        VarExprList projectVars = query.getProject() ;
-        
-        VarExprList exprs = new VarExprList() ;     // Assignments to be done.
-        List<Var> vars = new ArrayList<>() ;     // projection variables
-        
-        Op op = pattern ;
-        
+        VarExprList projectVars = query.getProject();
+
+        VarExprList exprs = new VarExprList();     // Assignments to be done.
+        List<Var> vars = new ArrayList<>();     // projection variables
+
+        Op op = pattern;
+
         // ---- GROUP BY
-        
-        if ( query.hasGroupBy() )
-        {
-            // When there is no GroupBy but there are some aggregates, it's a group of no variables.
-            op = OpGroup.create(op, query.getGroupBy(), query.getAggregators()) ;
+
+        if ( query.hasGroupBy() ) {
+            // When there is no GroupBy but there are some aggregates, it's a group
+            // of no variables.
+            op = OpGroup.create(op, query.getGroupBy(), query.getAggregators());
         }
-        
-        //---- Assignments from SELECT and other places (so available to ORDER and HAVING)
-        // Now do assignments from expressions 
+
+        // ---- Assignments from SELECT and other places (so available to ORDER and
+        // HAVING)
+        // Now do assignments from expressions
         // Must be after "group by" has introduced it's variables.
-        
+
         // Look for assignments in SELECT expressions.
-        if ( ! projectVars.isEmpty() && ! query.isQueryResultStar())
-        {
+        if ( !projectVars.isEmpty() && !query.isQueryResultStar() ) {
             // Don't project for QueryResultStar so initial bindings show
             // through in SELECT *
             if ( projectVars.size() == 0 && query.isSelectType() )
-                Log.warn(this,"No project variables") ;
+                Log.warn(this, "No project variables");
             // Separate assignments and variable projection.
-            for ( Var v : query.getProject().getVars() )
-            {
-                Expr e = query.getProject().getExpr(v) ;
-                if ( e != null )
-                {
-                    Expr e2 = ExprLib.replaceAggregateByVariable(e) ;
-                    exprs.add(v, e2) ;
+            for ( Var v : query.getProject().getVars() ) {
+                Expr e = query.getProject().getExpr(v);
+                if ( e != null ) {
+                    Expr e2 = ExprLib.replaceAggregateByVariable(e);
+                    exprs.add(v, e2);
                 }
                 // Include in project
-                vars.add(v) ;
+                vars.add(v);
             }
         }
-        
-        // ---- Assignments from SELECT and other places (so available to ORDER and HAVING)
+
+        // ---- Assignments from SELECT and other places (so available to ORDER and
+        // HAVING)
         for ( Var v : exprs.getVars() ) {
-            Expr e = exprs.getExpr(v) ;
-            op = OpExtend.create(op, v, e) ;
+            Expr e = exprs.getExpr(v);
+            op = OpExtend.create(op, v, e);
         }
 
         // ---- HAVING
-        if ( query.hasHaving() )
-        {
-            for (Expr expr : query.getHavingExprs())
-            {
+        if ( query.hasHaving() ) {
+            for ( Expr expr : query.getHavingExprs() ) {
                 // HAVING expression to refer to the aggregate via the variable.
-                Expr expr2 = ExprLib.replaceAggregateByVariable(expr) ; 
-                op = OpFilter.filter(expr2 , op) ;
+                Expr expr2 = ExprLib.replaceAggregateByVariable(expr);
+                op = OpFilter.filter(expr2, op);
             }
         }
         // ---- VALUES
-        if ( query.hasValues() )
-        {
-            Table table = TableFactory.create(query.getValuesVariables()) ;
+        if ( query.hasValues() ) {
+            Table table = TableFactory.create(query.getValuesVariables());
             for ( Binding binding : query.getValuesData() )
-                table.addBinding(binding) ;
-            OpTable opTable = OpTable.create(table) ;
-            op = OpJoin.create(op, opTable) ;
+                table.addBinding(binding);
+            OpTable opTable = OpTable.create(table);
+            op = OpJoin.create(op, opTable);
         }
-        
+
         // ---- ToList
         if ( context.isTrue(ARQ.generateToList) )
             // Listify it.
-            op = new OpList(op) ;
-        
+            op = new OpList(op);
+
         // ---- ORDER BY
-        if ( query.getOrderBy() != null )
-        {
-            List<SortCondition> scList = new ArrayList<>() ;
+        if ( query.getOrderBy() != null ) {
+            List<SortCondition> scList = new ArrayList<>();
 
             // Aggregates in ORDER BY
-            for ( SortCondition sc : query.getOrderBy() )
-            {
-                Expr e = sc.getExpression() ;
-                e = ExprLib.replaceAggregateByVariable(e) ;
-                scList.add(new SortCondition(e, sc.getDirection())) ;
-                
+            for ( SortCondition sc : query.getOrderBy() ) {
+                Expr e = sc.getExpression();
+                e = ExprLib.replaceAggregateByVariable(e);
+                scList.add(new SortCondition(e, sc.getDirection()));
+
             }
-            op = new OpOrder(op, scList) ;
+            op = new OpOrder(op, scList);
         }
-        
+
         // ---- PROJECT
         // No projection => initial variables are exposed.
         // Needed for CONSTRUCT and initial bindings + SELECT *
-        
+
         if ( vars.size() > 0 )
-            op = new OpProject(op, vars) ;
-        
+            op = new OpProject(op, vars);
+
         // ---- DISTINCT
         if ( query.isDistinct() )
-            op = OpDistinct.create(op) ;
-        
+            op = OpDistinct.create(op);
+
         // ---- REDUCED
         if ( query.isReduced() )
-            op = OpReduced.create(op) ;
-        
+            op = OpReduced.create(op);
+
         // ---- LIMIT/OFFSET
         if ( query.hasLimit() || query.hasOffset() )
-            op = new OpSlice(op, query.getOffset() /*start*/, query.getLimit()/*length*/) ;
-        
-        return op ;
+            op = new OpSlice(op, query.getOffset() /* start */, query.getLimit()/* length */);
+
+        return op;
     }
 
-    // -------- 
-    
-    protected static Op join(Op current, Op newOp)
-    { 
+    // --------
+
+    protected static Op join(Op current, Op newOp) {
         if ( simplifyTooEarlyInAlgebraGeneration && applySimplification )
-            return OpJoin.createReduce(current, newOp) ;
-        
-        return OpJoin.create(current, newOp) ;
+            return OpJoin.createReduce(current, newOp);
+
+        return OpJoin.create(current, newOp);
     }
 
-    protected Op sequence(Op current, Op newOp)
-    {
-        return OpSequence.create(current, newOp) ;
+    protected Op sequence(Op current, Op newOp) {
+        return OpSequence.create(current, newOp);
     }
-    
-    protected Op union(Op current, Op newOp)
-    {
-        return OpUnion.create(current, newOp) ;
+
+    protected Op union(Op current, Op newOp) {
+        return OpUnion.create(current, newOp);
     }
-    
-    protected final void broken(String msg)
-    {
-        throw new ARQInternalErrorException(msg) ;
+
+    protected final void broken(String msg) {
+        throw new ARQInternalErrorException(msg);
     }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
index 7889260..c34f0c8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
@@ -418,6 +418,12 @@
         }
 
         @Override
+        public void visit(OpFind opFind) {
+            Element elt = new ElementFind(opFind.getVar(), opFind.getTriple());
+            currentGroup().addElement(elt) ;
+        }
+
+        @Override
         public void visit(OpProcedure opProcedure) {
             throw new ARQNotImplemented("OpProcedure") ;
         }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpExtRegistry.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpExtRegistry.java
index 6d9b853..ea70d98 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpExtRegistry.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpExtRegistry.java
@@ -33,57 +33,42 @@
     // Known extensions.
     static Map<String, OpExtBuilder> extensions = new HashMap<>() ;
     
-    // Wire in (ext NAME ...) form
-    static { BuilderOp.add(Tags.tagExt, new BuildExtExt()) ; }
-    
-    public static void register(OpExtBuilder builder)
-    {
-        extensions.put(builder.getTagName(), builder) ;
+    public static void register(OpExtBuilder builder) {
+        extensions.put(builder.getTagName(), builder);
 
         if ( BuilderOp.contains(builder.getTagName()) )
-            throw new ARQException("Tag '"+builder.getTagName()+"' already defined") ;
-        BuilderOp.add(builder.getTagName(), new BuildExt2()) ;
+            throw new ARQException("Tag '" + builder.getTagName() + "' already defined");
+        BuilderOp.add(builder.getTagName(), buildExt2);
     }
-    
-    
-    public static void unregister(String subtag)
-    {
-        extensions.remove(subtag) ;
+
+    public static void unregister(String subtag) {
+        extensions.remove(subtag);
     }
     
     public static OpExtBuilder builder(String tag) { return extensions.get(tag) ; }
 
-    public static Op buildExt(String tag, ItemList args)
-    {
+    public static Op buildExt(String tag, ItemList args) {
         OpExtBuilder b = builder(tag) ;
         OpExt ext = b.make(args) ;  // Arguments 2 onwards
         return ext ;
     }
     
     // (ext NAME ...) form
-    static public class BuildExtExt implements BuilderOp.Build 
-    { 
-        @Override
-        public Op make(ItemList list)
-        {
-            // 0 is the "ext"
-            String subtag = list.get(1).getSymbol() ;
-            list = list.sublist(2) ;
-            return buildExt(subtag, list) ; 
-        }
-    }
+    static private BuilderOp.Build buildExtExt = (ItemList list) -> {
+        // 0 is the "ext"
+        String subtag = list.get(1).getSymbol() ;
+        list = list.sublist(2) ;
+        return buildExt(subtag, list) ; 
+    } ;
     
     // (NAME ...) form
-    static public class BuildExt2 implements BuilderOp.Build 
-    { 
-        @Override
-        public Op make(ItemList list)
-        {
-            String subtag = list.get(0).getSymbol() ;
-            list = list.sublist(1) ;
-            return buildExt(subtag, list) ; 
-        }
-    }
+    static private BuilderOp.Build buildExt2 = (ItemList list) -> {
+        String subtag = list.get(0).getSymbol() ;
+        list = list.sublist(1) ;
+        return buildExt(subtag, list) ; 
+    };
     
-    
+    // Wire in (ext NAME ...) form
+    static { BuilderOp.add(Tags.tagExt, buildExtExt) ; }
+
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
index ef3e952..b8b71ba 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
@@ -29,6 +29,7 @@
     public void visit(OpTriple opTriple) ;
     public void visit(OpQuad opQuad) ;
     public void visit(OpPath opPath) ;
+    public void visit(OpFind opFind) ;
     public void visit(OpTable opTable) ;
     public void visit(OpNull opNull) ;
     
@@ -49,7 +50,6 @@
     public void visit(OpUnion opUnion) ;
     public void visit(OpDiff opDiff) ;
     public void visit(OpMinus opMinus) ;
-    
     public void visit(OpConditional opCondition) ;
     
     // OpN
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
index 14fe7c0..a2b78f5 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
@@ -77,6 +77,8 @@
     @Override public void visit(OpAssign opAssign)              {}
 
     @Override public void visit(OpExtend opExtend)              {}
+    
+    @Override public void visit(OpFind opFind)                  {}
 
     @Override public void visit(OpList opList)                  {}
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
index 01863bb..cf05898 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
@@ -68,6 +68,10 @@
     { visit0(opPath) ; }
     
     @Override
+    public void visit(OpFind opFind)
+    { visit0(opFind) ; }
+    
+    @Override
     public void visit(OpProcedure opProcedure)
     { visit1(opProcedure) ; }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
index 4d18e47..86b5a40 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
@@ -30,6 +30,7 @@
     public Op transform(OpTriple opTriple) ;
     public Op transform(OpQuad opQuad) ;
     public Op transform(OpPath opPath) ;
+    public Op transform(OpFind opFind) ;
     public Op transform(OpDatasetNames dsNames) ;
     public Op transform(OpQuadPattern quadPattern) ;
     public Op transform(OpQuadBlock quadBlock) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformBase.java
index 761eb77..8f758bd 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformBase.java
@@ -22,7 +22,8 @@
 
 import org.apache.jena.sparql.algebra.op.* ;
 
-/** When writing {@link Transform}s to be applied to a tree,
+/**
+ * When writing {@link Transform}s to be applied to a tree,
  * extend {@link TransformCopy}, not this class. 
  */
 public class TransformBase implements Transform
@@ -37,6 +38,8 @@
     public Op transform(OpQuad opQuad)                      { return opQuad ; }
     @Override
     public Op transform(OpPath opPath)                      { return opPath ; } 
+    @Override
+    public Op transform(OpFind opFind)                      { return opFind ; } 
 
     @Override
     public Op transform(OpProcedure opProc, Op subOp)       { return opProc ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
index da75ecc..a722c89 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
@@ -48,6 +48,8 @@
     public Op transform(OpQuad opQuad)                              { return xform(opQuad) ; }
     @Override
     public Op transform(OpPath opPath)                              { return xform(opPath) ; }
+    @Override
+    public Op transform(OpFind opFind)                              { return xform(opFind) ; }
 
     @Override
     public Op transform(OpProcedure opProc, Op subOp)               { return xform(opProc, subOp) ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadBlockGraph.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadBlockGraph.java
index 5dea138..483cd11 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadBlockGraph.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadBlockGraph.java
@@ -20,106 +20,22 @@
 
 import java.util.Deque ;
 
-import org.apache.jena.graph.Node ;
 import org.apache.jena.sparql.algebra.AlgebraQuad.QuadSlot ;
-import org.apache.jena.sparql.algebra.op.* ;
-import org.apache.jena.sparql.core.Var ;
-import org.apache.jena.sparql.expr.ExprVar ;
+import org.apache.jena.sparql.algebra.op.OpBGP;
+import org.apache.jena.sparql.algebra.op.OpQuadBlock;
 
 /**
  * Transform that rewrites an algebra into quadblock form
  *
  */
-public class TransformQuadBlockGraph extends TransformCopy
+public class TransformQuadBlockGraph extends TransformQuadGraph
 {
-    private Deque<QuadSlot> tracker ;
-    private OpVisitor beforeVisitor ;
-    private OpVisitor afterVisitor ;
-
     public TransformQuadBlockGraph(Deque<QuadSlot> tracker, OpVisitor before, OpVisitor after) {
-        this.tracker = tracker ;
-        this.beforeVisitor = before ;
-        this.afterVisitor = after ;
-    }
-
-    private Node getNode() { return tracker.peek().rewriteGraphName ; }
-
-    @Override
-    public Op transform(OpGraph opGraph, Op op) {
-
-        // ?? Could just leave the (graph) in place always - just rewrite BGPs.
-        boolean noPattern = false ;
-
-        /* One case to consider is when the pattern for the GRAPH
-         * statement includes uses the variable inside the GRAPH clause.
-         * In this case, we must rename away the inner variable
-         * to allow stream execution via index joins,
-         * and then put back the value via an assign.
-         * (This is what QueryIterGraph does using a streaming join
-         * for triples)
-         */
-
-        // Note: op is already quads by this point.
-        // Must test scoping by the subOp of GRAPH
-
-        QuadSlot qSlot = tracker.peek() ;
-        Node actualName= qSlot.actualGraphName ;
-        Node rewriteName= qSlot.rewriteGraphName ;
-
-        if ( OpBGP.isBGP(op) )
-        {
-            // Empty BGP
-            if ( ((OpBGP)op).getPattern().isEmpty() )
-                noPattern = true ;
-        }
-        else if ( op instanceof OpTable )
-        {
-            // Empty BGP compiled to a unit table
-            if ( ((OpTable)op).isJoinIdentity() )
-                noPattern = true ;
-        }
-
-        if ( noPattern )
-        {
-            // The case of something like:
-            // GRAPH ?g {} or GRAPH <v> {}
-            // which are ways of accessing the names in the dataset.
-            return new OpDatasetNames(opGraph.getNode()) ;
-        }
-
-        if ( actualName != rewriteName )
-            op = OpAssign.assign(op, Var.alloc(actualName), new ExprVar(rewriteName)) ;
-
-        // Drop (graph...) because inside nodes
-        // have been converted to quads.
-        return op ;
-    }
-
-    @Override
-    public Op transform(OpPropFunc opPropFunc, Op subOp) {
-        if ( opPropFunc.getSubOp() != subOp )
-            opPropFunc = new OpPropFunc(opPropFunc.getProperty(), opPropFunc.getSubjectArgs(), opPropFunc.getObjectArgs(), subOp) ;
-        // Put the (graph) back round it so the property function works on the named graph.
-        return new OpGraph(getNode() , opPropFunc) ;
-    }
-
-    @Override
-    public Op transform(OpPath opPath) {
-        // Put the (graph) back round it
-        // ?? inc default graph node.
-        return new OpGraph(getNode() , opPath) ;
-        // Does not get removed by transform above because this is
-        // not the OpGraph that gets walked by the transform.
+        super(tracker, before, after);
     }
 
     @Override
     public Op transform(OpBGP opBGP) {
-        //System.out.print("transform(OpBGP) : "+getNode()+"\n"+opBGP) ;
         return OpQuadBlock.create(getNode(), opBGP.getPattern()) ;
     }
-
-    @Override
-    public Op transform(OpExt opExt) {
-        return opExt.apply(this, beforeVisitor, afterVisitor) ;
-    }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadGraph.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadGraph.java
index 07c2c0e..6616342 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadGraph.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformQuadGraph.java
@@ -23,6 +23,7 @@
 import org.apache.jena.graph.Node ;
 import org.apache.jena.sparql.algebra.AlgebraQuad.QuadSlot ;
 import org.apache.jena.sparql.algebra.op.* ;
+import org.apache.jena.sparql.core.Quad;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.expr.ExprVar ;
 
@@ -42,13 +43,10 @@
         this.afterVisitor = after ;
     }
 
-    private Node getNode() { return tracker.peek().rewriteGraphName ; }
+    protected Node getNode() { return tracker.peek().rewriteGraphName ; }
 
     @Override
     public Op transform(OpGraph opGraph, Op op) {
-
-        //System.err.println("transform(OpGraph)\n"+opGraph+op) ;
-
         // ?? Could just leave the (graph) in place always - just rewrite BGPs.
         boolean noPattern = false ;
 
@@ -106,9 +104,13 @@
     }
 
     @Override
+    public Op transform(OpFind opFind) {
+        // Put the (graph) back round it so FIND works on the named graph.
+        return new OpGraph(getNode() , opFind) ;
+    }
+
+    @Override
     public Op transform(OpPath opPath) {
-        // Put the (graph) back round it
-        // ?? inc default graph node.
         return new OpGraph(getNode() , opPath) ;
         // Does not get removed by transform above because this is
         // not the OpGraph that gets walked by the transform.
@@ -116,11 +118,15 @@
 
     @Override
     public Op transform(OpBGP opBGP) {
-        //System.out.print("transform(OpBGP) : "+getNode()+"\n"+opBGP) ;
         return new OpQuadPattern(getNode(), opBGP.getPattern()) ;
     }
 
     @Override
+    public Op transform(OpTriple opTriple) {
+        return new OpQuad(Quad.create(getNode(), opTriple.getTriple())); 
+    }
+
+    @Override
     public Op transform(OpExt opExt) {
         return opExt.apply(this, beforeVisitor, afterVisitor) ;
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
index afa9b82..c92ec4e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
@@ -42,6 +42,8 @@
     public Op transform(OpQuad opQuad)                      { return transform.transform(opQuad) ; }
     @Override
     public Op transform(OpPath opPath)                      { return transform.transform(opPath) ; } 
+    @Override
+    public Op transform(OpFind opFind)                      { return transform.transform(opFind) ; } 
 
     @Override
     public Op transform(OpProcedure opProc, Op subOp)       { return transform.transform(opProc, subOp) ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpBase.java
index b7fb90e..116456d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpBase.java
@@ -35,6 +35,7 @@
     @Override
     final public boolean equals(Object other)
     { 
+        if ( other == null ) return false;
         if ( this == other ) return true ;
 
         if ( ! ( other instanceof Op ) )
@@ -57,8 +58,8 @@
             out.ensureStartOfLine() ;
     }
 
-    // Constants used in hashing to stop an element and it's subelement
-    // (if just one) having the same hash.  That isn't usualy any problem but
+    // Constants used in hashing to stop an element and it's sub-element
+    // (if just one) having the same hash.  That isn't usually any problem but
     // it's easy to avoid so we do.
     
     static final int HashBasicGraphPattern      = 0xB1 ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpFind.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpFind.java
new file mode 100644
index 0000000..272e692
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpFind.java
@@ -0,0 +1,90 @@
+/*
+ * 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 org.apache.jena.sparql.algebra.op;
+
+import java.util.Objects;
+
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.algebra.Op;
+import org.apache.jena.sparql.algebra.OpVisitor;
+import org.apache.jena.sparql.algebra.Transform;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.sse.Tags;
+import org.apache.jena.sparql.util.Iso;
+import org.apache.jena.sparql.util.NodeIsomorphismMap;
+
+public class OpFind extends Op0 {
+
+    private final Triple triple;
+    private final Var    var;
+
+    public OpFind(Triple triple, Var var) {
+        super();
+        this.triple = triple;
+        this.var = var;
+    }
+
+    @Override
+    public String getName() {
+        return Tags.tagFind;
+    }
+
+    @Override
+    public Op apply(Transform transform) {
+        return transform.transform(this);
+    }
+
+    @Override
+    public Op0 copy() {
+        OpFind op = new OpFind(triple, var);
+        return op;
+    }
+
+    @Override
+    public void visit(OpVisitor opVisitor) {
+        opVisitor.visit(this) ;
+    }
+
+    public Triple getTriple() {
+        return triple; 
+    }
+    
+    public Var getVar() {
+        return var; 
+    }
+    
+    @Override
+    public boolean equalTo(Op other, NodeIsomorphismMap labelMap) {
+        if ( other == null )
+            return false;
+        if ( this == other )
+            return true;
+        if ( ! (other instanceof OpFind) ) 
+            return false ;
+        OpFind opFind = (OpFind)other;
+        if ( ! Objects.equals(getVar(), opFind.getVar()) ) 
+            return false;
+        return Iso.tripleIso(getTriple(), opFind.getTriple(), labelMap) ;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(triple, var);
+    }
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpProcedure.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpProcedure.java
index bab14c5..aa324b9 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpProcedure.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpProcedure.java
@@ -32,7 +32,8 @@
  *  
  *  See also the similar algebra form for property functions.  The difference is in argument handling.
  *  A property function has a URI and two argument lists, one for subject, one for objects.
- *  A procedure is a URI and a list of arguments. */
+ *  A procedure is a URI and a list of arguments.
+ */
 public class OpProcedure extends Op1
 {
     private Node procId ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformPattern2Join.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformPattern2Join.java
index 5c4902f..fc48dc4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformPattern2Join.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformPattern2Join.java
@@ -33,7 +33,7 @@
 {
     /*
      * Get standard shaped trees?
-     * Alternative is hard flatteniing to (sequence of all the quads, triples) 
+     * Alternative is hard flattening to (sequence of all the quads, triples) 
      */
     
     @Override
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ElementWalker_New.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ElementWalker_New.java
deleted file mode 100644
index f41b51f..0000000
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ElementWalker_New.java
+++ /dev/null
@@ -1,198 +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 org.apache.jena.sparql.algebra.walker;
-
-import org.apache.jena.sparql.expr.* ;
-import org.apache.jena.sparql.syntax.* ;
-
-/** An element visitor that walks the graph pattern tree for one query level. 
- *  applying a visitor at each Element traversed.<br/>
- *  Does not process subqueries.<br/>      
- *  Does not process (NOT)EXISTS in filters.<br/>
- *  These will need to call down themselves if it is meaningful for the visitor.
- *  Bottom-up walk - apply to subelements before applying to current element.
- */
-
-public class ElementWalker_New {
-    public static void walk(Element el, ElementVisitor visitor) {
-        walk(el, visitor, null) ;
-    }
-
-    public static void walk(Element el, ElementVisitor elVisitor, ExprVisitor exprVisitor) {
-        EltWalker w = new EltWalker(elVisitor, exprVisitor) ;
-        el.visit(w) ;
-    }
-
-//    protected static void walk$(Element el, Walker walker) {
-//        el.visit(walker) ;
-//    }
-
-    static public class EltWalker implements ElementVisitor, ExprVisitorFunction {
-        protected final ElementVisitor elementVisitor ;
-        protected final ExprVisitor exprVisitor ;
-
-        protected EltWalker(ElementVisitor visitor, ExprVisitor exprVisitor) {
-            this.elementVisitor = visitor ;
-            this.exprVisitor = exprVisitor ;
-        }
-
-        @Override
-        public void visit(ElementTriplesBlock el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementFilter el) {
-            el.getExpr().visit(this);
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementAssign el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementBind el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementData el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementUnion el) {
-            for ( Element e : el.getElements() )
-                e.visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementGroup el) {
-            for ( Element e : el.getElements() )
-                e.visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementOptional el) {
-            if ( el.getOptionalElement() != null )
-                el.getOptionalElement().visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementDataset el) {
-            if ( el.getElement() != null )
-                el.getElement().visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementNamedGraph el) {
-            if ( el.getElement() != null )
-                el.getElement().visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementService el) {
-            if ( el.getElement() != null )
-                el.getElement().visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        // EXISTs, NOT EXISTs also occur in FILTERs via expressions.
-
-        @Override
-        public void visit(ElementExists el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementNotExists el) {
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementMinus el) {
-            if ( el.getMinusElement() != null )
-                el.getMinusElement().visit(this) ;
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementSubQuery el) {
-            // This does not automatically walk into the subquery.
-            elementVisitor.visit(el) ;
-        }
-
-        @Override
-        public void visit(ElementPathBlock el) {
-            elementVisitor.visit(el) ;
-        }
-        
-        @Override
-        public void visit(ExprFunction0 func) { visitExprFunction(func) ; }
-        @Override
-        public void visit(ExprFunction1 func) { visitExprFunction(func) ; }
-        @Override
-        public void visit(ExprFunction2 func) { visitExprFunction(func) ; }
-        @Override
-        public void visit(ExprFunction3 func) { visitExprFunction(func) ; }
-        @Override
-        public void visit(ExprFunctionN func) { visitExprFunction(func) ; }
-        
-        @Override
-        public void visitExprFunction(ExprFunction func) {
-            for ( int i = 1 ; i <= func.numArgs() ; i++ )
-            {
-                Expr expr = func.getArg(i) ;
-                if ( expr == null )
-                    // Put a dummy in, e.g. to keep the transform stack aligned.
-                    Expr.NONE.visit(this) ;
-                else
-                    expr.visit(this) ;
-            }
-            func.visit(exprVisitor) ;
-        }
-        
-        @Override
-        public void visit(ExprFunctionOp funcOp) {
-            // Walk the op
-            funcOp.getElement().visit(this);
-            funcOp.visit(exprVisitor) ;
-        }
-        
-        @Override
-        public void visit(NodeValue nv)         { nv.visit(exprVisitor) ; }
-        @Override
-        public void visit(ExprVar v)            { v.visit(exprVisitor) ; }
-        @Override
-        public void visit(ExprNone v)            { v.visit(exprVisitor) ; }
-        @Override
-        public void visit(ExprAggregator eAgg)  {
-            //eAgg.getAggVar().visit(visitorExpr);
-            // XXX XXX Hack for varsMentioned
-            eAgg.visit(exprVisitor) ; 
-        }
-    }
-}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
index c78e724..dff3de0 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
@@ -88,6 +88,11 @@
     }
 
     @Override
+    public default void visit(OpFind opFind) {
+        visit0(opFind);
+    }
+
+    @Override
     public default void visit(OpProcedure opProcedure) {
         visit1(opProcedure);
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
index f3d7e27..d4dc1e0 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
@@ -214,13 +214,11 @@
         visit1$(opExtend) ;
         after(opExtend) ;
     }
-
     
     // Transforming to quads needs the graph node handled before doing the sub-algebra ops
     // so it has to be done as before/after by the Walker. By the time visit(OpGraph) is called,
     // the sub-tree has already been visited. 
     
-    
 //    @Override
 //    public void visit(OpGraph op) {
 //        pushGraph(op.getNode()) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/VarAlloc.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/VarAlloc.java
index 17d8653..09a8cc3 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/VarAlloc.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/VarAlloc.java
@@ -18,7 +18,6 @@
 
 package org.apache.jena.sparql.core;
 
-import org.apache.jena.sparql.ARQConstants ;
 import org.apache.jena.sparql.util.Context ;
 import org.apache.jena.sparql.util.Symbol ;
 
@@ -31,24 +30,18 @@
 
     // Globals
     // Try to avoid their use because of clashes/very large allocated names.
-    //private static VarAlloc varAnonAllocator  = new VarAlloc(ARQConstants.allocGlobalVarAnonMarker) ;
-    //public static VarAlloc getVarAnonAllocator() { return bNodeAllocator ; }
 
-    private static VarAlloc varAllocator    = new VarAlloc(ARQConstants.allocGlobalVarMarker) ;
-    public static VarAlloc getVarAllocator() { return varAllocator ; }
+//    private static VarAlloc varGlobalAllocator    = new VarAlloc(ARQConstants.allocGlobalVarMarker) ;
+//    public static VarAlloc getVarGlobalAllocator() { return varGlobalAllocator ; }
 
-    public static VarAlloc get(Context context, Symbol name)
-    {
-        return (VarAlloc)context.get(name) ;
+    public static VarAlloc get(Context context, Symbol name) {
+        return (VarAlloc)context.get(name);
     }
 
-    public VarAlloc(String baseMarker)
-    {
-        this.baseMarker = baseMarker ;
+    public VarAlloc(String baseMarker) {
+        this.baseMarker = baseMarker;
     }
 
-
-
     public Var allocVar()
     { return alloc(baseMarker, counter ++) ; }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ExecutionContext.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ExecutionContext.java
index ff357db..7006317 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ExecutionContext.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ExecutionContext.java
@@ -18,114 +18,97 @@
 
 package org.apache.jena.sparql.engine;
 
-import java.util.ArrayList ;
-import java.util.Collection ;
-import java.util.Iterator ;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 
-import org.apache.jena.graph.Graph ;
-import org.apache.jena.sparql.core.DatasetGraph ;
-import org.apache.jena.sparql.engine.main.OpExecutorFactory ;
-import org.apache.jena.sparql.function.FunctionEnv ;
-import org.apache.jena.sparql.util.Context ;
+import org.apache.jena.graph.Graph;
+import org.apache.jena.sparql.core.DatasetGraph;
+import org.apache.jena.sparql.engine.main.OpExecutorFactory;
+import org.apache.jena.sparql.function.FunctionEnv;
+import org.apache.jena.sparql.util.Context;
 
 public class ExecutionContext implements FunctionEnv
 {
-    private static boolean TrackAllIterators = false ;
+    private static boolean TrackAllIterators = false;
 
-    private Context context       = null ;
-    private DatasetGraph dataset  = null ;
+    private Context context       = null;
+    private DatasetGraph dataset  = null;
     
     // Iterator tracking
-    private Collection<QueryIterator> openIterators    = null ;
+    private Collection<QueryIterator> openIterators    = null;
     // Tracking all iterators leads to a build up of state,
-    private Collection<QueryIterator> allIterators     = null ; 
-    private Graph activeGraph           = null ;
-    private OpExecutorFactory executor  = null ;
+    private Collection<QueryIterator> allIterators     = null; 
+    private Graph activeGraph           = null;
+    private OpExecutorFactory executor  = null;
 
     /** Clone */
     public ExecutionContext(ExecutionContext other) 
     {
-        this.context = other.context ;
-        this.dataset = other.dataset ;
-        this.openIterators = other.openIterators ;
-        this.allIterators = other.allIterators ;
-        this.activeGraph = other.activeGraph ;
-        this.executor = other.executor ;
+        this.context = other.context;
+        this.dataset = other.dataset;
+        this.openIterators = other.openIterators;
+        this.allIterators = other.allIterators;
+        this.activeGraph = other.activeGraph;
+        this.executor = other.executor;
     }
     
     /** Clone and change active graph - shares tracking */
     public ExecutionContext(ExecutionContext other, Graph activeGraph) 
     {
-        this(other) ; 
-        this.activeGraph = activeGraph ; 
+        this(other); 
+        this.activeGraph = activeGraph; 
     }
 
-    public ExecutionContext(Context params, Graph activeGraph, DatasetGraph dataset, OpExecutorFactory factory)
-    {
-        this.context = params ;
-        this.dataset = dataset ;
-        this.openIterators = new ArrayList<>() ;
+    public ExecutionContext(Context params, Graph activeGraph, DatasetGraph dataset, OpExecutorFactory factory) {
+        this.context = params;
+        this.dataset = dataset;
+        this.openIterators = new ArrayList<>();
         if ( TrackAllIterators )
-            this.allIterators  = new ArrayList<>() ;
-        this.activeGraph = activeGraph ;
-        this.executor = factory ;
+            this.allIterators  = new ArrayList<>();
+        this.activeGraph = activeGraph;
+        this.executor = factory;
     }
 
     @Override
-    public Context getContext()       { return context ; }
+    public Context getContext()       { return context; }
 
-//    public ExecutionContext getExecutionContext()       { return this ; }
-
-    
-    public void openIterator(QueryIterator qIter)
-    {
-        openIterators.add(qIter) ;
+    public void openIterator(QueryIterator qIter) {
+        openIterators.add(qIter);
         if ( allIterators != null )
-            allIterators.add(qIter) ;
+            allIterators.add(qIter);
     }
 
-    public void closedIterator(QueryIterator qIter)
-    {
-        openIterators.remove(qIter) ;
+    public void closedIterator(QueryIterator qIter) {
+        openIterators.remove(qIter);
     }
 
-    public Iterator<QueryIterator> listOpenIterators()  { return openIterators.iterator() ; }
-    public Iterator<QueryIterator> listAllIterators()
-    { 
-        if ( allIterators == null ) return null ;
-        return allIterators.iterator() ;
+    public Iterator<QueryIterator> listOpenIterators() {
+        return openIterators.iterator();
     }
-    
-    public OpExecutorFactory getExecutor()
-    {
-        return executor ;
+
+    public Iterator<QueryIterator> listAllIterators() {
+        if ( allIterators == null )
+            return null;
+        return allIterators.iterator();
+    }
+
+    public OpExecutorFactory getExecutor() {
+        return executor;
     }
     
     /** Setter for the policy for algebra expression evaluation - use with care */
-    public void setExecutor(OpExecutorFactory executor)
-    {
-        this.executor = executor ;
+    public void setExecutor(OpExecutorFactory executor) {
+        this.executor = executor;
     }
 
     @Override
-    public DatasetGraph getDataset()  { return dataset ; }
-
-//    /** Setter for the dataset - use with care */
-//    public void setDataset(DatasetGraph dataset)
-//    {
-//        this.dataset = dataset ;
-//    }
+    public DatasetGraph getDataset()  { return dataset; }
 
     /** Return the active graph (the one matching is against at this point in the query.
      * May be null if unknown or not applicable - for example, doing quad store access or
      * when sorting  
      */ 
     @Override
-    public Graph getActiveGraph()     { return activeGraph ; }
-
-//    /** Setter for the active graph - use with care */
-//    public void setActiveGraph(Graph activeGraph)
-//    {
-//        this.activeGraph = activeGraph ;
-//    }
+    public Graph getActiveGraph()     { return activeGraph; }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterAddTripleTerm.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterAddTripleTerm.java
index d253248..114e73a 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterAddTripleTerm.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterAddTripleTerm.java
@@ -37,24 +37,35 @@
  * with terms from the current binding. It is an error not to have substitutions for
  * all variables and results in the original binding unchanged.
  */
-class QueryIterAddTripleTerm extends QueryIterTriplePattern {
+public class QueryIterAddTripleTerm extends QueryIterProcessBinding {
     private final Triple triple;
     private final Var    var;
 
     public QueryIterAddTripleTerm(QueryIterator chain, Var var, Triple triple, ExecutionContext execContext) {
-        super(chain, triple, execContext);
+        super(chain, execContext);
         this.triple = triple;
         this.var = var;
     }
 
     @Override
-    protected Binding moveToNextBinding() {
-        Binding binding = super.moveToNextBinding();
-        Triple matchedTriple  = Substitute.substitute(triple, binding);
+    public Binding accept(Binding binding) {
+        return convert(var, triple, binding);
+    }
+
+    private static Binding convert(Var var, Triple triple, Binding binding) {
+        Triple matchedTriple = Substitute.substitute(triple, binding);
         if ( ! matchedTriple.isConcrete() )
             // Not all concrete terms.
-            return binding;
+            return null;
         Node nt = NodeFactory.createTripleNode(matchedTriple);
+        // This makes it a filter. Syntactically not allowed but execution support
+        // "AS ?t" for existing ?t where it must be the same RDF term.
+        if ( binding.contains(var) ) {
+            Node nt2 = binding.get(var);
+            if ( ! nt.equals(nt2) )
+                return null;
+            return binding;
+        }
         Binding b = BindingFactory.binding(binding, var, nt);
         return b;
     }
@@ -63,4 +74,5 @@
     protected void details(IndentedWriter out, SerializationContext sCxt) {
         out.print(this.getClass().getSimpleName()+": ["+var+"] " + triple);
     }
+
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterBlockTriplesStar.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterBlockTriplesStar.java
index 59036f9..22e4b24 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterBlockTriplesStar.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterBlockTriplesStar.java
@@ -18,15 +18,9 @@
 
 package org.apache.jena.sparql.engine.iterator;
 
-import static org.apache.jena.graph.Node_Triple.triple;
-
 import org.apache.jena.atlas.io.IndentedWriter;
-import org.apache.jena.atlas.lib.Pair;
-import org.apache.jena.graph.Node;
 import org.apache.jena.graph.Triple;
 import org.apache.jena.sparql.core.BasicPattern;
-import org.apache.jena.sparql.core.Var;
-import org.apache.jena.sparql.core.VarAlloc;
 import org.apache.jena.sparql.engine.ExecutionContext;
 import org.apache.jena.sparql.engine.QueryIterator;
 import org.apache.jena.sparql.engine.binding.Binding;
@@ -50,7 +44,7 @@
         this.pattern = pattern;
         QueryIterator chain = getInput();
         for (Triple triple : pattern) {
-            chain = rdfStarTriple(chain, triple);
+            chain = RX.rdfStarTriple(chain, triple, execContext);
         }
         output = chain;
     }
@@ -78,103 +72,6 @@
             output.cancel();
     }
 
-    static String allocTripleTerms = "*";
-    static VarAlloc varAlloc = new VarAlloc(allocTripleTerms) ;
-
-    /** Top level function */
-    private QueryIterator rdfStarTriple(QueryIterator chain, Triple triple) {
-        // Should all work without this trap for plain RDF but for now,
-        // fast track the non-RDF* case.
-        if ( ! tripleHasNodeTriple(triple) )
-            // No RDF* : direct to data. Behaviour the same as QueryIterBlockTriples.
-            return matchData(chain, triple, getExecContext());
-        return rdfStarTripleSub(chain, triple, getExecContext());
-    }
-
-    /**
-     * Insert the stages necessary for a triple with triple pattern term inside it.
-     * If the triple pattern has a triple term, possibly with variables, introduce
-     * an iterator to solve for that, assign the matching triple term to a hidden
-     * variable, and put allocated variable in to main triple pattern. Do for subject
-     * and object positions, and also any nested triple pattern terms.
-     */
-    private static QueryIterator rdfStarTripleSub(QueryIterator chain, Triple triple, ExecutionContext execContext) {
-        Pair<QueryIterator, Triple> pair = preprocess(chain, triple, execContext);
-        QueryIterator chain2 = matchData(pair.getLeft(), pair.getRight(), execContext);
-        return chain2;
-    }
-
-    // If we assume the data is correct (in PG mode), no need to test for the triple
-    // of a concrete Node_Triple because we able to test for it in the triple
-    // pattern itself.
-    // This should be "false".
-    private static final boolean TEST_FOR_CONCRETE_TRIPLE_TERM = false;
-
-    private static Pair<QueryIterator, Triple> preprocess(QueryIterator chain, Triple triple, ExecutionContext execContext) {
-        Triple triple2 = triple;
-        Node s = triple.getSubject();
-        Node p = triple.getPredicate();
-        Node o = triple.getObject();
-        Node s1 = null;
-        Node o1 = null;
-
-        // Recurse.
-        if ( s.isNodeTriple() ) {
-            if ( TEST_FOR_CONCRETE_TRIPLE_TERM || ! s.isConcrete() ) {
-                Triple t2 = triple(s);
-                Var var = varAlloc.allocVar();
-                Triple tripleTerm = Triple.create(t2.getSubject(), t2.getPredicate(), t2.getObject());
-                chain = matchTripleStar(chain, var, tripleTerm, execContext);
-                s1 = var;
-            }
-        }
-        if ( o.isNodeTriple() ) {
-            if ( TEST_FOR_CONCRETE_TRIPLE_TERM || ! o.isConcrete() ) {
-                Triple t2 = triple(o);
-                Var var = varAlloc.allocVar();
-                Triple tripleTerm = Triple.create(t2.getSubject(), t2.getPredicate(), t2.getObject());
-                chain = matchTripleStar(chain, var, tripleTerm, execContext);
-                o1 = var;
-            }
-        }
-
-        // No triple term in this triple.
-        if ( s1 == null && o1 == null )
-            return Pair.create(chain, triple);
-
-        // Change. Replace original.
-        if ( s1 == null )
-            s1 = s ;
-        if ( o1 == null )
-            o1 = o ;
-        Triple triple1 = Triple.create(s1, p, o1);
-        return Pair.create(chain, triple1);
-    }
-
-    /** Match the graph with a triple pattern, after any triple terms have been dealt with. */
-    private static QueryIterator matchData(QueryIterator chain, Triple triple, ExecutionContext execContext) {
-        QueryIterator qIter = new QueryIterTriplePattern(chain, triple, execContext);
-        return qIter;
-    }
-
-    /** Match a triple term pattern; add matches using the supplied variable. */
-    private static QueryIterator matchTripleStar(QueryIterator chain, Var var, Triple triple, ExecutionContext execContext) {
-        if ( tripleHasNodeTriple(triple) ) {
-            Pair<QueryIterator, Triple> pair = preprocess(chain, triple, execContext);
-            chain = pair.getLeft();
-            triple = pair.getRight();
-        }
-        // Assign to var in each binding, based on the triple pattern grounded by the match.
-        QueryIterator qIter = new QueryIterAddTripleTerm(chain, var, triple, execContext);
-        return qIter;
-    }
-
-    private static boolean tripleHasNodeTriple(Triple triple) {
-        return triple.getSubject().isNodeTriple()
-               /*|| triple.getPredicate().isNodeTriple()*/
-               || triple.getObject().isNodeTriple();
-    }
-
     @Override
     protected void details(IndentedWriter out, SerializationContext sCxt) {
         out.print(this.getClass().getSimpleName()+": " + pattern);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterTriplePattern.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterTriplePattern.java
index df272dc..b82753d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterTriplePattern.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterTriplePattern.java
@@ -33,6 +33,7 @@
 import org.apache.jena.util.iterator.ClosableIterator ;
 import org.apache.jena.util.iterator.NiceIterator ;
 
+/** Match a single triple pattern */
 public class QueryIterTriplePattern extends QueryIterRepeatApply
 {
     private final Triple pattern ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/RX.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/RX.java
new file mode 100644
index 0000000..9e6184f
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/RX.java
@@ -0,0 +1,180 @@
+/*
+ * 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 org.apache.jena.sparql.engine.iterator;
+
+import static org.apache.jena.graph.Node_Triple.triple;
+
+import org.apache.jena.atlas.lib.Pair;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+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.engine.ExecutionContext;
+import org.apache.jena.sparql.engine.QueryIterator;
+import org.apache.jena.sparql.util.Context;
+
+/**
+ * Solver library for RDF*.
+ * <p>
+ * There are two entry points.
+ * <p>
+ * Function {@link #rdfStarTriple} for matching a single triple pattern in a basic
+ * graph pattern that may involve RDF* terms.
+ * <p>
+ * Function {@link #matchTripleStar} for matches a triple term and assigning the
+ * triple matched to a variable. It is used within {@link #rdfStarTriple} for nested
+ * triple term and a temporary allocated variable as well can for
+ * {@code FIND(<<...>> AS ?t)}.
+ */
+public class RX {
+
+    /**
+     * Match a single triple pattern that may involve RDF* terms.
+     * This is the top level function for matching triples.
+     *
+     * The function {@link #matchTripleStar} matches a triple term and assigns the triple matched to a variable.
+     * It is used within {@link #rdfStarTriple} for nested triple term and a temporary allocated variable
+     * as well can for {@code FIND(<<...>> AS ?t)}.
+     *
+     * @implNote
+     * Without RDF*, this would be a plain call of {@link #matchData} which is simply:
+     * <pre>
+     * new QueryIterTriplePattern(chain, triple, execCxt)}
+     * </pre>
+     */
+    public static QueryIterator rdfStarTriple(QueryIterator chain, Triple triple, ExecutionContext execCxt) {
+        // Should all work without this trap for plain RDF.
+        if ( ! tripleHasNodeTriple(triple) )
+            // No RDF* : direct to data.
+            return matchData(chain, triple, execCxt);
+        return rdfStarTripleSub(chain, triple, execCxt);
+    }
+
+    private static VarAlloc varAlloc(ExecutionContext execCxt) {
+        Context context = execCxt.getContext();
+        VarAlloc varAlloc = VarAlloc.get(context, ARQConstants.sysVarAllocRDFStar);
+        if ( varAlloc == null ) {
+            varAlloc = new VarAlloc(ARQConstants.allocVarTripleTerm);
+            context.set(ARQConstants.sysVarAllocRDFStar, varAlloc);  
+        }
+        return varAlloc;
+    }
+
+    /**
+     * Insert the stages necessary for a triple with triple pattern term inside it.
+     * If the triple pattern has a triple term, possibly with variables, introduce
+     * an iterator to solve for that, assign the matching triple term to a hidden
+     * variable, and put allocated variable in to main triple pattern. Do for subject
+     * and object positions, and also any nested triple pattern terms.
+     */
+    private static QueryIterator rdfStarTripleSub(QueryIterator chain, Triple triple, ExecutionContext execCxt) {
+        Pair<QueryIterator, Triple> pair = preprocessForTripleTerms(chain, triple, execCxt);
+        QueryIterator chain2 = matchData(pair.getLeft(), pair.getRight(), execCxt);
+        return chain2;
+    }
+
+    /**
+     * Match a triple pattern (which may have nested triple terms in it).
+     * Any matched triples are added as triple terms bound to the supplied variable.
+     */
+    public static QueryIterator matchTripleStar(QueryIterator chain, Var var, Triple triple, ExecutionContext execCxt) {
+        if ( tripleHasNodeTriple(triple) ) {
+            Pair<QueryIterator, Triple> pair = preprocessForTripleTerms(chain, triple, execCxt);
+            chain = pair.getLeft();
+            triple = pair.getRight();
+        }
+        // Match to data and assign to var in each binding, based on the triple pattern grounded by the match.
+        QueryIterator qIter = bindTripleTerm(chain, var, triple, execCxt);
+        return qIter;
+    }
+
+    /**
+     * Process a triple for triple terms.
+     * <p>
+     * This creates additional matchers for triple terms in the pattern triple recursively.
+     */
+    private static Pair<QueryIterator, Triple> preprocessForTripleTerms(QueryIterator chain, Triple patternTriple, ExecutionContext execCxt) {
+        Node s = patternTriple.getSubject();
+        Node p = patternTriple.getPredicate();
+        Node o = patternTriple.getObject();
+        Node s1 = null;
+        Node o1 = null;
+
+        // Recurse.
+        if ( s.isNodeTriple() && ! s.isConcrete() ) {
+            Triple t2 = triple(s);
+            Var var = varAlloc(execCxt).allocVar();
+            Triple tripleTerm = Triple.create(t2.getSubject(), t2.getPredicate(), t2.getObject());
+            chain = matchTripleStar(chain, var, tripleTerm, execCxt);
+            s1 = var;
+        }
+        if ( o.isNodeTriple() && ! o.isConcrete() ) {
+            Triple t2 = triple(o);
+            Var var = varAlloc(execCxt).allocVar();
+            Triple tripleTerm = Triple.create(t2.getSubject(), t2.getPredicate(), t2.getObject());
+            chain = matchTripleStar(chain, var, tripleTerm, execCxt);
+            o1 = var;
+        }
+
+        // Because of the test in rdfStarTriple,
+        // This code only happens when there is a a triple term. 
+        
+        // No triple term in this triple.
+        if ( s1 == null && o1 == null )
+            return Pair.create(chain, patternTriple);
+
+        // Change. Replace original.
+        if ( s1 == null )
+            s1 = s ;
+        if ( o1 == null )
+            o1 = o ;
+        Triple triple1 = Triple.create(s1, p, o1);
+        return Pair.create(chain, triple1);
+    }
+
+    /**
+     * Add a binding to each row with triple grounded by the current row.
+     * If the triple isn't concrete, then just return the row as-is.
+     */
+    private static QueryIterator bindTripleTerm(QueryIterator chain, Var var, Triple pattern, ExecutionContext execCxt) {
+        QueryIterator qIter = matchData(chain, pattern, execCxt);
+        QueryIterator qIter2 = new QueryIterAddTripleTerm(qIter, var, pattern, execCxt);
+        return qIter2;
+    }
+
+    /**
+     * Match the graph with a triple pattern.
+     * This is the accessor to the graph.
+     * It assumes any triple terms have been dealt with.
+     */
+    private static QueryIterator matchData(QueryIterator chain, Triple pattern, ExecutionContext execCxt) {
+        return new QueryIterTriplePattern(chain, pattern, execCxt);
+    }
+
+    /**
+     * Test whether a triple has an triple term as one of its components.
+     */
+    private static boolean tripleHasNodeTriple(Triple triple) {
+        return triple.getSubject().isNodeTriple()
+               /*|| triple.getPredicate().isNodeTriple()*/
+               || triple.getObject().isNodeTriple();
+    }
+}
+
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
index cdd5547..38b04e3 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
@@ -100,6 +100,14 @@
     }
 
     @Override
+    public void visit(OpFind opFind)
+    {
+        QueryIterator input = pop() ;
+        QueryIterator qIter = opExecutor.execute(opFind, input) ;
+        push(qIter) ;
+    }
+
+    @Override
     public void visit(OpProcedure opProc)
     {
         QueryIterator input = pop() ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
index e303263..7e3b18b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
@@ -136,6 +136,10 @@
         return execute(opTriple.asBGP(), input) ;
     }
 
+    protected QueryIterator execute(OpFind opFind, QueryIterator input) {
+        return RX.matchTripleStar(input, opFind.getVar(), opFind.getTriple(), execCxt);
+    }
+
     protected QueryIterator execute(OpGraph opGraph, QueryIterator input) {
         QueryIterator qIter = specialcase(opGraph.getNode(), opGraph.getSubOp(), input) ;
         if (qIter != null)
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
index 54533e0..5fbea97 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
@@ -165,6 +165,12 @@
         }
 
         @Override
+        public void visit(OpFind opFind) {
+            defines.add(opFind.getVar());
+            addVarsFromTriple(defines, opFind.getTriple());
+        }
+
+        @Override
         public void visit(OpExt opExt) {
             opExt.effectiveOp().visit(this);
         }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
index a11795c..ba094e3 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
@@ -21,6 +21,7 @@
 import java.util.List ;
 
 import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.SortCondition ;
 import org.apache.jena.sparql.algebra.Table ;
 import org.apache.jena.sparql.core.BasicPattern ;
@@ -37,8 +38,8 @@
     public ExecutionContext getExecContext() ;
     
     public Table basicPattern(BasicPattern pattern) ;
-    
     public Table pathPattern(TriplePath triplePath) ;
+    public Table find(Var var, Triple tripleterm) ;
 
     // Two forms that provide custom code evaluation
     public Table procedure(Table table, Node procId, ExprList args) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
index bdd9fbc..b43611c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
@@ -97,6 +97,11 @@
         Table table = evaluator.pathPattern(opPath.getTriplePath()) ;
         push(table) ;
     }
+    
+    @Override
+    public void visit(OpFind opFind) {
+        Table table = evaluator.find(opFind.getVar(), opFind.getTriple());
+    }
 
     @Override
     public void visit(OpProcedure opProc)
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
index f2fc9b4..b0baf78 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
@@ -23,10 +23,14 @@
 
 import org.apache.jena.atlas.lib.Lib ;
 import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.ResultSet ;
 import org.apache.jena.query.ResultSetFormatter ;
 import org.apache.jena.query.SortCondition ;
-import org.apache.jena.sparql.algebra.* ;
+import org.apache.jena.sparql.algebra.Algebra;
+import org.apache.jena.sparql.algebra.JoinType;
+import org.apache.jena.sparql.algebra.Table;
+import org.apache.jena.sparql.algebra.TableFactory;
 import org.apache.jena.sparql.algebra.table.TableN ;
 import org.apache.jena.sparql.core.BasicPattern ;
 import org.apache.jena.sparql.core.TriplePath ;
@@ -78,6 +82,12 @@
     }
 
     @Override
+    public Table find(Var var, Triple tripleTerm) {
+        QueryIterator qIter = RX.matchTripleStar(QueryIterRoot.create(execCxt), var, tripleTerm, execCxt);
+        return TableFactory.create(qIter) ;
+    }
+
+    @Override
     public Table procedure(Table table, Node procId, ExprList args)
     {
         Procedure proc = ProcEval.build(procId, args, execCxt) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java
index 0921892..c185365 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java
@@ -42,7 +42,7 @@
     }
 
     public static void init() {
-        // Intialize if there is no registry already set 
+        // Initialize if there is no registry already set 
         FunctionRegistry reg = new FunctionRegistry() ;
         ARQFunctions.load(reg);
         StandardFunctions.loadStdDefs(reg) ;
@@ -51,7 +51,7 @@
     
     public static FunctionRegistry get()
     {
-        // Intialize if there is no registry already set 
+        // Initialize if there is no registry already set 
         FunctionRegistry reg = get(ARQ.getContext()) ;
         if ( reg == null )
         {
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/ParserBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/ParserBase.java
index 5d9186f..33764ce 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/ParserBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/ParserBase.java
@@ -331,6 +331,11 @@
 
     // --------
 
+    protected void checkConcrete(Node n, int line, int column) {
+        if ( ! n.isConcrete() )
+            throwParseException("Term is not concrete: "+n, line, column) ;
+    }
+    
     // BNode from a list
 //    protected Node createListNode()
 //    { return listLabelMap.allocNode() ; }
@@ -355,7 +360,7 @@
         return activeLabelMap.asNode(label) ;
     }
 
-    protected Node createTripleTerm(Node s, Node p, Node o) {
+    protected Node createTripleTerm(Node s, Node p, Node o, int line, int column) {
         return NodeFactory.createTripleNode(s, p, o);
     }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
index d3fcd7b..47ef0ad 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SPARQLParserBase.java
@@ -286,9 +286,12 @@
             return ;
         
         Var v = variables.get(currentColumn) ;
+        if ( n != null && ! n.isConcrete() ) {
+            String msg = QueryParseException.formatMessage("Term is not concrete: "+n, line, col) ;
+            throw new QueryParseException(msg, line, col) ;
+        }
         if ( n != null )
             currentValueRow().add(v, n) ;
-        
     }
 
     protected void finishDataBlockValueRow(int line, int col)      
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
index 325419a..3c81961 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
@@ -18,295 +18,257 @@
 
 package org.apache.jena.sparql.lang;
 
-import java.util.* ;
+import java.util.*;
 
-import org.apache.jena.query.ARQ ;
-import org.apache.jena.query.Query ;
-import org.apache.jena.query.QueryParseException ;
-import org.apache.jena.query.Syntax ;
-import org.apache.jena.sparql.core.Var ;
-import org.apache.jena.sparql.core.VarExprList ;
-import org.apache.jena.sparql.expr.Expr ;
-import org.apache.jena.sparql.syntax.* ;
+import org.apache.jena.query.ARQ;
+import org.apache.jena.query.Query;
+import org.apache.jena.query.QueryParseException;
+import org.apache.jena.query.Syntax;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.core.VarExprList;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.syntax.*;
 
-/** Calculate in-scope variables from the AST */ 
-public class SyntaxVarScope
-{
-    /* SPARQL 1.1 "in scope" rules
-       These define the variables from a pattern that are in-scope
-       These are not the usage rules.
-         
-    Syntax Form                                     In-scope variables
-    
-    Basic Graph Pattern (BGP)                       v occurs in the BGP
-    Path                                            v occurs in the path
-    Group { P1 P2 ... }                             v is in-scope if in-scope in one or more of P1, P2, ...
-    GRAPH term { P }                                v is term or v is in-scope in P
-    { P1 } UNION { P2 }                             v is in-scope in P1 or in-scope in P2
-    OPTIONAL {P}                                    v is in-scope in P
-    SERVICE term {P}                                v is term or v is in-scope in P
-    (expr AS v) for BIND, SELECT and GROUP BY       v is in-scope
-    SELECT ..v .. { P }                             v is in-scope if v is mentioned as a project variable
-    SELECT * { P }                                  v is in-scope in P
-    VALUES var     (values)                         v is in-scope if v is in varlist
-    VALUES varlist (values)                         v is in-scope if v is in varlist
-     */
-    
+/** Calculate in-scope variables from the AST */
+public class SyntaxVarScope {
+    /* SPARQL 1.1 "in scope" rules These define the variables from a pattern that are
+     * in-scope These are not the usage rules.
+     * 
+     * Syntax Form In-scope variables
+     * 
+     * Basic Graph Pattern (BGP) v occurs in the BGP Path v occurs in the path Group
+     * { P1 P2 ... } v is in-scope if in-scope in one or more of P1, P2, ... GRAPH
+     * term { P } v is term or v is in-scope in P { P1 } UNION { P2 } v is in-scope
+     * in P1 or in-scope in P2 OPTIONAL {P} v is in-scope in P SERVICE term {P} v is
+     * term or v is in-scope in P (expr AS v) for BIND, SELECT and GROUP BY v is
+     * in-scope SELECT ..v .. { P } v is in-scope if v is mentioned as a project
+     * variable SELECT * { P } v is in-scope in P VALUES var (values) v is in-scope
+     * if v is in varlist VALUES varlist (values) v is in-scope if v is in varlist */
+
     // Weakness : EXISTS inside FILTERs?
 
-    public static void check(Query query)
-    {
+    public static void check(Query query) {
         if ( query.getQueryPattern() == null )
             // DESCRIBE may not have a pattern
-            return ;
-        check(query.getQueryPattern()) ;
+            return;
+        check(query.getQueryPattern());
         // Check this level.
-        checkQueryScope(query) ;
+        checkQueryScope(query);
         // Other checks.
-        Collection<Var> vars = varsOfQuery(query) ;
-        check(query, vars) ;
+        Collection<Var> vars = varsOfQuery(query);
+        check(query, vars);
     }
 
     public static void check(Element queryPattern) {
-        checkSubQuery(queryPattern) ;
-        checkBind(queryPattern);
+        checkSubQuery(queryPattern);
+        checkPatternAssign(queryPattern);
     }
 
-    // Check BIND by accumulating variables and making sure BIND does not attempt to reuse one  
-    private static void checkBind(Element queryPattern)
-    {
-        BindScopeChecker v = new BindScopeChecker() ;
-        ElementWalker.walk(queryPattern, v) ;
+    // Check assignment forms that require a new variable.  
+    // BIND and FIND
+    private static void checkPatternAssign(Element queryPattern) {
+        VarScopeChecker v = new VarScopeChecker();
+        ElementWalker.walk(queryPattern, v);
     }
-    
-    // Check subquery by finding subquries and recurisively checking.
-    // Includes appling all checks to nested subqueries.
-    private static void checkSubQuery(Element el)
-    {
-        ElementVisitor v = new SubQueryScopeChecker() ;
-        ElementWalker.walk(el, v) ;
+
+    // Check sub-query by finding sub-queries and recursively checking.
+    // Includes applying all checks to nested sub-queries.
+    private static void checkSubQuery(Element el) {
+        ElementVisitor v = new SubQueryScopeChecker();
+        ElementWalker.walk(el, v);
     }
-    
+
     // Check one level of query - SELECT expressions
-    private static void checkQueryScope(Query query)
-    {
-        Collection<Var> vars = varsOfQuery(query) ;
-        checkExprListAssignment(vars, query.getProject()) ;
+    private static void checkQueryScope(Query query) {
+        Collection<Var> vars = varsOfQuery(query);
+        checkExprListAssignment(vars, query.getProject());
     }
-    
+
     // get all vars of a query
-    private static Collection<Var> varsOfQuery(Query query)
-    {
-        Collection<Var> vars = PatternVars.vars(query.getQueryPattern()) ;
+    private static Collection<Var> varsOfQuery(Query query) {
+        Collection<Var> vars = PatternVars.vars(query.getQueryPattern());
         if ( query.hasValues() )
-            vars.addAll(query.getValuesVariables()) ;
-        return vars ;
+            vars.addAll(query.getValuesVariables());
+        return vars;
     }
-    
+
     // Other check (not scoping at this level) of a query
-    private static void check(Query query, Collection<Var> vars)
-    {
+    private static void check(Query query, Collection<Var> vars) {
         // Check any expressions are assigned to fresh variables.
-        checkExprListAssignment(vars, query.getProject()) ;
-        
+        checkExprListAssignment(vars, query.getProject());
+
         // Check for SELECT * GROUP BY
         // Legal in ARQ, not in SPARQL 1.1
-        if ( ! Syntax.syntaxARQ.equals(query.getSyntax()) )
-        {
+        if ( !Syntax.syntaxARQ.equals(query.getSyntax()) ) {
             if ( query.isQueryResultStar() && query.hasGroupBy() )
-                throw new QueryParseException("SELECT * not legal with GROUP BY", -1 , -1) ;
+                throw new QueryParseException("SELECT * not legal with GROUP BY", -1, -1);
         }
-        
-        // Check any variable in an expression is in scope (if GROUP BY) 
-        checkExprVarUse(query) ;
-        
-        // Check GROUP BY AS 
+
+        // Check any variable in an expression is in scope (if GROUP BY)
+        checkExprVarUse(query);
+
+        // Check GROUP BY AS
         // ENABLE
-        if ( false && query.hasGroupBy() )
-        {
-            VarExprList exprList2 = query.getGroupBy() ;
-            checkExprListAssignment(vars, exprList2) ;
-        // CHECK 
+        if ( false && query.hasGroupBy() ) {
+            VarExprList exprList2 = query.getGroupBy();
+            checkExprListAssignment(vars, exprList2);
+            // CHECK
         }
-        
     }
-    
-    private static void checkExprListAssignment(Collection<Var> vars, VarExprList exprList)
-    {
-        Set<Var> vars2 = new LinkedHashSet<>(vars) ;
-        exprList.forEachExpr((v,e) -> {
-            Set<Var> varInExpr = e.getVarsMentioned() ;
+
+    private static void checkExprListAssignment(Collection<Var> vars, VarExprList exprList) {
+        Set<Var> vars2 = new LinkedHashSet<>(vars);
+        exprList.forEachExpr((v, e) -> {
+            Set<Var> varInExpr = e.getVarsMentioned();
             // Include mentioned variables
             // These may be unused in the query (in vars) but still contribute.
-            vars2.addAll(varInExpr) ;
-            checkAssignment( vars2, e, v );
-            vars2.add( v );
-        }) ;
+            vars2.addAll(varInExpr);
+            checkExpr(vars2, e, v);
+            vars2.add(v);
+        });
     }
-    
-    private static void checkExprVarUse(Query query)
-    {
-        if ( query.hasGroupBy() )
-        {
-            VarExprList groupKey = query.getGroupBy() ;
-            
-            // Copy - we need to add variables
-            // SELECT (count(*) AS ?C)  (?C+1 as ?D) 
-            List<Var> inScopeVars = new ArrayList<>(groupKey.getVars()) ;
-            VarExprList exprList = query.getProject() ;
 
-            for ( Var v : exprList.getVars() )
-            {
+    private static void checkExprVarUse(Query query) {
+        if ( query.hasGroupBy() ) {
+            VarExprList groupKey = query.getGroupBy();
+
+            // Copy - we need to add variables
+            // SELECT (count(*) AS ?C) (?C+1 as ?D)
+            List<Var> inScopeVars = new ArrayList<>(groupKey.getVars());
+            VarExprList exprList = query.getProject();
+
+            for ( Var v : exprList.getVars() ) {
                 // In scope?
-                Expr e = exprList.getExpr( v );
-                if ( e == null )
-                {
-                    if ( !inScopeVars.contains( v ) )
-                    {
-                        throw new QueryParseException( "Non-group key variable in SELECT: " + v, -1, -1 );
+                Expr e = exprList.getExpr(v);
+                if ( e == null ) {
+                    if ( !inScopeVars.contains(v) ) {
+                        throw new QueryParseException("Non-group key variable in SELECT: " + v, -1, -1);
                     }
-                }
-                else
-                {
+                } else {
                     Set<Var> eVars = e.getVarsMentioned();
-                    for ( Var v2 : eVars )
-                    {
-                        if ( !inScopeVars.contains( v2 ) )
-                        {
-                            throw new QueryParseException(
-                                "Non-group key variable in SELECT: " + v2 + " in expression " + e, -1, -1 );
+                    for ( Var v2 : eVars ) {
+                        if ( !inScopeVars.contains(v2) ) {
+                            throw new QueryParseException("Non-group key variable in SELECT: " + v2 + " in expression " + e, -1, -1);
                         }
                     }
                 }
-                inScopeVars.add( v );
+                inScopeVars.add(v);
             }
         }
     }
-    
-    private static void checkAssignment(Collection<Var> scope, Expr expr, Var var)
-    {
+
+    private static void checkExpr(Collection<Var> scope, Expr expr, Var var) {
         // Project SELECT ?x
         if ( expr == null )
-            return ;
-        
+            return;
         // expr not null
         if ( scope.contains(var) ) 
             throw new QueryParseException("Variable used when already in-scope: "+var+" in "+fmtAssignment(expr, var), -1 , -1) ;
 
         // test for impossible variables - bound() is a bit odd.
-        if ( false )
-        {
-            Set<Var> vars = expr.getVarsMentioned() ;
-            for ( Var v : vars )
-            {
+        if ( false ) {
+            Set<Var> vars = expr.getVarsMentioned();
+            for ( Var v : vars ) {
                 if ( !scope.contains(v) )
-                    throw new QueryParseException("Variable used in expression is not in-scope: "+v+" in "+expr, -1 , -1) ;
+                    throw new QueryParseException("Variable used in expression is not in-scope: " + v + " in " + expr, -1, -1);
             }
         }
     }
-    
-    private static String fmtExprList(VarExprList exprList)
-    {
-        StringBuilder sb = new StringBuilder() ;
-        boolean first = true ;
-        for ( Var v : exprList.getVars() )
-        {
-            Expr e = exprList.getExpr( v );
-            if ( !first )
-            {
-                sb.append( " " );
-            }
-            first = false;
-            sb.append( "(" ).append( e ).append( " AS " ).append( v ).append( ")" );
-        }
-        return sb.toString() ;
-    }
-    
-    private static String fmtAssignment(Expr expr, Var var)
-    {
-        return "("+expr+" AS "+var+")" ;
-    }
 
-    // Modifed walked for variables.
-    
+    private static String fmtExprList(VarExprList exprList) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        for ( Var v : exprList.getVars() ) {
+            Expr e = exprList.getExpr(v);
+            if ( !first ) {
+                sb.append(" ");
+            }
+            first = false;
+            sb.append("(").append(e).append(" AS ").append(v).append(")");
+        }
+        return sb.toString();
+    }
+
+    private static String fmtAssignment(Expr expr, Var var) {
+        return "(" + expr + " AS " + var + ")";
+    }
+
+    // Modified walked for variables.
+
     /** Visitor for subqueries scope rules . */
-    private static class SubQueryScopeChecker extends ElementVisitorBase
-    {
+    private static class SubQueryScopeChecker extends ElementVisitorBase {
         @Override
-        public void visit(ElementSubQuery el)
-        {
-            Query query = el.getQuery() ;
-            checkQueryScope(query) ;
+        public void visit(ElementSubQuery el) {
+            Query query = el.getQuery();
+            checkQueryScope(query);
             // Recursively check sub-queries in sub-queries.
-            check(el.getQuery()) ;
+            check(el.getQuery());
         }
     }
 
     // Applies scope rules at each point it matters.
     // Does some recalculation in nested structures.
-    
-    public static class BindScopeChecker extends ElementVisitorBase
-    {
-        public BindScopeChecker() {}
-        
+
+    public static class VarScopeChecker extends ElementVisitorBase {
+        VarScopeChecker() {}
+
         @Override
-        public void visit(ElementGroup el)
-        {
+        public void visit(ElementGroup el) {
             // BIND scope rules
             // (and service warning)
-            
-            for ( int i = 0 ; i < el.size() ; i++ )
-            {
-                Element e = el.get(i) ;
+
+            for ( int i = 0 ; i < el.size() ; i++ ) {
+                Element e = el.get(i);
                 // Tests.
-                if ( e instanceof ElementBind )
-                {
-                    Collection<Var> accScope = calcScopeAll(el.getElements(), i) ;
-                    check(accScope, (ElementBind)e) ;
+                if ( e instanceof ElementBind ) {
+                    Collection<Var> accScope = calcScopeAll(el.getElements(), i);
+                    check(accScope, (ElementBind)e);
                 }
-                
-                if ( e instanceof ElementService )
-                {
-                    Collection<Var> accScope = calcScopeAll(el.getElements(), i) ;
-                    check(accScope, (ElementService)e) ;
+
+                if ( e instanceof ElementFind ) {
+                    Collection<Var> accScope = calcScopeAll(el.getElements(), i);
+                    check(accScope, (ElementFind)e);
+                }
+
+                if ( e instanceof ElementService ) {
+                    Collection<Var> accScope = calcScopeAll(el.getElements(), i);
+                    check(accScope, (ElementService)e);
                 }
             }
         }
-        
-        private static Collection<Var> calcScopeAll(List<Element> elements, int idx)
-        {
-            return calcScope(elements, 0, idx) ;
+
+        private static Collection<Var> calcScopeAll(List<Element> elements, int idx) {
+            return calcScope(elements, 0, idx);
         }
 
         /** Calculate scope, working forwards */
-        private static Collection<Var> calcScope(List<Element> elements, int start, int finish)
-        {
-            Collection<Var> accScope = new HashSet<>() ;
-            for ( int i = start ; i < finish ; i++ )
-            {
-                Element e = elements.get(i) ;
-                PatternVars.vars(accScope, e) ;
+        private static Collection<Var> calcScope(List<Element> elements, int start, int finish) {
+            Collection<Var> accScope = new HashSet<>();
+            for ( int i = start ; i < finish ; i++ ) {
+                Element e = elements.get(i);
+                PatternVars.vars(accScope, e);
             }
-            return accScope ;
+            return accScope;
         }
 
-        // Inside filters.
-        
-        private static void check(Collection<Var> scope, ElementBind el)
-        {
-            Var var = el.getVar() ;
-            if ( scope.contains(var) ) 
-                throw new QueryParseException("BIND: Variable used when already in-scope: "+var+" in "+el, -1 , -1) ;
-            checkAssignment(scope, el.getExpr(), var) ;
+        private static void check(Collection<Var> scope, ElementBind el) {
+            Var var = el.getVar();
+            if ( scope.contains(var) )
+                throw new QueryParseException("BIND: Variable used when already in-scope: " + var + " in " + el, -1, -1);
+            checkExpr(scope, el.getExpr(), var);
         }
-        
-        private static void check(Collection<Var> scope, ElementService el)
-        {
-            if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() )
-            {
-                Var var = Var.alloc(el.getServiceNode()) ;
-                if ( ! scope.contains(var) ) 
-                    throw new QueryParseException("SERVICE: Variable not already in-scope: "+var+" in "+el, -1 , -1) ;
+
+        private static void check(Collection<Var> scope, ElementFind el) {
+            Var var = el.getVar();
+            if ( scope.contains(var) )
+                throw new QueryParseException("FIND: Variable used when already in-scope: " + var + " in " + el, -1, -1);
+        }
+
+        private static void check(Collection<Var> scope, ElementService el) {
+            if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() ) {
+                Var var = Var.alloc(el.getServiceNode());
+                if ( !scope.contains(var) )
+                    throw new QueryParseException("SERVICE: Variable not already in-scope: " + var + " in " + el, -1, -1);
             }
         }
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
index f251923..8f274b8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
@@ -2378,6 +2378,7 @@
       case BIND:
       case SERVICE:
       case LET:
+      case FIND:
       case EXISTS:
       case NOT:
       case FILTER:
@@ -2528,6 +2529,10 @@
       el = InlineData();
       break;
       }
+    case FIND:{
+      el = Find();
+      break;
+      }
     case LET:{
       el = Assignment();
       break;
@@ -2593,6 +2598,17 @@
     throw new Error("Missing return statement in function");
   }
 
+  final public Element Find() throws ParseException {Var v ; Node n;
+    jj_consume_token(FIND);
+    jj_consume_token(LPAREN);
+    n = TripleTerm();
+    jj_consume_token(AS);
+    v = Var();
+    jj_consume_token(RPAREN);
+{if ("" != null) return new ElementFind(v, n) ;}
+    throw new Error("Missing return statement in function");
+  }
+
   final public Element InlineData() throws ParseException {ElementData el ; Token t ;
     t = jj_consume_token(VALUES);
 int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
@@ -2623,17 +2639,17 @@
     }
   }
 
-  final public void InlineDataOneVar() throws ParseException {Var v ; Node n ; Token t ;
+  final public void InlineDataOneVar() throws ParseException {Var v ; Node n ; Token t ; ; int beginLine; int beginColumn;
     v = Var();
 emitDataBlockVariable(v) ;
     t = jj_consume_token(LBRACE);
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
     label_20:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
       case IRIref:
       case PNAME_NS:
       case PNAME_LN:
-      case BLANK_NODE_LABEL:
       case UNDEF:
       case TRUE:
       case FALSE:
@@ -2650,7 +2666,7 @@
       case STRING_LITERAL2:
       case STRING_LITERAL_LONG1:
       case STRING_LITERAL_LONG2:
-      case ANON:{
+      case LT2:{
         ;
         break;
         }
@@ -2659,9 +2675,9 @@
         break label_20;
       }
       n = DataBlockValue();
-startDataBlockValueRow(-1, -1) ;
-      emitDataBlockValue(n, -1, -1) ;
-      finishDataBlockValueRow(-1, -1) ;
+startDataBlockValueRow(beginLine, beginColumn) ;
+      emitDataBlockValue(n, beginLine, beginColumn) ;
+      finishDataBlockValueRow(beginLine, beginColumn) ;
     }
     t = jj_consume_token(RBRACE);
   }
@@ -2721,7 +2737,6 @@
           case IRIref:
           case PNAME_NS:
           case PNAME_LN:
-          case BLANK_NODE_LABEL:
           case UNDEF:
           case TRUE:
           case FALSE:
@@ -2738,7 +2753,7 @@
           case STRING_LITERAL2:
           case STRING_LITERAL_LONG1:
           case STRING_LITERAL_LONG2:
-          case ANON:{
+          case LT2:{
             ;
             break;
             }
@@ -2806,9 +2821,8 @@
 {if ("" != null) return n ;}
       break;
       }
-    case BLANK_NODE_LABEL:
-    case ANON:{
-      n = BlankNode();
+    case LT2:{
+      n = TripleTerm();
 {if ("" != null) return n ;}
       break;
       }
@@ -4086,15 +4100,10 @@
     throw new Error("Missing return statement in function");
   }
 
-  final public Node VarOrTerm() throws ParseException {Node n = null ; Token t = null; Node s , p , o ;
+  final public Node VarOrTerm() throws ParseException {Node n = null ;
     switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     case LT2:{
-      t = jj_consume_token(LT2);
-      s = VarOrTerm();
-      p = Verb();
-      o = VarOrTerm();
-n = createTripleTerm(s,p,o);
-      jj_consume_token(GT2);
+      n = TripleTerm();
       break;
       }
     case VAR1:
@@ -4135,6 +4144,17 @@
     throw new Error("Missing return statement in function");
   }
 
+  final public Node TripleTerm() throws ParseException {Node n = null ; Token t ; Node s , p , o ;
+    t = jj_consume_token(LT2);
+    s = VarOrTerm();
+    p = Verb();
+    o = VarOrTerm();
+n = createTripleTerm(s, p, o, t.beginLine, t.beginColumn);
+    jj_consume_token(GT2);
+{if ("" != null) return n;}
+    throw new Error("Missing return statement in function");
+  }
+
   final public Node VarOrIri() throws ParseException {Node n = null ; String iri ;
     switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     case VAR1:
@@ -6159,48 +6179,6 @@
     finally { jj_save(4, xla); }
   }
 
-  private boolean jj_3R_134()
- {
-    if (jj_scan_token(AGG)) return true;
-    if (jj_3R_144()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_133()
- {
-    if (jj_scan_token(VAR_POP)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_132()
- {
-    if (jj_scan_token(VAR_SAMP)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_131()
- {
-    if (jj_scan_token(VARIANCE)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_130()
- {
-    if (jj_scan_token(STDEV_POP)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_129()
- {
-    if (jj_scan_token(STDEV_SAMP)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
   private boolean jj_3R_128()
  {
     if (jj_scan_token(STDEV)) return true;
@@ -6215,55 +6193,6 @@
     return false;
   }
 
-  private boolean jj_3_2()
- {
-    if (jj_scan_token(SEMICOLON)) return true;
-    if (jj_3R_44()) return true;
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(138)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(139)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(146)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(141)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(142)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(143)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(140)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(151)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(134)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(133)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(152)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(135)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(136)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(137)) return true;
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    return false;
-  }
-
   private boolean jj_3R_127()
  {
     if (jj_scan_token(GROUP_CONCAT)) return true;
@@ -6306,12 +6235,6 @@
     return false;
   }
 
-  private boolean jj_3R_148()
- {
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
   private boolean jj_3R_121()
  {
     if (jj_scan_token(MIN)) return true;
@@ -6326,6 +6249,61 @@
     return false;
   }
 
+  private boolean jj_3R_149()
+ {
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3_2()
+ {
+    if (jj_scan_token(SEMICOLON)) return true;
+    if (jj_3R_44()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(139)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(140)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(147)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(142)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(143)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(144)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(141)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(152)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(135)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(134)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(153)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(136)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(137)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(138)) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    return false;
+  }
+
   private boolean jj_3R_119()
  {
     if (jj_scan_token(COUNT)) return true;
@@ -6393,18 +6371,12 @@
     return false;
   }
 
-  private boolean jj_3R_149()
+  private boolean jj_3R_150()
  {
     if (jj_scan_token(LBRACKET)) return true;
     return false;
   }
 
-  private boolean jj_3R_143()
- {
-    if (jj_3R_149()) return true;
-    return false;
-  }
-
   private boolean jj_3R_113()
  {
     if (jj_scan_token(EXISTS)) return true;
@@ -6412,6 +6384,12 @@
     return false;
   }
 
+  private boolean jj_3R_143()
+ {
+    if (jj_3R_150()) return true;
+    return false;
+  }
+
   private boolean jj_3R_118()
  {
     Token xsp;
@@ -6425,7 +6403,7 @@
 
   private boolean jj_3R_142()
  {
-    if (jj_3R_148()) return true;
+    if (jj_3R_149()) return true;
     return false;
   }
 
@@ -6854,12 +6832,6 @@
     return false;
   }
 
-  private boolean jj_3R_136()
- {
-    if (jj_scan_token(LBRACE)) return true;
-    return false;
-  }
-
   private boolean jj_3R_46()
  {
     if (jj_3R_106()) return true;
@@ -7042,6 +7014,12 @@
     return false;
   }
 
+  private boolean jj_3R_136()
+ {
+    if (jj_scan_token(LBRACE)) return true;
+    return false;
+  }
+
   private boolean jj_3_3()
  {
     if (jj_scan_token(DOT)) return true;
@@ -7049,50 +7027,67 @@
     return false;
   }
 
-  private boolean jj_3_1()
- {
-    if (jj_3R_43()) return true;
-    return false;
-  }
-
   private boolean jj_3R_145()
  {
     if (jj_scan_token(IRIref)) return true;
     return false;
   }
 
-  private boolean jj_3R_172()
+  private boolean jj_3_1()
+ {
+    if (jj_3R_43()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_173()
  {
     if (jj_scan_token(ANON)) return true;
     return false;
   }
 
-  private boolean jj_3R_162()
+  private boolean jj_3R_163()
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_171()) {
+    if (jj_3R_172()) {
     jj_scanpos = xsp;
-    if (jj_3R_172()) return true;
+    if (jj_3R_173()) return true;
     }
     return false;
   }
 
-  private boolean jj_3R_171()
+  private boolean jj_3R_172()
  {
     if (jj_scan_token(BLANK_NODE_LABEL)) return true;
     return false;
   }
 
+  private boolean jj_3R_165()
+ {
+    if (jj_scan_token(PNAME_NS)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_164()
+ {
+    if (jj_scan_token(PNAME_LN)) return true;
+    return false;
+  }
+
   private boolean jj_3R_105()
  {
     if (jj_3R_118()) return true;
     return false;
   }
 
-  private boolean jj_3R_164()
+  private boolean jj_3R_159()
  {
-    if (jj_scan_token(PNAME_NS)) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_164()) {
+    jj_scanpos = xsp;
+    if (jj_3R_165()) return true;
+    }
     return false;
   }
 
@@ -7113,9 +7108,51 @@
     return false;
   }
 
-  private boolean jj_3R_163()
+  private boolean jj_3_4()
  {
-    if (jj_scan_token(PNAME_LN)) return true;
+    if (jj_scan_token(DOT)) return true;
+    if (jj_3R_45()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_152()
+ {
+    if (jj_3R_159()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_144()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_151()) {
+    jj_scanpos = xsp;
+    if (jj_3R_152()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_151()
+ {
+    if (jj_3R_145()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_177()
+ {
+    if (jj_scan_token(STRING_LITERAL_LONG2)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_176()
+ {
+    if (jj_scan_token(STRING_LITERAL_LONG1)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_175()
+ {
+    if (jj_scan_token(STRING_LITERAL2)) return true;
     return false;
   }
 
@@ -7125,20 +7162,25 @@
     return false;
   }
 
-  private boolean jj_3_4()
+  private boolean jj_3R_174()
  {
-    if (jj_scan_token(DOT)) return true;
-    if (jj_3R_45()) return true;
+    if (jj_scan_token(STRING_LITERAL1)) return true;
     return false;
   }
 
-  private boolean jj_3R_158()
+  private boolean jj_3R_166()
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_163()) {
+    if (jj_3R_174()) {
     jj_scanpos = xsp;
-    if (jj_3R_164()) return true;
+    if (jj_3R_175()) {
+    jj_scanpos = xsp;
+    if (jj_3R_176()) {
+    jj_scanpos = xsp;
+    if (jj_3R_177()) return true;
+    }
+    }
     }
     return false;
   }
@@ -7151,26 +7193,32 @@
     return false;
   }
 
-  private boolean jj_3R_151()
+  private boolean jj_3R_171()
  {
-    if (jj_3R_158()) return true;
+    if (jj_scan_token(FALSE)) return true;
     return false;
   }
 
-  private boolean jj_3R_144()
+  private boolean jj_3R_162()
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_150()) {
+    if (jj_3R_170()) {
     jj_scanpos = xsp;
-    if (jj_3R_151()) return true;
+    if (jj_3R_171()) return true;
     }
     return false;
   }
 
-  private boolean jj_3R_150()
+  private boolean jj_3R_170()
  {
-    if (jj_3R_145()) return true;
+    if (jj_scan_token(TRUE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_135()
+ {
+    if (jj_scan_token(LPAREN)) return true;
     return false;
   }
 
@@ -7181,6 +7229,18 @@
     return false;
   }
 
+  private boolean jj_3R_189()
+ {
+    if (jj_scan_token(DOUBLE_NEGATIVE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_188()
+ {
+    if (jj_scan_token(DECIMAL_NEGATIVE)) return true;
+    return false;
+  }
+
   private boolean jj_3R_103()
  {
     Token xsp;
@@ -7198,9 +7258,34 @@
     return false;
   }
 
-  private boolean jj_3R_176()
+  private boolean jj_3R_187()
  {
-    if (jj_scan_token(STRING_LITERAL_LONG2)) return true;
+    if (jj_scan_token(INTEGER_NEGATIVE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_109()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(174)) {
+    jj_scanpos = xsp;
+    if (jj_3R_135()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_180()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_187()) {
+    jj_scanpos = xsp;
+    if (jj_3R_188()) {
+    jj_scanpos = xsp;
+    if (jj_3R_189()) return true;
+    }
+    }
     return false;
   }
 
@@ -7214,96 +7299,27 @@
     return false;
   }
 
-  private boolean jj_3R_175()
- {
-    if (jj_scan_token(STRING_LITERAL_LONG1)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_174()
- {
-    if (jj_scan_token(STRING_LITERAL2)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_173()
- {
-    if (jj_scan_token(STRING_LITERAL1)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_165()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_173()) {
-    jj_scanpos = xsp;
-    if (jj_3R_174()) {
-    jj_scanpos = xsp;
-    if (jj_3R_175()) {
-    jj_scanpos = xsp;
-    if (jj_3R_176()) return true;
-    }
-    }
-    }
-    return false;
-  }
-
-  private boolean jj_3R_135()
- {
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_170()
- {
-    if (jj_scan_token(FALSE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_161()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_169()) {
-    jj_scanpos = xsp;
-    if (jj_3R_170()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_169()
- {
-    if (jj_scan_token(TRUE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_109()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(173)) {
-    jj_scanpos = xsp;
-    if (jj_3R_135()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_188()
- {
-    if (jj_scan_token(DOUBLE_NEGATIVE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_187()
- {
-    if (jj_scan_token(DECIMAL_NEGATIVE)) return true;
-    return false;
-  }
-
   private boolean jj_3R_186()
  {
-    if (jj_scan_token(INTEGER_NEGATIVE)) return true;
+    if (jj_scan_token(DOUBLE_POSITIVE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_185()
+ {
+    if (jj_scan_token(DECIMAL_POSITIVE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_184()
+ {
+    if (jj_scan_token(INTEGER_POSITIVE)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_158()
+ {
+    if (jj_scan_token(NIL)) return true;
     return false;
   }
 
@@ -7311,51 +7327,19 @@
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_186()) {
+    if (jj_3R_184()) {
     jj_scanpos = xsp;
-    if (jj_3R_187()) {
+    if (jj_3R_185()) {
     jj_scanpos = xsp;
-    if (jj_3R_188()) return true;
+    if (jj_3R_186()) return true;
     }
     }
     return false;
   }
 
-  private boolean jj_3R_185()
- {
-    if (jj_scan_token(DOUBLE_POSITIVE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_184()
- {
-    if (jj_scan_token(DECIMAL_POSITIVE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_183()
- {
-    if (jj_scan_token(INTEGER_POSITIVE)) return true;
-    return false;
-  }
-
   private boolean jj_3R_157()
  {
-    if (jj_scan_token(NIL)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_178()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_183()) {
-    jj_scanpos = xsp;
-    if (jj_3R_184()) {
-    jj_scanpos = xsp;
-    if (jj_3R_185()) return true;
-    }
-    }
+    if (jj_3R_163()) return true;
     return false;
   }
 
@@ -7371,6 +7355,12 @@
     return false;
   }
 
+  private boolean jj_3R_183()
+ {
+    if (jj_scan_token(DOUBLE)) return true;
+    return false;
+  }
+
   private boolean jj_3R_154()
  {
     if (jj_3R_160()) return true;
@@ -7379,28 +7369,14 @@
 
   private boolean jj_3R_182()
  {
-    if (jj_scan_token(DOUBLE)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_153()
- {
-    if (jj_3R_159()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_181()
- {
     if (jj_scan_token(DECIMAL)) return true;
     return false;
   }
 
-  private boolean jj_3R_147()
+  private boolean jj_3R_148()
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_152()) {
-    jj_scanpos = xsp;
     if (jj_3R_153()) {
     jj_scanpos = xsp;
     if (jj_3R_154()) {
@@ -7409,7 +7385,9 @@
     jj_scanpos = xsp;
     if (jj_3R_156()) {
     jj_scanpos = xsp;
-    if (jj_3R_157()) return true;
+    if (jj_3R_157()) {
+    jj_scanpos = xsp;
+    if (jj_3R_158()) return true;
     }
     }
     }
@@ -7418,33 +7396,33 @@
     return false;
   }
 
-  private boolean jj_3R_152()
+  private boolean jj_3R_153()
  {
     if (jj_3R_144()) return true;
     return false;
   }
 
-  private boolean jj_3R_177()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_180()) {
-    jj_scanpos = xsp;
-    if (jj_3R_181()) {
-    jj_scanpos = xsp;
-    if (jj_3R_182()) return true;
-    }
-    }
-    return false;
-  }
-
-  private boolean jj_3R_180()
+  private boolean jj_3R_181()
  {
     if (jj_scan_token(INTEGER)) return true;
     return false;
   }
 
-  private boolean jj_3R_146()
+  private boolean jj_3R_178()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_181()) {
+    jj_scanpos = xsp;
+    if (jj_3R_182()) {
+    jj_scanpos = xsp;
+    if (jj_3R_183()) return true;
+    }
+    }
+    return false;
+  }
+
+  private boolean jj_3R_147()
  {
     Token xsp;
     xsp = jj_scanpos;
@@ -7455,6 +7433,12 @@
     return false;
   }
 
+  private boolean jj_3R_169()
+ {
+    if (jj_3R_180()) return true;
+    return false;
+  }
+
   private boolean jj_3R_168()
  {
     if (jj_3R_179()) return true;
@@ -7467,47 +7451,47 @@
     return false;
   }
 
-  private boolean jj_3R_166()
+  private boolean jj_3R_161()
  {
-    if (jj_3R_177()) return true;
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_167()) {
+    jj_scanpos = xsp;
+    if (jj_3R_168()) {
+    jj_scanpos = xsp;
+    if (jj_3R_169()) return true;
+    }
+    }
     return false;
   }
 
   private boolean jj_3R_160()
  {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_166()) {
-    jj_scanpos = xsp;
-    if (jj_3R_167()) {
-    jj_scanpos = xsp;
-    if (jj_3R_168()) return true;
-    }
-    }
+    if (jj_3R_166()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_146()
+ {
+    if (jj_scan_token(LT2)) return true;
     return false;
   }
 
   private boolean jj_3R_141()
  {
-    if (jj_3R_147()) return true;
+    if (jj_3R_148()) return true;
     return false;
   }
 
   private boolean jj_3R_140()
  {
-    if (jj_3R_146()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_159()
- {
-    if (jj_3R_165()) return true;
+    if (jj_3R_147()) return true;
     return false;
   }
 
   private boolean jj_3R_139()
  {
-    if (jj_scan_token(LT2)) return true;
+    if (jj_3R_146()) return true;
     return false;
   }
 
@@ -7525,6 +7509,48 @@
     return false;
   }
 
+  private boolean jj_3R_134()
+ {
+    if (jj_scan_token(AGG)) return true;
+    if (jj_3R_144()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_133()
+ {
+    if (jj_scan_token(VAR_POP)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_132()
+ {
+    if (jj_scan_token(VAR_SAMP)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_131()
+ {
+    if (jj_scan_token(VARIANCE)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_130()
+ {
+    if (jj_scan_token(STDEV_POP)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_129()
+ {
+    if (jj_scan_token(STDEV_SAMP)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
   /** Generated Token Manager. */
   public ARQParserTokenManager token_source;
   JavaCharStream jj_input_stream;
@@ -7554,25 +7580,25 @@
       jj_la1_init_6();
    }
    private static void jj_la1_init_0() {
-      jj_la1_0 = new int[] {0x1e400000,0x200,0x300000,0x300000,0x0,0x1800000,0x1800000,0x1c00,0x0,0xdc00,0xdc00,0xdc00,0x0,0x0,0x0,0xdc00,0xdc00,0x0,0x0,0x0,0x0,0x0,0xc000,0x1c00,0x0,0x0,0x0,0x80000000,0x60000000,0xdc00,0x0,0xdc00,0x1c00,0xdc00,0x0,0xdc00,0xdc00,0x40000000,0x20000000,0x60000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c00,0x0,0x1c00,0x0,0xfc00,0x0,0x0,0xfc00,0xfc00,0xfc00,0x0,0x0,0xfc00,0x0,0xfc00,0x0,0x400000,0xfc00,0x0,0x0,0xfc00,0xfc00,0x0,0x0,0x0,0xc000,0x3c00,0xc000,0x0,0x0,0x3c00,0x0,0x3c00,0x0,0x1c00,0x800000,0x0,0x0,0x0,0x0,0x0,0xfc00,0x8dc00,0x0,0x8dc00,0x8dc00,0x0,0xfc00,0x88dc00,0x88dc00,0x0,0x88dc00,0x88dc00,0x0,0x0,0x0,0x0,0x0,0x881c00,0x0,0x0,0x0,0x0,0x881c00,0x0,0x81c00,0x81c00,0x81c00,0x81c00,0x0,0x0,0xfc00,0xfc00,0xfc00,0xfc00,0xfc00,0xdc00,0xfc00,0xc000,0x3c00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xdc00,0xdc00,0x0,0x0,0x0,0x0,0x0,0x0,0x800000,0xdc00,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x0,0x0,0x0,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x0,0x0,0x10000,0x10000,0x0,0x0,0x0,0x0,0x0,0x0,0x1c00,0x1800,0x2000,};
+      jj_la1_0 = new int[] {0x1e400000,0x200,0x300000,0x300000,0x0,0x1800000,0x1800000,0x1c00,0x0,0xdc00,0xdc00,0xdc00,0x0,0x0,0x0,0xdc00,0xdc00,0x0,0x0,0x0,0x0,0x0,0xc000,0x1c00,0x0,0x0,0x0,0x80000000,0x60000000,0xdc00,0x0,0xdc00,0x1c00,0xdc00,0x0,0xdc00,0xdc00,0x40000000,0x20000000,0x60000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1c00,0x0,0x1c00,0x0,0xfc00,0x0,0x0,0xfc00,0xfc00,0xfc00,0x0,0x0,0xfc00,0x0,0xfc00,0x0,0x400000,0xfc00,0x0,0x0,0xfc00,0xfc00,0x0,0x0,0x0,0xc000,0x1c00,0xc000,0x0,0x0,0x1c00,0x0,0x1c00,0x0,0x1c00,0x800000,0x0,0x0,0x0,0x0,0x0,0xfc00,0x8dc00,0x0,0x8dc00,0x8dc00,0x0,0xfc00,0x88dc00,0x88dc00,0x0,0x88dc00,0x88dc00,0x0,0x0,0x0,0x0,0x0,0x881c00,0x0,0x0,0x0,0x0,0x881c00,0x0,0x81c00,0x81c00,0x81c00,0x81c00,0x0,0x0,0xfc00,0xfc00,0xfc00,0xfc00,0xfc00,0xdc00,0xfc00,0xc000,0x3c00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xdc00,0xdc00,0x0,0x0,0x0,0x0,0x0,0x0,0x800000,0xdc00,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x0,0x0,0x0,0x800000,0x800000,0x800000,0x800000,0x800000,0x800000,0x0,0x0,0x10000,0x10000,0x0,0x0,0x0,0x0,0x0,0x0,0x1c00,0x1800,0x2000,};
    }
    private static void jj_la1_init_1() {
-      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x40000,0xffc30000,0xffc30000,0xffc30000,0x40,0x40,0xc0,0x0,0x0,0x40,0x80,0x40,0x40,0x0,0x0,0x20,0x80,0x80000,0x100000,0x0,0x0,0xffc30000,0x40000,0xffc30000,0xffc30000,0xffc30018,0x18,0xffc30000,0xffc30018,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x200,0x200,0x220,0x0,0x200,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x3f602,0x0,0x0,0x0,0x0,0x3f602,0x0,0x0,0x4,0x0,0x0,0x0,0x4,0x0,0x4,0x800,0xffc30000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000,0x20000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffc30000,0xffc30000,0x0,0x0,0xffc30000,0x0,0x0,0x0,0x0,0xffc30000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffc00000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x80000,0xff860000,0xff860000,0xff860000,0x40,0x40,0xc0,0x0,0x0,0x40,0x80,0x40,0x40,0x0,0x0,0x20,0x80,0x100000,0x200000,0x0,0x0,0xff860000,0x80000,0xff860000,0xff860000,0xff860018,0x18,0xff860000,0xff860018,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x200,0x200,0x220,0x0,0x200,0x0,0x0,0x0,0x0,0x200,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x7f602,0x0,0x0,0x0,0x0,0x7f602,0x0,0x0,0x4,0x0,0x0,0x0,0x4,0x0,0x4,0x800,0xff860000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40000,0x40000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff860000,0xff860000,0x0,0x0,0xff860000,0x0,0x0,0x0,0x0,0xff860000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff800000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_init_2() {
-      jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffcbdbf,0xfffcbdbf,0xfffcbdbf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffcbdbf,0x0,0xfffcbdbf,0xfffcbdbf,0xfffcbdbf,0x0,0xfffcbdbf,0xfffcbdbf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffcbdbf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30000,0x30000,0x0,0x30000,0x30000,0x0,0x0,0x0,0x0,0x0,0x30000,0x0,0x0,0x0,0x0,0x30000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffcbdbf,0xfffcbdbf,0x0,0x0,0xfffcbdbf,0x0,0x0,0x0,0x0,0xfffcbdbf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfff97b7f,0xfff97b7f,0xfff97b7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfff97b7f,0x0,0xfff97b7f,0xfff97b7f,0xfff97b7f,0x0,0xfff97b7f,0xfff97b7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfff97b7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x60000,0x60000,0x0,0x60000,0x60000,0x0,0x0,0x0,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfff97b7f,0xfff97b7f,0x0,0x0,0xfff97b7f,0x0,0x0,0x0,0x0,0xfff97b7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_init_3() {
-      jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfffffff,0xbfffffff,0xbfffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfffffff,0x0,0xbfffffff,0xbfffffff,0xbfffffff,0x0,0xbfffffff,0xbfffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xbfffffff,0xbfffffff,0x0,0x0,0xbfffffff,0x0,0x0,0x0,0x0,0xbfffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7fffffff,0x7fffffff,0x7fffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7fffffff,0x0,0x7fffffff,0x7fffffff,0x7fffffff,0x0,0x7fffffff,0x7fffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7fffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7fffffff,0x7fffffff,0x0,0x0,0x7fffffff,0x0,0x0,0x0,0x0,0x7fffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_init_4() {
-      jj_la1_4 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfc00000c,0x0,0xfc00000f,0xfc00000f,0xfc00000f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfc00000c,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x3,0x3,0x3,0x0,0x3,0x3,0x0,0x0,0x0,0x0,0x0,0x84ffe0,0x84ffe0,0x20000,0x80000,0x20000,0x20000,0x20000,0x20000,0x20000,0x20000,0x800000,0x20,0x60,0x1000000,0x0,0x0,0x200000,0x600000,0xfc00000c,0x0,0x0,0xfc00000c,0xfc00000c,0xfc00000c,0x0,0x0,0xfc00000c,0x0,0xfc00000c,0x0,0x0,0xfc00000c,0x0,0x0,0xfc00000c,0xfc00000c,0x0,0x0,0x20000,0x0,0xfc00000c,0x0,0x0,0x0,0xfc00000c,0x0,0xfc00000c,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0xfc00000c,0x0,0x0,0x0,0x0,0x0,0xfc00000c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x0,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfc00000c,0xfc00000c,0xfc00000c,0xfc00000c,0xfc00000c,0x0,0x0,0x0,0xfc00000c,0x0,0x0,0x0,0x0,0xe0000000,0xe0000000,0x0,0x0,0xe0000000,0x0,0x0,0xfc00000f,0xfc00000f,0x0,0x0,0x3,0x0,0x0,0x0,0x0,0xfc00000f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfc000000,0x1c000000,0xe0000000,0x0,0xc,0x0,0x0,0x0,0x0,};
+      jj_la1_4 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000018,0x0,0xf800001f,0xf800001f,0xf800001f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000018,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x0,0x7,0x7,0x7,0x0,0x7,0x7,0x0,0x0,0x0,0x0,0x0,0x109ffc0,0x109ffc0,0x40000,0x100000,0x40000,0x40000,0x40000,0x40000,0x40000,0x40000,0x1000000,0x40,0xc0,0x2000000,0x0,0x0,0x400000,0xc00000,0xf8000018,0x0,0x0,0xf8000018,0xf8000018,0xf8000018,0x0,0x0,0xf8000018,0x0,0xf8000018,0x0,0x0,0xf8000018,0x0,0x0,0xf8000018,0xf8000018,0x0,0x0,0x40000,0x0,0xf8000018,0x0,0x0,0x0,0xf8000018,0x0,0xf8000018,0x0,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000018,0x0,0x0,0x0,0x0,0x0,0xf8000018,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x0,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000018,0xf8000018,0xf8000018,0xf8000018,0xf8000018,0x0,0x0,0x0,0xf8000018,0x0,0x0,0x0,0x0,0xc0000000,0xc0000000,0x0,0x0,0xc0000000,0x0,0x0,0xf800001f,0xf800001f,0x0,0x0,0x7,0x0,0x0,0x0,0x0,0xf800001f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000000,0x38000000,0xc0000000,0x0,0x18,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_init_5() {
-      jj_la1_5 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x787,0x0,0xf87,0xf87,0xf87,0x0,0x0,0x4000,0x0,0x0,0x0,0x4000,0x0,0x0,0x100000,0x787,0x0,0x0,0x0,0x0,0x0,0x0,0x800,0x0,0x800,0x800,0x800,0x0,0x800,0x800,0x0,0x0,0x0,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20052f87,0x0,0x200000,0x20052f87,0x20052f87,0x20052f87,0x4000,0x200000,0x20052f87,0x0,0x20052f87,0x200000,0x0,0x20052f87,0x4000,0x200000,0x20052f87,0x20052f87,0x200000,0x4000,0x0,0x2800,0x40787,0x0,0x2800,0x2800,0x40787,0x2800,0x40787,0x0,0x800,0x0,0x100000,0x2800,0x100000,0x2800,0x200000,0x20052f87,0x0,0x80000,0x0,0x0,0x100000,0x20052f87,0x40000800,0x40000800,0x80000,0x40000800,0x40000800,0x100000,0x0,0x0,0x0,0x4000,0x40000800,0x8000,0x108000,0x100000,0x4000,0x40000800,0x0,0x0,0x800,0x0,0x0,0x10800,0x10800,0x20052f87,0x20052f87,0x20052f87,0x20052f87,0x20042787,0x0,0x40000,0x0,0x42787,0x0,0x0,0xfc00000,0xfc00000,0x7,0x7,0x0,0x0,0x7,0x0,0x0,0x40000f87,0xf87,0x2800,0x100000,0x0,0x100000,0x100000,0x100000,0x0,0x40000f87,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000,0x80000,0x80000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2800,0x0,0x0,0x7,0x0,0x0,0x7,0x0,0x780,0x0,0x0,0x40000,};
+      jj_la1_5 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf0f,0x0,0x1f0f,0x1f0f,0x1f0f,0x0,0x0,0x8000,0x0,0x0,0x0,0x8000,0x0,0x0,0x200000,0xf0f,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x1000,0x1000,0x1000,0x0,0x1000,0x1000,0x0,0x0,0x0,0x0,0x100000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400a5f0f,0x0,0x400000,0x400a5f0f,0x400a5f0f,0x400a5f0f,0x8000,0x400000,0x400a5f0f,0x0,0x400a5f0f,0x400000,0x0,0x400a5f0f,0x8000,0x400000,0x400a5f0f,0x400a5f0f,0x400000,0x8000,0x0,0x5000,0x40000f0f,0x0,0x5000,0x5000,0x40000f0f,0x5000,0x40000f0f,0x0,0x1000,0x0,0x200000,0x5000,0x200000,0x5000,0x400000,0x400a5f0f,0x0,0x100000,0x0,0x0,0x200000,0x400a5f0f,0x80001000,0x80001000,0x100000,0x80001000,0x80001000,0x200000,0x0,0x0,0x0,0x8000,0x80001000,0x10000,0x210000,0x200000,0x8000,0x80001000,0x0,0x0,0x1000,0x0,0x0,0x21000,0x21000,0x400a5f0f,0x400a5f0f,0x400a5f0f,0x400a5f0f,0x40084f0f,0x0,0x80000,0x0,0x84f0f,0x0,0x0,0x1f800000,0x1f800000,0xf,0xf,0x0,0x0,0xf,0x0,0x0,0x80001f0f,0x1f0f,0x5000,0x200000,0x0,0x200000,0x200000,0x200000,0x0,0x80001f0f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100000,0x100000,0x100000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000,0x0,0x0,0xf,0x0,0x1,0xe,0x0,0xf00,0x0,0x0,0x80000,};
    }
    private static void jj_la1_init_6() {
-      jj_la1_6 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x800,0x800,0x0,0x800,0x800,0x0,0x400,0x840,0x840,0x4028,0x800,0x0,0x0,0x28,0x4028,0x0,0x400,0x800,0x800,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x4,0x0,0x0,0x18,0x0,0x60,0x60,0x18,0x60,0x60,0x18,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_6 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x0,0x1000,0x1000,0x0,0x800,0x1080,0x1080,0x8050,0x1000,0x0,0x0,0x50,0x8050,0x0,0x800,0x1000,0x1000,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x8,0x0,0x0,0x30,0x0,0xc0,0xc0,0x30,0xc0,0xc0,0x30,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[5];
   private boolean jj_rescan = false;
@@ -7759,7 +7785,7 @@
   /** Generate ParseException. */
   public ParseException generateParseException() {
     jj_expentries.clear();
-    boolean[] la1tokens = new boolean[218];
+    boolean[] la1tokens = new boolean[219];
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
@@ -7791,7 +7817,7 @@
         }
       }
     }
-    for (int i = 0; i < 218; i++) {
+    for (int i = 0; i < 219; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserConstants.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserConstants.java
index 35f2688..f031b72 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserConstants.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserConstants.java
@@ -95,345 +95,347 @@
   /** RegularExpression Id. */
   int LET = 47;
   /** RegularExpression Id. */
-  int EXISTS = 48;
+  int FIND = 48;
   /** RegularExpression Id. */
-  int NOT = 49;
+  int EXISTS = 49;
   /** RegularExpression Id. */
-  int AS = 50;
+  int NOT = 50;
   /** RegularExpression Id. */
-  int GROUP = 51;
+  int AS = 51;
   /** RegularExpression Id. */
-  int HAVING = 52;
+  int GROUP = 52;
   /** RegularExpression Id. */
-  int SEPARATOR = 53;
+  int HAVING = 53;
   /** RegularExpression Id. */
-  int AGG = 54;
+  int SEPARATOR = 54;
   /** RegularExpression Id. */
-  int COUNT = 55;
+  int AGG = 55;
   /** RegularExpression Id. */
-  int MIN = 56;
+  int COUNT = 56;
   /** RegularExpression Id. */
-  int MAX = 57;
+  int MIN = 57;
   /** RegularExpression Id. */
-  int SUM = 58;
+  int MAX = 58;
   /** RegularExpression Id. */
-  int AVG = 59;
+  int SUM = 59;
   /** RegularExpression Id. */
-  int MEDIAN = 60;
+  int AVG = 60;
   /** RegularExpression Id. */
-  int MODE = 61;
+  int MEDIAN = 61;
   /** RegularExpression Id. */
-  int STDEV = 62;
+  int MODE = 62;
   /** RegularExpression Id. */
-  int STDEV_SAMP = 63;
+  int STDEV = 63;
   /** RegularExpression Id. */
-  int STDEV_POP = 64;
+  int STDEV_SAMP = 64;
   /** RegularExpression Id. */
-  int VARIANCE = 65;
+  int STDEV_POP = 65;
   /** RegularExpression Id. */
-  int VAR_SAMP = 66;
+  int VARIANCE = 66;
   /** RegularExpression Id. */
-  int VAR_POP = 67;
+  int VAR_SAMP = 67;
   /** RegularExpression Id. */
-  int SAMPLE = 68;
+  int VAR_POP = 68;
   /** RegularExpression Id. */
-  int GROUP_CONCAT = 69;
+  int SAMPLE = 69;
   /** RegularExpression Id. */
-  int FILTER = 70;
+  int GROUP_CONCAT = 70;
   /** RegularExpression Id. */
-  int BOUND = 71;
+  int FILTER = 71;
   /** RegularExpression Id. */
-  int COALESCE = 72;
+  int BOUND = 72;
   /** RegularExpression Id. */
-  int IN = 73;
+  int COALESCE = 73;
   /** RegularExpression Id. */
-  int IF = 74;
+  int IN = 74;
   /** RegularExpression Id. */
-  int BNODE = 75;
+  int IF = 75;
   /** RegularExpression Id. */
-  int IRI = 76;
+  int BNODE = 76;
   /** RegularExpression Id. */
-  int URI = 77;
+  int IRI = 77;
   /** RegularExpression Id. */
-  int CAST = 78;
+  int URI = 78;
   /** RegularExpression Id. */
-  int CALL = 79;
+  int CAST = 79;
   /** RegularExpression Id. */
-  int MULTI = 80;
+  int CALL = 80;
   /** RegularExpression Id. */
-  int SHORTEST = 81;
+  int MULTI = 81;
   /** RegularExpression Id. */
-  int STR = 82;
+  int SHORTEST = 82;
   /** RegularExpression Id. */
-  int STRLANG = 83;
+  int STR = 83;
   /** RegularExpression Id. */
-  int STRDT = 84;
+  int STRLANG = 84;
   /** RegularExpression Id. */
-  int DTYPE = 85;
+  int STRDT = 85;
   /** RegularExpression Id. */
-  int LANG = 86;
+  int DTYPE = 86;
   /** RegularExpression Id. */
-  int LANGMATCHES = 87;
+  int LANG = 87;
   /** RegularExpression Id. */
-  int IS_URI = 88;
+  int LANGMATCHES = 88;
   /** RegularExpression Id. */
-  int IS_IRI = 89;
+  int IS_URI = 89;
   /** RegularExpression Id. */
-  int IS_BLANK = 90;
+  int IS_IRI = 90;
   /** RegularExpression Id. */
-  int IS_LITERAL = 91;
+  int IS_BLANK = 91;
   /** RegularExpression Id. */
-  int IS_NUMERIC = 92;
+  int IS_LITERAL = 92;
   /** RegularExpression Id. */
-  int REGEX = 93;
+  int IS_NUMERIC = 93;
   /** RegularExpression Id. */
-  int SAME_TERM = 94;
+  int REGEX = 94;
   /** RegularExpression Id. */
-  int RAND = 95;
+  int SAME_TERM = 95;
   /** RegularExpression Id. */
-  int ABS = 96;
+  int RAND = 96;
   /** RegularExpression Id. */
-  int CEIL = 97;
+  int ABS = 97;
   /** RegularExpression Id. */
-  int FLOOR = 98;
+  int CEIL = 98;
   /** RegularExpression Id. */
-  int ROUND = 99;
+  int FLOOR = 99;
   /** RegularExpression Id. */
-  int CONCAT = 100;
+  int ROUND = 100;
   /** RegularExpression Id. */
-  int SUBSTR = 101;
+  int CONCAT = 101;
   /** RegularExpression Id. */
-  int STRLEN = 102;
+  int SUBSTR = 102;
   /** RegularExpression Id. */
-  int REPLACE = 103;
+  int STRLEN = 103;
   /** RegularExpression Id. */
-  int UCASE = 104;
+  int REPLACE = 104;
   /** RegularExpression Id. */
-  int LCASE = 105;
+  int UCASE = 105;
   /** RegularExpression Id. */
-  int ENCODE_FOR_URI = 106;
+  int LCASE = 106;
   /** RegularExpression Id. */
-  int CONTAINS = 107;
+  int ENCODE_FOR_URI = 107;
   /** RegularExpression Id. */
-  int STRSTARTS = 108;
+  int CONTAINS = 108;
   /** RegularExpression Id. */
-  int STRENDS = 109;
+  int STRSTARTS = 109;
   /** RegularExpression Id. */
-  int STRBEFORE = 110;
+  int STRENDS = 110;
   /** RegularExpression Id. */
-  int STRAFTER = 111;
+  int STRBEFORE = 111;
   /** RegularExpression Id. */
-  int YEAR = 112;
+  int STRAFTER = 112;
   /** RegularExpression Id. */
-  int MONTH = 113;
+  int YEAR = 113;
   /** RegularExpression Id. */
-  int DAY = 114;
+  int MONTH = 114;
   /** RegularExpression Id. */
-  int HOURS = 115;
+  int DAY = 115;
   /** RegularExpression Id. */
-  int MINUTES = 116;
+  int HOURS = 116;
   /** RegularExpression Id. */
-  int SECONDS = 117;
+  int MINUTES = 117;
   /** RegularExpression Id. */
-  int TIMEZONE = 118;
+  int SECONDS = 118;
   /** RegularExpression Id. */
-  int TZ = 119;
+  int TIMEZONE = 119;
   /** RegularExpression Id. */
-  int NOW = 120;
+  int TZ = 120;
   /** RegularExpression Id. */
-  int UUID = 121;
+  int NOW = 121;
   /** RegularExpression Id. */
-  int STRUUID = 122;
+  int UUID = 122;
   /** RegularExpression Id. */
-  int VERSION = 123;
+  int STRUUID = 123;
   /** RegularExpression Id. */
-  int MD5 = 124;
+  int VERSION = 124;
   /** RegularExpression Id. */
-  int SHA1 = 125;
+  int MD5 = 125;
   /** RegularExpression Id. */
-  int SHA224 = 126;
+  int SHA1 = 126;
   /** RegularExpression Id. */
-  int SHA256 = 127;
+  int SHA224 = 127;
   /** RegularExpression Id. */
-  int SHA384 = 128;
+  int SHA256 = 128;
   /** RegularExpression Id. */
-  int SHA512 = 129;
+  int SHA384 = 129;
   /** RegularExpression Id. */
-  int TRUE = 130;
+  int SHA512 = 130;
   /** RegularExpression Id. */
-  int FALSE = 131;
+  int TRUE = 131;
   /** RegularExpression Id. */
-  int DATA = 132;
+  int FALSE = 132;
+  /** RegularExpression Id. */
+  int DATA = 133;
   /** RegularExpression Id. */
-  int INSERT = 133;
+  int INSERT = 134;
   /** RegularExpression Id. */
-  int DELETE = 134;
+  int DELETE = 135;
   /** RegularExpression Id. */
-  int INSERT_DATA = 135;
+  int INSERT_DATA = 136;
   /** RegularExpression Id. */
-  int DELETE_DATA = 136;
+  int DELETE_DATA = 137;
   /** RegularExpression Id. */
-  int DELETE_WHERE = 137;
+  int DELETE_WHERE = 138;
   /** RegularExpression Id. */
-  int LOAD = 138;
+  int LOAD = 139;
   /** RegularExpression Id. */
-  int CLEAR = 139;
+  int CLEAR = 140;
   /** RegularExpression Id. */
-  int CREATE = 140;
+  int CREATE = 141;
   /** RegularExpression Id. */
-  int ADD = 141;
+  int ADD = 142;
   /** RegularExpression Id. */
-  int MOVE = 142;
+  int MOVE = 143;
   /** RegularExpression Id. */
-  int COPY = 143;
+  int COPY = 144;
   /** RegularExpression Id. */
-  int META = 144;
+  int META = 145;
   /** RegularExpression Id. */
-  int SILENT = 145;
+  int SILENT = 146;
   /** RegularExpression Id. */
-  int DROP = 146;
+  int DROP = 147;
   /** RegularExpression Id. */
-  int INTO = 147;
+  int INTO = 148;
   /** RegularExpression Id. */
-  int TO = 148;
+  int TO = 149;
   /** RegularExpression Id. */
-  int DFT = 149;
+  int DFT = 150;
   /** RegularExpression Id. */
-  int ALL = 150;
+  int ALL = 151;
   /** RegularExpression Id. */
-  int WITH = 151;
+  int WITH = 152;
   /** RegularExpression Id. */
-  int USING = 152;
+  int USING = 153;
   /** RegularExpression Id. */
-  int DIGITS = 153;
+  int DIGITS = 154;
   /** RegularExpression Id. */
-  int INTEGER = 154;
+  int INTEGER = 155;
   /** RegularExpression Id. */
-  int DECIMAL = 155;
+  int DECIMAL = 156;
   /** RegularExpression Id. */
-  int DOUBLE = 156;
+  int DOUBLE = 157;
   /** RegularExpression Id. */
-  int INTEGER_POSITIVE = 157;
+  int INTEGER_POSITIVE = 158;
   /** RegularExpression Id. */
-  int DECIMAL_POSITIVE = 158;
+  int DECIMAL_POSITIVE = 159;
   /** RegularExpression Id. */
-  int DOUBLE_POSITIVE = 159;
+  int DOUBLE_POSITIVE = 160;
   /** RegularExpression Id. */
-  int INTEGER_NEGATIVE = 160;
+  int INTEGER_NEGATIVE = 161;
   /** RegularExpression Id. */
-  int DECIMAL_NEGATIVE = 161;
+  int DECIMAL_NEGATIVE = 162;
   /** RegularExpression Id. */
-  int DOUBLE_NEGATIVE = 162;
+  int DOUBLE_NEGATIVE = 163;
   /** RegularExpression Id. */
-  int EXPONENT = 163;
+  int EXPONENT = 164;
   /** RegularExpression Id. */
-  int QUOTE_3D = 164;
+  int QUOTE_3D = 165;
   /** RegularExpression Id. */
-  int QUOTE_3S = 165;
+  int QUOTE_3S = 166;
   /** RegularExpression Id. */
-  int ECHAR = 166;
+  int ECHAR = 167;
   /** RegularExpression Id. */
-  int STRING_LITERAL1 = 167;
+  int STRING_LITERAL1 = 168;
   /** RegularExpression Id. */
-  int STRING_LITERAL2 = 168;
+  int STRING_LITERAL2 = 169;
   /** RegularExpression Id. */
-  int STRING_LITERAL_LONG1 = 169;
+  int STRING_LITERAL_LONG1 = 170;
   /** RegularExpression Id. */
-  int STRING_LITERAL_LONG2 = 170;
+  int STRING_LITERAL_LONG2 = 171;
   /** RegularExpression Id. */
-  int LPAREN = 171;
+  int LPAREN = 172;
   /** RegularExpression Id. */
-  int RPAREN = 172;
+  int RPAREN = 173;
   /** RegularExpression Id. */
-  int NIL = 173;
+  int NIL = 174;
   /** RegularExpression Id. */
-  int LBRACE = 174;
+  int LBRACE = 175;
   /** RegularExpression Id. */
-  int RBRACE = 175;
+  int RBRACE = 176;
   /** RegularExpression Id. */
-  int LBRACKET = 176;
+  int LBRACKET = 177;
   /** RegularExpression Id. */
-  int RBRACKET = 177;
+  int RBRACKET = 178;
   /** RegularExpression Id. */
-  int ANON = 178;
+  int ANON = 179;
   /** RegularExpression Id. */
-  int SEMICOLON = 179;
+  int SEMICOLON = 180;
   /** RegularExpression Id. */
-  int COMMA = 180;
+  int COMMA = 181;
   /** RegularExpression Id. */
-  int DOT = 181;
+  int DOT = 182;
   /** RegularExpression Id. */
-  int EQ = 182;
+  int EQ = 183;
   /** RegularExpression Id. */
-  int NE = 183;
+  int NE = 184;
   /** RegularExpression Id. */
-  int GT = 184;
+  int GT = 185;
   /** RegularExpression Id. */
-  int LT = 185;
+  int LT = 186;
   /** RegularExpression Id. */
-  int LE = 186;
+  int LE = 187;
   /** RegularExpression Id. */
-  int GE = 187;
+  int GE = 188;
   /** RegularExpression Id. */
-  int GT2 = 188;
+  int GT2 = 189;
   /** RegularExpression Id. */
-  int LT2 = 189;
+  int LT2 = 190;
   /** RegularExpression Id. */
-  int BANG = 190;
+  int BANG = 191;
   /** RegularExpression Id. */
-  int TILDE = 191;
+  int TILDE = 192;
   /** RegularExpression Id. */
-  int COLON = 192;
+  int COLON = 193;
   /** RegularExpression Id. */
-  int SC_OR = 193;
+  int SC_OR = 194;
   /** RegularExpression Id. */
-  int SC_AND = 194;
+  int SC_AND = 195;
   /** RegularExpression Id. */
-  int PLUS = 195;
+  int PLUS = 196;
   /** RegularExpression Id. */
-  int MINUS = 196;
+  int MINUS = 197;
   /** RegularExpression Id. */
-  int STAR = 197;
+  int STAR = 198;
   /** RegularExpression Id. */
-  int SLASH = 198;
+  int SLASH = 199;
   /** RegularExpression Id. */
-  int DATATYPE = 199;
+  int DATATYPE = 200;
   /** RegularExpression Id. */
-  int AT = 200;
+  int AT = 201;
   /** RegularExpression Id. */
-  int ASSIGN = 201;
+  int ASSIGN = 202;
   /** RegularExpression Id. */
-  int VBAR = 202;
+  int VBAR = 203;
   /** RegularExpression Id. */
-  int CARAT = 203;
+  int CARAT = 204;
   /** RegularExpression Id. */
-  int FPATH = 204;
+  int FPATH = 205;
   /** RegularExpression Id. */
-  int RPATH = 205;
+  int RPATH = 206;
   /** RegularExpression Id. */
-  int QMARK = 206;
+  int QMARK = 207;
   /** RegularExpression Id. */
-  int PN_CHARS_BASE = 207;
+  int PN_CHARS_BASE = 208;
   /** RegularExpression Id. */
-  int PN_CHARS_U = 208;
+  int PN_CHARS_U = 209;
   /** RegularExpression Id. */
-  int PN_CHARS = 209;
+  int PN_CHARS = 210;
   /** RegularExpression Id. */
-  int PN_PREFIX = 210;
+  int PN_PREFIX = 211;
   /** RegularExpression Id. */
-  int PN_LOCAL = 211;
+  int PN_LOCAL = 212;
   /** RegularExpression Id. */
-  int VARNAME = 212;
+  int VARNAME = 213;
   /** RegularExpression Id. */
-  int PN_LOCAL_ESC = 213;
+  int PN_LOCAL_ESC = 214;
   /** RegularExpression Id. */
-  int PLX = 214;
+  int PLX = 215;
   /** RegularExpression Id. */
-  int HEX = 215;
+  int HEX = 216;
   /** RegularExpression Id. */
-  int PERCENT = 216;
+  int PERCENT = 217;
   /** RegularExpression Id. */
-  int UNKNOWN = 217;
+  int UNKNOWN = 218;
 
   /** Lexical state. */
   int DEFAULT = 0;
@@ -488,6 +490,7 @@
     "\"bind\"",
     "\"service\"",
     "\"let\"",
+    "\"find\"",
     "\"exists\"",
     "\"not\"",
     "\"as\"",
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserTokenManager.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserTokenManager.java
index 17c29ab..a9fd774 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserTokenManager.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParserTokenManager.java
@@ -45,164 +45,164 @@
          jjmatchedKind = 1;
          return jjMoveNfa_0(0, 0);
       case 33:
-         jjmatchedKind = 190;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x80000000000000L, 0x0L);
+         jjmatchedKind = 191;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x100000000000000L, 0x0L);
       case 38:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x4L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x8L);
       case 40:
-         jjmatchedKind = 171;
-         return jjMoveNfa_0(0, 0);
-      case 41:
          jjmatchedKind = 172;
          return jjMoveNfa_0(0, 0);
+      case 41:
+         jjmatchedKind = 173;
+         return jjMoveNfa_0(0, 0);
       case 42:
-         jjmatchedKind = 197;
-         return jjMoveNfa_0(0, 0);
-      case 43:
-         jjmatchedKind = 195;
-         return jjMoveNfa_0(0, 0);
-      case 44:
-         jjmatchedKind = 180;
-         return jjMoveNfa_0(0, 0);
-      case 45:
-         jjmatchedKind = 196;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x1000L);
-      case 46:
-         jjmatchedKind = 181;
-         return jjMoveNfa_0(0, 0);
-      case 47:
          jjmatchedKind = 198;
          return jjMoveNfa_0(0, 0);
-      case 58:
-         jjmatchedKind = 192;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x200L);
-      case 59:
-         jjmatchedKind = 179;
+      case 43:
+         jjmatchedKind = 196;
          return jjMoveNfa_0(0, 0);
-      case 60:
-         jjmatchedKind = 185;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x2400000000000000L, 0x2000L);
-      case 61:
+      case 44:
+         jjmatchedKind = 181;
+         return jjMoveNfa_0(0, 0);
+      case 45:
+         jjmatchedKind = 197;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x2000L);
+      case 46:
          jjmatchedKind = 182;
          return jjMoveNfa_0(0, 0);
+      case 47:
+         jjmatchedKind = 199;
+         return jjMoveNfa_0(0, 0);
+      case 58:
+         jjmatchedKind = 193;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x400L);
+      case 59:
+         jjmatchedKind = 180;
+         return jjMoveNfa_0(0, 0);
+      case 60:
+         jjmatchedKind = 186;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x4800000000000000L, 0x4000L);
+      case 61:
+         jjmatchedKind = 183;
+         return jjMoveNfa_0(0, 0);
       case 62:
-         jjmatchedKind = 184;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x1800000000000000L, 0x0L);
+         jjmatchedKind = 185;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x3000000000000000L, 0x0L);
       case 63:
-         jjmatchedKind = 206;
+         jjmatchedKind = 207;
          return jjMoveNfa_0(0, 0);
       case 64:
-         jjmatchedKind = 200;
+         jjmatchedKind = 201;
          return jjMoveNfa_0(0, 0);
       case 65:
-         return jjMoveStringLiteralDfa1_0(0x844010810000000L, 0x100000000L, 0x402000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1088010810000000L, 0x200000000L, 0x804000L, 0x0L);
       case 66:
-         return jjMoveStringLiteralDfa1_0(0x200100100000L, 0x880L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x200100100000L, 0x1100L, 0x0L, 0x0L);
       case 67:
-         return jjMoveStringLiteralDfa1_0(0x80000008000000L, 0x8120000c100L, 0x9800L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x100000008000000L, 0x102400018200L, 0x13000L, 0x0L);
       case 68:
-         return jjMoveStringLiteralDfa1_0(0x1004800000L, 0x4000000200000L, 0x240050L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1004800000L, 0x8000000400000L, 0x4800a0L, 0x0L);
       case 69:
-         return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x40000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x80000000000L, 0x0L, 0x0L);
       case 70:
-         return jjMoveStringLiteralDfa1_0(0x4000000000L, 0x400000040L, 0x8L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1004000000000L, 0x800000080L, 0x10L, 0x0L);
       case 71:
-         return jjMoveStringLiteralDfa1_0(0x8020000000000L, 0x20L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x10020000000000L, 0x40L, 0x0L, 0x0L);
       case 72:
-         return jjMoveStringLiteralDfa1_0(0x10000000000000L, 0x8000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x20000000000000L, 0x10000000000000L, 0x0L, 0x0L);
       case 73:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x1f001600L, 0x80020L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x3e002c00L, 0x100040L, 0x0L);
       case 74:
          return jjMoveStringLiteralDfa1_0(0x2000000L, 0x0L, 0x0L, 0x0L);
       case 76:
-         return jjMoveStringLiteralDfa1_0(0x800020000000L, 0x20000c00000L, 0x400L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x800020000000L, 0x40001800000L, 0x800L, 0x0L);
       case 77:
-         return jjMoveStringLiteralDfa1_0(0x3300100000000000L, 0x1012000000010000L, 0x14000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x6600100000000000L, 0x2024000000020000L, 0x28000L, 0x0L);
       case 78:
-         return jjMoveStringLiteralDfa1_0(0x2002000000000L, 0x100000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x4002000000000L, 0x200000000000000L, 0x0L, 0x0L);
       case 79:
          return jjMoveStringLiteralDfa1_0(0x400c0000000L, 0x0L, 0x0L, 0x0L);
       case 80:
          return jjMoveStringLiteralDfa1_0(0x200000L, 0x0L, 0x0L, 0x0L);
       case 82:
-         return jjMoveStringLiteralDfa1_0(0x1000000L, 0x88a0000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1000000L, 0x11140000000L, 0x0L, 0x0L);
       case 83:
-         return jjMoveStringLiteralDfa1_0(0xc420400000400000L, 0xe420f060401e0011L, 0x20003L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x8840400000400000L, 0xc841e0c0803c0023L, 0x40007L, 0x0L);
       case 84:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0xc0000000000000L, 0x100004L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x180000000000000L, 0x200008L, 0x0L);
       case 85:
-         return jjMoveStringLiteralDfa1_0(0x80400000000L, 0x200010000002000L, 0x1000000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x80400000000L, 0x400020000004000L, 0x2000000L, 0x0L);
       case 86:
-         return jjMoveStringLiteralDfa1_0(0x200000000L, 0x80000000000000eL, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x200000000L, 0x100000000000001cL, 0x0L, 0x0L);
       case 87:
-         return jjMoveStringLiteralDfa1_0(0x8000000000L, 0x0L, 0x800000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x8000000000L, 0x0L, 0x1000000L, 0x0L);
       case 89:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000L, 0x0L, 0x0L);
       case 91:
-         jjmatchedKind = 176;
-         return jjMoveNfa_0(0, 0);
-      case 93:
          jjmatchedKind = 177;
          return jjMoveNfa_0(0, 0);
+      case 93:
+         jjmatchedKind = 178;
+         return jjMoveNfa_0(0, 0);
       case 94:
-         jjmatchedKind = 203;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x80L);
+         jjmatchedKind = 204;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x100L);
       case 97:
          jjmatchedKind = 19;
-         return jjMoveStringLiteralDfa1_0(0x844010810000000L, 0x100000000L, 0x402000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1088010810000000L, 0x200000000L, 0x804000L, 0x0L);
       case 98:
-         return jjMoveStringLiteralDfa1_0(0x200100100000L, 0x880L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x200100100000L, 0x1100L, 0x0L, 0x0L);
       case 99:
-         return jjMoveStringLiteralDfa1_0(0x80000008000000L, 0x8120000c100L, 0x9800L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x100000008000000L, 0x102400018200L, 0x13000L, 0x0L);
       case 100:
-         return jjMoveStringLiteralDfa1_0(0x1004800000L, 0x4000000200000L, 0x240050L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1004800000L, 0x8000000400000L, 0x4800a0L, 0x0L);
       case 101:
-         return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x40000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x80000000000L, 0x0L, 0x0L);
       case 102:
-         return jjMoveStringLiteralDfa1_0(0x4000000000L, 0x400000040L, 0x8L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1004000000000L, 0x800000080L, 0x10L, 0x0L);
       case 103:
-         return jjMoveStringLiteralDfa1_0(0x8020000000000L, 0x20L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x10020000000000L, 0x40L, 0x0L, 0x0L);
       case 104:
-         return jjMoveStringLiteralDfa1_0(0x10000000000000L, 0x8000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x20000000000000L, 0x10000000000000L, 0x0L, 0x0L);
       case 105:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x1f001600L, 0x80020L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x3e002c00L, 0x100040L, 0x0L);
       case 106:
          return jjMoveStringLiteralDfa1_0(0x2000000L, 0x0L, 0x0L, 0x0L);
       case 108:
-         return jjMoveStringLiteralDfa1_0(0x800020000000L, 0x20000c00000L, 0x400L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x800020000000L, 0x40001800000L, 0x800L, 0x0L);
       case 109:
-         return jjMoveStringLiteralDfa1_0(0x3300100000000000L, 0x1012000000010000L, 0x14000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x6600100000000000L, 0x2024000000020000L, 0x28000L, 0x0L);
       case 110:
-         return jjMoveStringLiteralDfa1_0(0x2002000000000L, 0x100000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x4002000000000L, 0x200000000000000L, 0x0L, 0x0L);
       case 111:
          return jjMoveStringLiteralDfa1_0(0x400c0000000L, 0x0L, 0x0L, 0x0L);
       case 112:
          return jjMoveStringLiteralDfa1_0(0x200000L, 0x0L, 0x0L, 0x0L);
       case 114:
-         return jjMoveStringLiteralDfa1_0(0x1000000L, 0x88a0000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x1000000L, 0x11140000000L, 0x0L, 0x0L);
       case 115:
-         return jjMoveStringLiteralDfa1_0(0xc420400000400000L, 0xe420f060401e0011L, 0x20003L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x8840400000400000L, 0xc841e0c0803c0023L, 0x40007L, 0x0L);
       case 116:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0xc0000000000000L, 0x100004L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x180000000000000L, 0x200008L, 0x0L);
       case 117:
-         return jjMoveStringLiteralDfa1_0(0x80400000000L, 0x200010000002000L, 0x1000000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x80400000000L, 0x400020000004000L, 0x2000000L, 0x0L);
       case 118:
-         return jjMoveStringLiteralDfa1_0(0x200000000L, 0x80000000000000eL, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x200000000L, 0x100000000000001cL, 0x0L, 0x0L);
       case 119:
-         return jjMoveStringLiteralDfa1_0(0x8000000000L, 0x0L, 0x800000L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x8000000000L, 0x0L, 0x1000000L, 0x0L);
       case 121:
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000L, 0x0L, 0x0L);
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000000000L, 0x0L, 0x0L);
       case 123:
-         jjmatchedKind = 174;
-         return jjMoveNfa_0(0, 0);
-      case 124:
-         jjmatchedKind = 202;
-         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x2L);
-      case 125:
          jjmatchedKind = 175;
          return jjMoveNfa_0(0, 0);
+      case 124:
+         jjmatchedKind = 203;
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x0L, 0x4L);
+      case 125:
+         jjmatchedKind = 176;
+         return jjMoveNfa_0(0, 0);
       case 126:
-         jjmatchedKind = 191;
+         jjmatchedKind = 192;
          return jjMoveNfa_0(0, 0);
       case 65279:
          jjmatchedKind = 9;
@@ -219,35 +219,30 @@
    switch(curChar)
    {
       case 38:
-         if ((active3 & 0x4L) != 0L)
+         if ((active3 & 0x8L) != 0L)
          {
-            jjmatchedKind = 194;
+            jjmatchedKind = 195;
             jjmatchedPos = 1;
          }
          break;
       case 45:
-         if ((active3 & 0x2000L) != 0L)
+         if ((active3 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 205;
+            jjmatchedKind = 206;
             jjmatchedPos = 1;
          }
          break;
       case 60:
-         if ((active2 & 0x2000000000000000L) != 0L)
+         if ((active2 & 0x4000000000000000L) != 0L)
          {
-            jjmatchedKind = 189;
+            jjmatchedKind = 190;
             jjmatchedPos = 1;
          }
          break;
       case 61:
-         if ((active2 & 0x80000000000000L) != 0L)
+         if ((active2 & 0x100000000000000L) != 0L)
          {
-            jjmatchedKind = 183;
-            jjmatchedPos = 1;
-         }
-         else if ((active2 & 0x400000000000000L) != 0L)
-         {
-            jjmatchedKind = 186;
+            jjmatchedKind = 184;
             jjmatchedPos = 1;
          }
          else if ((active2 & 0x800000000000000L) != 0L)
@@ -255,82 +250,87 @@
             jjmatchedKind = 187;
             jjmatchedPos = 1;
          }
-         else if ((active3 & 0x200L) != 0L)
-         {
-            jjmatchedKind = 201;
-            jjmatchedPos = 1;
-         }
-         break;
-      case 62:
-         if ((active2 & 0x1000000000000000L) != 0L)
+         else if ((active2 & 0x1000000000000000L) != 0L)
          {
             jjmatchedKind = 188;
             jjmatchedPos = 1;
          }
-         else if ((active3 & 0x1000L) != 0L)
+         else if ((active3 & 0x400L) != 0L)
          {
-            jjmatchedKind = 204;
+            jjmatchedKind = 202;
+            jjmatchedPos = 1;
+         }
+         break;
+      case 62:
+         if ((active2 & 0x2000000000000000L) != 0L)
+         {
+            jjmatchedKind = 189;
+            jjmatchedPos = 1;
+         }
+         else if ((active3 & 0x2000L) != 0L)
+         {
+            jjmatchedKind = 205;
             jjmatchedPos = 1;
          }
          break;
       case 65:
-         return jjMoveStringLiteralDfa2_0(active0, 0x210002200100000L, active1, 0x40000c0e0c01eL, active2, 0x18L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x420002200100000L, active1, 0x8000181c1803cL, active2, 0x30L, active3, 0L);
       case 66:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x100000000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000L, active2, 0L, active3, 0L);
       case 67:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x30000000000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x60000000000L, active2, 0L, active3, 0L);
       case 68:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1000000000000000L, active2, 0x2000L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000000L, active2, 0x4000L, active3, 0L);
       case 69:
-         return jjMoveStringLiteralDfa2_0(active0, 0x1020c01005400000L, active1, 0x821008220000000L, active2, 0x210040L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x2040c01005400000L, active1, 0x1042010440000000L, active2, 0x420080L, active3, 0L);
       case 70:
+         if ((active1 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 75;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x40000000L, active1, 0L, active2, 0L, active3, 0L);
+      case 71:
+         return jjMoveStringLiteralDfa2_0(active0, 0x80000000000000L, active1, 0L, active2, 0L, active3, 0L);
+      case 72:
+         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000L, active1, 0xc000000000040000L, active2, 0x7L, active3, 0L);
+      case 73:
+         return jjMoveStringLiteralDfa2_0(active0, 0x201300020800000L, active1, 0xa0000000000080L, active2, 0x1040000L, active3, 0L);
+      case 76:
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x800000000L, active2, 0x801000L, active3, 0L);
+      case 78:
          if ((active1 & 0x400L) != 0L)
          {
             jjmatchedKind = 74;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x40000000L, active1, 0L, active2, 0L, active3, 0L);
-      case 71:
-         return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L, active2, 0L, active3, 0L);
-      case 72:
-         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000L, active1, 0xe000000000020000L, active2, 0x3L, active3, 0L);
-      case 73:
-         return jjMoveStringLiteralDfa2_0(active0, 0x100300020800000L, active1, 0x50000000000040L, active2, 0x820000L, active3, 0L);
-      case 76:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x400000000L, active2, 0x400800L, active3, 0L);
-      case 78:
-         if ((active1 & 0x200L) != 0L)
-         {
-            jjmatchedKind = 73;
-            jjmatchedPos = 1;
-         }
-         return jjMoveStringLiteralDfa2_0(active0, 0x90400000000L, active1, 0x40000000800L, active2, 0x80020L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x90400000000L, active1, 0x80000001000L, active2, 0x100040L, active3, 0L);
       case 79:
-         if ((active2 & 0x100000L) != 0L)
+         if ((active2 & 0x200000L) != 0L)
          {
-            jjmatchedKind = 148;
+            jjmatchedKind = 149;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x2082000008000000L, active1, 0x10a081800000180L, active2, 0xc400L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x4104000008000000L, active1, 0x214103000000300L, active2, 0x18800L, active3, 0L);
       case 80:
          return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 82:
-         return jjMoveStringLiteralDfa2_0(active0, 0x8024080200000L, active1, 0x3020L, active2, 0x41004L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x10024080200000L, active1, 0x6040L, active2, 0x82008L, active3, 0L);
       case 83:
-         if ((active0 & 0x4000000000000L) != 0L)
+         if ((active0 & 0x8000000000000L) != 0L)
          {
-            jjmatchedKind = 50;
+            jjmatchedKind = 51;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x812000000L, active1, 0x1f000000L, active2, 0x1000000L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x812000000L, active1, 0x3e000000L, active2, 0x2000000L, active3, 0L);
       case 84:
-         return jjMoveStringLiteralDfa2_0(active0, 0xc000000000000000L, active1, 0x400f040001c0001L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000000L, active1, 0x801e08000380003L, active2, 0L, active3, 0L);
       case 85:
-         return jjMoveStringLiteralDfa2_0(active0, 0x400000000000000L, active1, 0x200002000010000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x800000000000000L, active1, 0x400004000020000L, active2, 0L, active3, 0L);
       case 86:
-         return jjMoveStringLiteralDfa2_0(active0, 0x800000000000000L, active1, 0L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 88:
-         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L, active1, 0L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 89:
          if ((active0 & 0x100000000L) != 0L)
          {
@@ -339,77 +339,77 @@
          }
          break;
       case 90:
-         if ((active1 & 0x80000000000000L) != 0L)
+         if ((active1 & 0x100000000000000L) != 0L)
          {
-            jjmatchedKind = 119;
+            jjmatchedKind = 120;
             jjmatchedPos = 1;
          }
          break;
       case 94:
-         if ((active3 & 0x80L) != 0L)
+         if ((active3 & 0x100L) != 0L)
          {
-            jjmatchedKind = 199;
+            jjmatchedKind = 200;
             jjmatchedPos = 1;
          }
          break;
       case 97:
-         return jjMoveStringLiteralDfa2_0(active0, 0x210002200100000L, active1, 0x40000c0e0c01eL, active2, 0x18L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x420002200100000L, active1, 0x8000181c1803cL, active2, 0x30L, active3, 0L);
       case 98:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x100000000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000L, active2, 0L, active3, 0L);
       case 99:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x30000000000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x60000000000L, active2, 0L, active3, 0L);
       case 100:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1000000000000000L, active2, 0x2000L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000000L, active2, 0x4000L, active3, 0L);
       case 101:
-         return jjMoveStringLiteralDfa2_0(active0, 0x1020c01005400000L, active1, 0x821008220000000L, active2, 0x210040L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x2040c01005400000L, active1, 0x1042010440000000L, active2, 0x420080L, active3, 0L);
       case 102:
+         if ((active1 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 75;
+            jjmatchedPos = 1;
+         }
+         return jjMoveStringLiteralDfa2_0(active0, 0x40000000L, active1, 0L, active2, 0L, active3, 0L);
+      case 103:
+         return jjMoveStringLiteralDfa2_0(active0, 0x80000000000000L, active1, 0L, active2, 0L, active3, 0L);
+      case 104:
+         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000L, active1, 0xc000000000040000L, active2, 0x7L, active3, 0L);
+      case 105:
+         return jjMoveStringLiteralDfa2_0(active0, 0x201300020800000L, active1, 0xa0000000000080L, active2, 0x1040000L, active3, 0L);
+      case 108:
+         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x800000000L, active2, 0x801000L, active3, 0L);
+      case 110:
          if ((active1 & 0x400L) != 0L)
          {
             jjmatchedKind = 74;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x40000000L, active1, 0L, active2, 0L, active3, 0L);
-      case 103:
-         return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L, active2, 0L, active3, 0L);
-      case 104:
-         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000L, active1, 0xe000000000020000L, active2, 0x3L, active3, 0L);
-      case 105:
-         return jjMoveStringLiteralDfa2_0(active0, 0x100300020800000L, active1, 0x50000000000040L, active2, 0x820000L, active3, 0L);
-      case 108:
-         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x400000000L, active2, 0x400800L, active3, 0L);
-      case 110:
-         if ((active1 & 0x200L) != 0L)
-         {
-            jjmatchedKind = 73;
-            jjmatchedPos = 1;
-         }
-         return jjMoveStringLiteralDfa2_0(active0, 0x90400000000L, active1, 0x40000000800L, active2, 0x80020L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x90400000000L, active1, 0x80000001000L, active2, 0x100040L, active3, 0L);
       case 111:
-         if ((active2 & 0x100000L) != 0L)
+         if ((active2 & 0x200000L) != 0L)
          {
-            jjmatchedKind = 148;
+            jjmatchedKind = 149;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x2082000008000000L, active1, 0x10a081800000180L, active2, 0xc400L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x4104000008000000L, active1, 0x214103000000300L, active2, 0x18800L, active3, 0L);
       case 112:
          return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 114:
-         return jjMoveStringLiteralDfa2_0(active0, 0x8024080200000L, active1, 0x3020L, active2, 0x41004L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x10024080200000L, active1, 0x6040L, active2, 0x82008L, active3, 0L);
       case 115:
-         if ((active0 & 0x4000000000000L) != 0L)
+         if ((active0 & 0x8000000000000L) != 0L)
          {
-            jjmatchedKind = 50;
+            jjmatchedKind = 51;
             jjmatchedPos = 1;
          }
-         return jjMoveStringLiteralDfa2_0(active0, 0x812000000L, active1, 0x1f000000L, active2, 0x1000000L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x812000000L, active1, 0x3e000000L, active2, 0x2000000L, active3, 0L);
       case 116:
-         return jjMoveStringLiteralDfa2_0(active0, 0xc000000000000000L, active1, 0x400f040001c0001L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000000L, active1, 0x801e08000380003L, active2, 0L, active3, 0L);
       case 117:
-         return jjMoveStringLiteralDfa2_0(active0, 0x400000000000000L, active1, 0x200002000010000L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x800000000000000L, active1, 0x400004000020000L, active2, 0L, active3, 0L);
       case 118:
-         return jjMoveStringLiteralDfa2_0(active0, 0x800000000000000L, active1, 0L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 120:
-         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000L, active1, 0L, active2, 0L, active3, 0L);
+         return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L, active2, 0L, active3, 0L);
       case 121:
          if ((active0 & 0x100000000L) != 0L)
          {
@@ -418,16 +418,16 @@
          }
          break;
       case 122:
-         if ((active1 & 0x80000000000000L) != 0L)
+         if ((active1 & 0x100000000000000L) != 0L)
          {
-            jjmatchedKind = 119;
+            jjmatchedKind = 120;
             jjmatchedPos = 1;
          }
          break;
       case 124:
-         if ((active3 & 0x2L) != 0L)
+         if ((active3 & 0x4L) != 0L)
          {
-            jjmatchedKind = 193;
+            jjmatchedKind = 194;
             jjmatchedPos = 1;
          }
          break;
@@ -446,63 +446,63 @@
    switch(curChar)
    {
       case 53:
-         if ((active1 & 0x1000000000000000L) != 0L)
+         if ((active1 & 0x2000000000000000L) != 0L)
          {
-            jjmatchedKind = 124;
+            jjmatchedKind = 125;
             jjmatchedPos = 2;
          }
          break;
       case 65:
-         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L, active1, 0xe001030000000100L, active2, 0x403L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L, active1, 0xc002060000000200L, active2, 0x807L);
       case 66:
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2004000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x4008000000L, active2, 0L);
       case 67:
          if ((active0 & 0x800000000L) != 0L)
          {
             jjmatchedKind = 35;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x20040000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40080000000000L, active2, 0L);
       case 68:
          if ((active0 & 0x10000000000L) != 0L)
          {
             jjmatchedKind = 40;
             jjmatchedPos = 2;
          }
-         else if ((active2 & 0x2000L) != 0L)
+         else if ((active2 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 141;
+            jjmatchedKind = 142;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0xf000000481000000L, active1, 0x1L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0xe000000481000000L, active1, 0x3L, active2, 0L);
       case 69:
-         return jjMoveStringLiteralDfa3_0(active0, 0x8000200000L, active1, 0L, active2, 0x1800L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x8000200000L, active1, 0L, active2, 0x3000L);
       case 70:
-         return jjMoveStringLiteralDfa3_0(active0, 0x40000000L, active1, 0L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000L, active1, 0L, active2, 0x400000L);
       case 71:
-         if ((active0 & 0x40000000000000L) != 0L)
+         if ((active0 & 0x80000000000000L) != 0L)
          {
-            jjmatchedKind = 54;
+            jjmatchedKind = 55;
             jjmatchedPos = 2;
          }
-         else if ((active0 & 0x800000000000000L) != 0L)
+         else if ((active0 & 0x1000000000000000L) != 0L)
          {
-            jjmatchedKind = 59;
+            jjmatchedKind = 60;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x20000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40000000L, active2, 0L);
       case 73:
-         if ((active1 & 0x1000L) != 0L)
-         {
-            jjmatchedKind = 76;
-            jjmatchedPos = 2;
-         }
-         else if ((active1 & 0x2000L) != 0L)
+         if ((active1 & 0x2000L) != 0L)
          {
             jjmatchedKind = 77;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x1080000000000L, active1, 0x200000202000000L, active2, 0x1000000L);
+         else if ((active1 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 78;
+            jjmatchedPos = 2;
+         }
+         return jjMoveStringLiteralDfa3_0(active0, 0x2080000000000L, active1, 0x400000404000000L, active2, 0x2000000L);
       case 75:
          if ((active0 & 0x10000000L) != 0L)
          {
@@ -511,132 +511,132 @@
          }
          break;
       case 76:
-         if ((active2 & 0x400000L) != 0L)
+         if ((active2 & 0x800000L) != 0L)
          {
-            jjmatchedKind = 150;
+            jjmatchedKind = 151;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x200400000L, active1, 0x8018040L, active2, 0x20048L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x200400000L, active1, 0x10030080L, active2, 0x40090L);
       case 77:
-         if ((active0 & 0x400000000000000L) != 0L)
+         if ((active0 & 0x800000000000000L) != 0L)
          {
-            jjmatchedKind = 58;
+            jjmatchedKind = 59;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x2020000000L, active1, 0x40000040000010L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x2020000000L, active1, 0x80000080000020L, active2, 0L);
       case 78:
-         if ((active0 & 0x100000000000000L) != 0L)
+         if ((active0 & 0x200000000000000L) != 0L)
          {
-            jjmatchedKind = 56;
+            jjmatchedKind = 57;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x300008000000L, active1, 0x12081090c00000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x1300008000000L, active1, 0x24102121800000L, active2, 0L);
       case 79:
-         return jjMoveStringLiteralDfa3_0(active0, 0x8004002000000L, active1, 0x400020820L, active2, 0x40000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x10004002000000L, active1, 0x800041040L, active2, 0x80000L);
       case 80:
-         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0x8000000000L, active2, 0x8000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L, active1, 0x10000000000L, active2, 0x10000L);
       case 82:
-         if ((active1 & 0x40000L) != 0L)
+         if ((active1 & 0x80000L) != 0L)
          {
-            jjmatchedKind = 82;
+            jjmatchedKind = 83;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0xc00f0400018000eL, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0x1801e0800030001cL, active2, 0L);
       case 83:
-         if ((active1 & 0x100000000L) != 0L)
+         if ((active1 & 0x200000000L) != 0L)
          {
-            jjmatchedKind = 96;
+            jjmatchedKind = 97;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x1004900000L, active1, 0x4000L, active2, 0x20L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x1004900000L, active1, 0x8000L, active2, 0x40L);
       case 84:
          if ((active0 & 0x800000000000L) != 0L)
          {
             jjmatchedKind = 47;
             jjmatchedPos = 2;
          }
-         else if ((active0 & 0x2000000000000L) != 0L)
+         else if ((active0 & 0x4000000000000L) != 0L)
          {
-            jjmatchedKind = 49;
+            jjmatchedKind = 50;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L, active1, 0x200000L, active2, 0x890010L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L, active1, 0x400000L, active2, 0x1120020L);
       case 85:
-         return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0x8000801000080L, active2, 0x4L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L, active1, 0x10001002000100L, active2, 0x8L);
       case 86:
-         return jjMoveStringLiteralDfa3_0(active0, 0x10000000000000L, active1, 0L, active2, 0x4000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0L, active2, 0x8000L);
       case 87:
-         if ((active1 & 0x100000000000000L) != 0L)
+         if ((active1 & 0x200000000000000L) != 0L)
          {
-            jjmatchedKind = 120;
+            jjmatchedKind = 121;
             jjmatchedPos = 2;
          }
          break;
       case 88:
-         if ((active0 & 0x200000000000000L) != 0L)
+         if ((active0 & 0x400000000000000L) != 0L)
          {
-            jjmatchedKind = 57;
+            jjmatchedKind = 58;
             jjmatchedPos = 2;
          }
          break;
       case 89:
-         if ((active1 & 0x4000000000000L) != 0L)
+         if ((active1 & 0x8000000000000L) != 0L)
          {
-            jjmatchedKind = 114;
+            jjmatchedKind = 115;
             jjmatchedPos = 2;
          }
          break;
       case 97:
-         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L, active1, 0xe001030000000100L, active2, 0x403L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L, active1, 0xc002060000000200L, active2, 0x807L);
       case 98:
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2004000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x4008000000L, active2, 0L);
       case 99:
          if ((active0 & 0x800000000L) != 0L)
          {
             jjmatchedKind = 35;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x20040000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40080000000000L, active2, 0L);
       case 100:
          if ((active0 & 0x10000000000L) != 0L)
          {
             jjmatchedKind = 40;
             jjmatchedPos = 2;
          }
-         else if ((active2 & 0x2000L) != 0L)
+         else if ((active2 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 141;
+            jjmatchedKind = 142;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0xf000000481000000L, active1, 0x1L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0xe000000481000000L, active1, 0x3L, active2, 0L);
       case 101:
-         return jjMoveStringLiteralDfa3_0(active0, 0x8000200000L, active1, 0L, active2, 0x1800L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x8000200000L, active1, 0L, active2, 0x3000L);
       case 102:
-         return jjMoveStringLiteralDfa3_0(active0, 0x40000000L, active1, 0L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000L, active1, 0L, active2, 0x400000L);
       case 103:
-         if ((active0 & 0x40000000000000L) != 0L)
+         if ((active0 & 0x80000000000000L) != 0L)
          {
-            jjmatchedKind = 54;
+            jjmatchedKind = 55;
             jjmatchedPos = 2;
          }
-         else if ((active0 & 0x800000000000000L) != 0L)
+         else if ((active0 & 0x1000000000000000L) != 0L)
          {
-            jjmatchedKind = 59;
+            jjmatchedKind = 60;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x20000000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40000000L, active2, 0L);
       case 105:
-         if ((active1 & 0x1000L) != 0L)
-         {
-            jjmatchedKind = 76;
-            jjmatchedPos = 2;
-         }
-         else if ((active1 & 0x2000L) != 0L)
+         if ((active1 & 0x2000L) != 0L)
          {
             jjmatchedKind = 77;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x1080000000000L, active1, 0x200000202000000L, active2, 0x1000000L);
+         else if ((active1 & 0x4000L) != 0L)
+         {
+            jjmatchedKind = 78;
+            jjmatchedPos = 2;
+         }
+         return jjMoveStringLiteralDfa3_0(active0, 0x2080000000000L, active1, 0x400000404000000L, active2, 0x2000000L);
       case 107:
          if ((active0 & 0x10000000L) != 0L)
          {
@@ -645,78 +645,78 @@
          }
          break;
       case 108:
-         if ((active2 & 0x400000L) != 0L)
+         if ((active2 & 0x800000L) != 0L)
          {
-            jjmatchedKind = 150;
+            jjmatchedKind = 151;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x200400000L, active1, 0x8018040L, active2, 0x20048L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x200400000L, active1, 0x10030080L, active2, 0x40090L);
       case 109:
-         if ((active0 & 0x400000000000000L) != 0L)
+         if ((active0 & 0x800000000000000L) != 0L)
          {
-            jjmatchedKind = 58;
+            jjmatchedKind = 59;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x2020000000L, active1, 0x40000040000010L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x2020000000L, active1, 0x80000080000020L, active2, 0L);
       case 110:
-         if ((active0 & 0x100000000000000L) != 0L)
+         if ((active0 & 0x200000000000000L) != 0L)
          {
-            jjmatchedKind = 56;
+            jjmatchedKind = 57;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x300008000000L, active1, 0x12081090c00000L, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x1300008000000L, active1, 0x24102121800000L, active2, 0L);
       case 111:
-         return jjMoveStringLiteralDfa3_0(active0, 0x8004002000000L, active1, 0x400020820L, active2, 0x40000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x10004002000000L, active1, 0x800041040L, active2, 0x80000L);
       case 112:
-         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0x8000000000L, active2, 0x8000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000000L, active1, 0x10000000000L, active2, 0x10000L);
       case 114:
-         if ((active1 & 0x40000L) != 0L)
+         if ((active1 & 0x80000L) != 0L)
          {
-            jjmatchedKind = 82;
+            jjmatchedKind = 83;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0xc00f0400018000eL, active2, 0L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0x1801e0800030001cL, active2, 0L);
       case 115:
-         if ((active1 & 0x100000000L) != 0L)
+         if ((active1 & 0x200000000L) != 0L)
          {
-            jjmatchedKind = 96;
+            jjmatchedKind = 97;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x1004900000L, active1, 0x4000L, active2, 0x20L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x1004900000L, active1, 0x8000L, active2, 0x40L);
       case 116:
          if ((active0 & 0x800000000000L) != 0L)
          {
             jjmatchedKind = 47;
             jjmatchedPos = 2;
          }
-         else if ((active0 & 0x2000000000000L) != 0L)
+         else if ((active0 & 0x4000000000000L) != 0L)
          {
-            jjmatchedKind = 49;
+            jjmatchedKind = 50;
             jjmatchedPos = 2;
          }
-         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L, active1, 0x200000L, active2, 0x890010L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L, active1, 0x400000L, active2, 0x1120020L);
       case 117:
-         return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0x8000801000080L, active2, 0x4L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L, active1, 0x10001002000100L, active2, 0x8L);
       case 118:
-         return jjMoveStringLiteralDfa3_0(active0, 0x10000000000000L, active1, 0L, active2, 0x4000L);
+         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0L, active2, 0x8000L);
       case 119:
-         if ((active1 & 0x100000000000000L) != 0L)
+         if ((active1 & 0x200000000000000L) != 0L)
          {
-            jjmatchedKind = 120;
+            jjmatchedKind = 121;
             jjmatchedPos = 2;
          }
          break;
       case 120:
-         if ((active0 & 0x200000000000000L) != 0L)
+         if ((active0 & 0x400000000000000L) != 0L)
          {
-            jjmatchedKind = 57;
+            jjmatchedKind = 58;
             jjmatchedPos = 2;
          }
          break;
       case 121:
-         if ((active1 & 0x4000000000000L) != 0L)
+         if ((active1 & 0x8000000000000L) != 0L)
          {
-            jjmatchedKind = 114;
+            jjmatchedKind = 115;
             jjmatchedPos = 2;
          }
          break;
@@ -735,113 +735,118 @@
    switch(curChar)
    {
       case 49:
-         if ((active1 & 0x2000000000000000L) != 0L)
+         if ((active1 & 0x4000000000000000L) != 0L)
          {
-            jjmatchedKind = 125;
+            jjmatchedKind = 126;
             jjmatchedPos = 3;
          }
          break;
       case 50:
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0xc000000000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x8000000000000000L, active2, 0x1L);
       case 51:
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0L, active2, 0x1L);
-      case 53:
          return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0L, active2, 0x2L);
+      case 53:
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0L, active2, 0x4L);
       case 65:
-         if ((active2 & 0x10L) != 0L)
+         if ((active2 & 0x20L) != 0L)
          {
-            jjmatchedKind = 132;
+            jjmatchedKind = 133;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x10000L) != 0L)
+         else if ((active2 & 0x20000L) != 0L)
          {
-            jjmatchedKind = 144;
+            jjmatchedKind = 145;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0x800000200000L, active2, 0x201800L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x40000000000000L, active1, 0x1000000400000L, active2, 0x403000L);
       case 66:
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 67:
          if ((active0 & 0x1000000000L) != 0L)
          {
             jjmatchedKind = 36;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0x1000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0x2000000000L, active2, 0L);
       case 68:
          if ((active0 & 0x200000000000L) != 0L)
          {
             jjmatchedKind = 45;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x80000000L) != 0L)
+         else if ((active0 & 0x1000000000000L) != 0L)
          {
-            jjmatchedKind = 95;
+            jjmatchedKind = 48;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x200000000000000L) != 0L)
+         else if ((active1 & 0x100000000L) != 0L)
          {
-            jjmatchedKind = 121;
+            jjmatchedKind = 96;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x400L) != 0L)
+         else if ((active1 & 0x400000000000000L) != 0L)
          {
-            jjmatchedKind = 138;
+            jjmatchedKind = 122;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100800L, active2, 0L);
+         else if ((active2 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 139;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x201000L, active2, 0L);
       case 69:
          if ((active0 & 0x100000L) != 0L)
          {
             jjmatchedKind = 20;
             jjmatchedPos = 3;
          }
-         else if ((active0 & 0x2000000000000000L) != 0L)
+         else if ((active0 & 0x4000000000000000L) != 0L)
          {
-            jjmatchedKind = 61;
+            jjmatchedKind = 62;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x4L) != 0L)
+         else if ((active2 & 0x8L) != 0L)
          {
-            jjmatchedKind = 130;
+            jjmatchedKind = 131;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x4000L) != 0L)
+         else if ((active2 & 0x8000L) != 0L)
          {
-            jjmatchedKind = 142;
+            jjmatchedKind = 143;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0xc000002480400000L, active1, 0x40200060000001L, active2, 0x20060L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000002480400000L, active1, 0x804000c0000003L, active2, 0x400c0L);
       case 70:
          return jjMoveStringLiteralDfa4_0(active0, 0x200000L, active1, 0L, active2, 0L);
       case 71:
-         if ((active1 & 0x400000L) != 0L)
+         if ((active1 & 0x800000L) != 0L)
          {
-            jjmatchedKind = 86;
+            jjmatchedKind = 87;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x1000000L, active2, 0L);
       case 72:
-         if ((active2 & 0x800000L) != 0L)
+         if ((active2 & 0x1000000L) != 0L)
          {
-            jjmatchedKind = 151;
+            jjmatchedKind = 152;
             jjmatchedPos = 3;
          }
          break;
       case 73:
-         return jjMoveStringLiteralDfa4_0(active0, 0x1010040020000000L, active1, 0x8000002L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x2020040020000000L, active1, 0x10000004L, active2, 0L);
       case 76:
-         if ((active1 & 0x8000L) != 0L)
+         if ((active1 & 0x10000L) != 0L)
          {
-            jjmatchedKind = 79;
+            jjmatchedKind = 80;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x200000000L) != 0L)
+         else if ((active1 & 0x400000000L) != 0L)
          {
-            jjmatchedKind = 97;
+            jjmatchedKind = 98;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0xc004080100L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x18008100200L, active2, 0L);
       case 77:
          if ((active0 & 0x4000000000L) != 0L)
          {
@@ -855,145 +860,150 @@
             jjmatchedKind = 25;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000000L, active1, 0x800000080L, active2, 0x1000000L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x100000000000000L, active1, 0x1000000100L, active2, 0x2000000L);
       case 79:
+         if ((active2 & 0x100000L) != 0L)
+         {
+            jjmatchedKind = 148;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x40080800000000L, active2, 0L);
+      case 80:
          if ((active2 & 0x80000L) != 0L)
          {
             jjmatchedKind = 147;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x20040400000000L, active2, 0L);
-      case 80:
-         if ((active2 & 0x40000L) != 0L)
-         {
-            jjmatchedKind = 146;
-            jjmatchedPos = 3;
-         }
-         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L, active1, 0x10L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L, active1, 0x20L, active2, 0L);
       case 82:
-         if ((active1 & 0x1000000000000L) != 0L)
+         if ((active1 & 0x2000000000000L) != 0L)
          {
-            jjmatchedKind = 112;
+            jjmatchedKind = 113;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0x8000003020000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0x10000006040000L, active2, 0L);
       case 83:
-         return jjMoveStringLiteralDfa4_0(active0, 0x1000048000000L, active1, 0x800132000000000L, active2, 0x8L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000048000000L, active1, 0x1000264000000000L, active2, 0x10L);
       case 84:
-         if ((active1 & 0x4000L) != 0L)
+         if ((active1 & 0x8000L) != 0L)
          {
-            jjmatchedKind = 78;
+            jjmatchedKind = 79;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x800000L, active1, 0x2080000010040L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x800000L, active1, 0x4100000020080L, active2, 0L);
       case 85:
-         return jjMoveStringLiteralDfa4_0(active0, 0x8100201000000L, active1, 0x410000010000020L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x10100201000000L, active1, 0x820000020000040L, active2, 0L);
       case 86:
          return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L, active2, 0L);
       case 89:
-         if ((active2 & 0x8000L) != 0L)
-         {
-            jjmatchedKind = 143;
-            jjmatchedPos = 3;
-         }
-         break;
-      case 95:
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0xcL, active2, 0L);
-      case 97:
-         if ((active2 & 0x10L) != 0L)
-         {
-            jjmatchedKind = 132;
-            jjmatchedPos = 3;
-         }
-         else if ((active2 & 0x10000L) != 0L)
+         if ((active2 & 0x10000L) != 0L)
          {
             jjmatchedKind = 144;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0x800000200000L, active2, 0x201800L);
+         break;
+      case 95:
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x18L, active2, 0L);
+      case 97:
+         if ((active2 & 0x20L) != 0L)
+         {
+            jjmatchedKind = 133;
+            jjmatchedPos = 3;
+         }
+         else if ((active2 & 0x20000L) != 0L)
+         {
+            jjmatchedKind = 145;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0x40000000000000L, active1, 0x1000000400000L, active2, 0x403000L);
       case 98:
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 99:
          if ((active0 & 0x1000000000L) != 0L)
          {
             jjmatchedKind = 36;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0x1000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0x2000000000L, active2, 0L);
       case 100:
          if ((active0 & 0x200000000000L) != 0L)
          {
             jjmatchedKind = 45;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x80000000L) != 0L)
+         else if ((active0 & 0x1000000000000L) != 0L)
          {
-            jjmatchedKind = 95;
+            jjmatchedKind = 48;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x200000000000000L) != 0L)
+         else if ((active1 & 0x100000000L) != 0L)
          {
-            jjmatchedKind = 121;
+            jjmatchedKind = 96;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x400L) != 0L)
+         else if ((active1 & 0x400000000000000L) != 0L)
          {
-            jjmatchedKind = 138;
+            jjmatchedKind = 122;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x100800L, active2, 0L);
+         else if ((active2 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 139;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x201000L, active2, 0L);
       case 101:
          if ((active0 & 0x100000L) != 0L)
          {
             jjmatchedKind = 20;
             jjmatchedPos = 3;
          }
-         else if ((active0 & 0x2000000000000000L) != 0L)
+         else if ((active0 & 0x4000000000000000L) != 0L)
          {
-            jjmatchedKind = 61;
+            jjmatchedKind = 62;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x4L) != 0L)
+         else if ((active2 & 0x8L) != 0L)
          {
-            jjmatchedKind = 130;
+            jjmatchedKind = 131;
             jjmatchedPos = 3;
          }
-         else if ((active2 & 0x4000L) != 0L)
+         else if ((active2 & 0x8000L) != 0L)
          {
-            jjmatchedKind = 142;
+            jjmatchedKind = 143;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0xc000002480400000L, active1, 0x40200060000001L, active2, 0x20060L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000002480400000L, active1, 0x804000c0000003L, active2, 0x400c0L);
       case 102:
          return jjMoveStringLiteralDfa4_0(active0, 0x200000L, active1, 0L, active2, 0L);
       case 103:
-         if ((active1 & 0x400000L) != 0L)
+         if ((active1 & 0x800000L) != 0L)
          {
-            jjmatchedKind = 86;
+            jjmatchedKind = 87;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x800000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x1000000L, active2, 0L);
       case 104:
-         if ((active2 & 0x800000L) != 0L)
+         if ((active2 & 0x1000000L) != 0L)
          {
-            jjmatchedKind = 151;
+            jjmatchedKind = 152;
             jjmatchedPos = 3;
          }
          break;
       case 105:
-         return jjMoveStringLiteralDfa4_0(active0, 0x1010040020000000L, active1, 0x8000002L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x2020040020000000L, active1, 0x10000004L, active2, 0L);
       case 108:
-         if ((active1 & 0x8000L) != 0L)
+         if ((active1 & 0x10000L) != 0L)
          {
-            jjmatchedKind = 79;
+            jjmatchedKind = 80;
             jjmatchedPos = 3;
          }
-         else if ((active1 & 0x200000000L) != 0L)
+         else if ((active1 & 0x400000000L) != 0L)
          {
-            jjmatchedKind = 97;
+            jjmatchedKind = 98;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0xc004080100L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x18008100200L, active2, 0L);
       case 109:
          if ((active0 & 0x4000000000L) != 0L)
          {
@@ -1007,45 +1017,45 @@
             jjmatchedKind = 25;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000000L, active1, 0x800000080L, active2, 0x1000000L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x100000000000000L, active1, 0x1000000100L, active2, 0x2000000L);
       case 111:
+         if ((active2 & 0x100000L) != 0L)
+         {
+            jjmatchedKind = 148;
+            jjmatchedPos = 3;
+         }
+         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x40080800000000L, active2, 0L);
+      case 112:
          if ((active2 & 0x80000L) != 0L)
          {
             jjmatchedKind = 147;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0x20040400000000L, active2, 0L);
-      case 112:
-         if ((active2 & 0x40000L) != 0L)
-         {
-            jjmatchedKind = 146;
-            jjmatchedPos = 3;
-         }
-         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L, active1, 0x10L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000L, active1, 0x20L, active2, 0L);
       case 114:
-         if ((active1 & 0x1000000000000L) != 0L)
+         if ((active1 & 0x2000000000000L) != 0L)
          {
-            jjmatchedKind = 112;
+            jjmatchedKind = 113;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0x8000003020000L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L, active1, 0x10000006040000L, active2, 0L);
       case 115:
-         return jjMoveStringLiteralDfa4_0(active0, 0x1000048000000L, active1, 0x800132000000000L, active2, 0x8L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000048000000L, active1, 0x1000264000000000L, active2, 0x10L);
       case 116:
-         if ((active1 & 0x4000L) != 0L)
+         if ((active1 & 0x8000L) != 0L)
          {
-            jjmatchedKind = 78;
+            jjmatchedKind = 79;
             jjmatchedPos = 3;
          }
-         return jjMoveStringLiteralDfa4_0(active0, 0x800000L, active1, 0x2080000010040L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x800000L, active1, 0x4100000020080L, active2, 0L);
       case 117:
-         return jjMoveStringLiteralDfa4_0(active0, 0x8100201000000L, active1, 0x410000010000020L, active2, 0L);
+         return jjMoveStringLiteralDfa4_0(active0, 0x10100201000000L, active1, 0x820000020000040L, active2, 0L);
       case 118:
          return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L, active2, 0L);
       case 121:
-         if ((active2 & 0x8000L) != 0L)
+         if ((active2 & 0x10000L) != 0L)
          {
-            jjmatchedKind = 143;
+            jjmatchedKind = 144;
             jjmatchedPos = 3;
          }
          break;
@@ -1064,15 +1074,15 @@
    switch(curChar)
    {
       case 49:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0L, active2, 0x2L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0L, active2, 0x4L);
       case 50:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4000000000000000L, active2, 0L);
-      case 53:
          return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8000000000000000L, active2, 0L);
-      case 56:
+      case 53:
          return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0L, active2, 0x1L);
+      case 56:
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0L, active2, 0x2L);
       case 65:
-         return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0x89004080002L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000000L, active1, 0x112008100004L, active2, 0L);
       case 67:
          return jjMoveStringLiteralDfa5_0(active0, 0x1400000L, active1, 0L, active2, 0L);
       case 68:
@@ -1081,31 +1091,26 @@
             jjmatchedKind = 37;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x80L) != 0L)
+         else if ((active1 & 0x100L) != 0L)
          {
-            jjmatchedKind = 71;
+            jjmatchedKind = 72;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x800000000L) != 0L)
+         else if ((active1 & 0x1000000000L) != 0L)
          {
-            jjmatchedKind = 99;
+            jjmatchedKind = 100;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x40000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000000000L, active2, 0L);
       case 69:
          if ((active0 & 0x8000000000L) != 0L)
          {
             jjmatchedKind = 39;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x800L) != 0L)
+         else if ((active1 & 0x1000L) != 0L)
          {
-            jjmatchedKind = 75;
-            jjmatchedPos = 4;
-         }
-         else if ((active1 & 0x10000000000L) != 0L)
-         {
-            jjmatchedKind = 104;
+            jjmatchedKind = 76;
             jjmatchedPos = 4;
          }
          else if ((active1 & 0x20000000000L) != 0L)
@@ -1113,23 +1118,28 @@
             jjmatchedKind = 105;
             jjmatchedPos = 4;
          }
-         else if ((active2 & 0x8L) != 0L)
+         else if ((active1 & 0x40000000000L) != 0L)
          {
-            jjmatchedKind = 131;
+            jjmatchedKind = 106;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x240000000L, active1, 0x404000000140L, active2, 0L);
+         else if ((active2 & 0x10L) != 0L)
+         {
+            jjmatchedKind = 132;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x240000000L, active1, 0x808000000280L, active2, 0L);
       case 70:
          if ((active0 & 0x400000000L) != 0L)
          {
             jjmatchedKind = 34;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 71:
-         if ((active2 & 0x1000000L) != 0L)
+         if ((active2 & 0x2000000L) != 0L)
          {
-            jjmatchedKind = 152;
+            jjmatchedKind = 153;
             jjmatchedPos = 4;
          }
          break;
@@ -1139,21 +1149,16 @@
             jjmatchedKind = 41;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x2000000000000L) != 0L)
+         else if ((active1 & 0x4000000000000L) != 0L)
          {
-            jjmatchedKind = 113;
+            jjmatchedKind = 114;
             jjmatchedPos = 4;
          }
          break;
       case 73:
-         if ((active1 & 0x10000L) != 0L)
+         if ((active1 & 0x20000L) != 0L)
          {
-            jjmatchedKind = 80;
-            jjmatchedPos = 4;
-         }
-         else if ((active1 & 0x1000000L) != 0L)
-         {
-            jjmatchedKind = 88;
+            jjmatchedKind = 81;
             jjmatchedPos = 4;
          }
          else if ((active1 & 0x2000000L) != 0L)
@@ -1161,93 +1166,98 @@
             jjmatchedKind = 89;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x400000a00000L, active1, 0x800000000000000L, active2, 0L);
+         else if ((active1 & 0x4000000L) != 0L)
+         {
+            jjmatchedKind = 90;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x400000a00000L, active1, 0x1000000000000000L, active2, 0L);
       case 76:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x20L, active2, 0L);
       case 77:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10800000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x21000000L, active2, 0L);
       case 78:
          if ((active0 & 0x80000000000L) != 0L)
          {
             jjmatchedKind = 43;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x10000000000000L, active1, 0x20200000000000L, active2, 0x20000L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L, active1, 0x40400000000000L, active2, 0x40000L);
       case 79:
          return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L, active2, 0L);
       case 80:
-         if ((active0 & 0x8000000000000L) != 0L)
+         if ((active0 & 0x10000000000000L) != 0L)
          {
-            jjmatchedKind = 51;
+            jjmatchedKind = 52;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x28L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x50L, active2, 0L);
       case 82:
          if ((active0 & 0x80000000L) != 0L)
          {
             jjmatchedKind = 31;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x400000000L) != 0L)
+         else if ((active1 & 0x800000000L) != 0L)
          {
-            jjmatchedKind = 98;
+            jjmatchedKind = 99;
             jjmatchedPos = 4;
          }
-         else if ((active2 & 0x800L) != 0L)
+         else if ((active2 & 0x1000L) != 0L)
          {
-            jjmatchedKind = 139;
+            jjmatchedKind = 140;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x20000004000000L, active1, 0L, active2, 0x20L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000004000000L, active1, 0L, active2, 0x40L);
       case 83:
          if ((active0 & 0x100000000000L) != 0L)
          {
             jjmatchedKind = 44;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x8000000000000L) != 0L)
+         else if ((active1 & 0x10000000000000L) != 0L)
          {
-            jjmatchedKind = 115;
+            jjmatchedKind = 116;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8L, active2, 0L);
       case 84:
          if ((active0 & 0x20000000L) != 0L)
          {
             jjmatchedKind = 29;
             jjmatchedPos = 4;
          }
-         else if ((active0 & 0x80000000000000L) != 0L)
+         else if ((active0 & 0x100000000000000L) != 0L)
          {
-            jjmatchedKind = 55;
+            jjmatchedKind = 56;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x100000L) != 0L)
+         else if ((active1 & 0x200000L) != 0L)
          {
-            jjmatchedKind = 84;
+            jjmatchedKind = 85;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x1000008000000L, active1, 0x10102048220000L, active2, 0x1040L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000008000000L, active1, 0x20204090440000L, active2, 0x2080L);
       case 85:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x400000000000000L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x800000000000000L, active2, 0x400000L);
       case 86:
-         if ((active0 & 0x4000000000000000L) != 0L)
+         if ((active0 & 0x8000000000000000L) != 0L)
          {
-            jjmatchedKind = 62;
+            jjmatchedKind = 63;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0x1L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x3L, active2, 0L);
       case 88:
-         if ((active1 & 0x20000000L) != 0L)
+         if ((active1 & 0x40000000L) != 0L)
          {
-            jjmatchedKind = 93;
+            jjmatchedKind = 94;
             jjmatchedPos = 4;
          }
          break;
       case 90:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x40000000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000000000000L, active2, 0L);
       case 97:
-         return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0x89004080002L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000000L, active1, 0x112008100004L, active2, 0L);
       case 99:
          return jjMoveStringLiteralDfa5_0(active0, 0x1400000L, active1, 0L, active2, 0L);
       case 100:
@@ -1256,31 +1266,26 @@
             jjmatchedKind = 37;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x80L) != 0L)
+         else if ((active1 & 0x100L) != 0L)
          {
-            jjmatchedKind = 71;
+            jjmatchedKind = 72;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x800000000L) != 0L)
+         else if ((active1 & 0x1000000000L) != 0L)
          {
-            jjmatchedKind = 99;
+            jjmatchedKind = 100;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x40000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000000000L, active2, 0L);
       case 101:
          if ((active0 & 0x8000000000L) != 0L)
          {
             jjmatchedKind = 39;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x800L) != 0L)
+         else if ((active1 & 0x1000L) != 0L)
          {
-            jjmatchedKind = 75;
-            jjmatchedPos = 4;
-         }
-         else if ((active1 & 0x10000000000L) != 0L)
-         {
-            jjmatchedKind = 104;
+            jjmatchedKind = 76;
             jjmatchedPos = 4;
          }
          else if ((active1 & 0x20000000000L) != 0L)
@@ -1288,23 +1293,28 @@
             jjmatchedKind = 105;
             jjmatchedPos = 4;
          }
-         else if ((active2 & 0x8L) != 0L)
+         else if ((active1 & 0x40000000000L) != 0L)
          {
-            jjmatchedKind = 131;
+            jjmatchedKind = 106;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x240000000L, active1, 0x404000000140L, active2, 0L);
+         else if ((active2 & 0x10L) != 0L)
+         {
+            jjmatchedKind = 132;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x240000000L, active1, 0x808000000280L, active2, 0L);
       case 102:
          if ((active0 & 0x400000000L) != 0L)
          {
             jjmatchedKind = 34;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 103:
-         if ((active2 & 0x1000000L) != 0L)
+         if ((active2 & 0x2000000L) != 0L)
          {
-            jjmatchedKind = 152;
+            jjmatchedKind = 153;
             jjmatchedPos = 4;
          }
          break;
@@ -1314,21 +1324,16 @@
             jjmatchedKind = 41;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x2000000000000L) != 0L)
+         else if ((active1 & 0x4000000000000L) != 0L)
          {
-            jjmatchedKind = 113;
+            jjmatchedKind = 114;
             jjmatchedPos = 4;
          }
          break;
       case 105:
-         if ((active1 & 0x10000L) != 0L)
+         if ((active1 & 0x20000L) != 0L)
          {
-            jjmatchedKind = 80;
-            jjmatchedPos = 4;
-         }
-         else if ((active1 & 0x1000000L) != 0L)
-         {
-            jjmatchedKind = 88;
+            jjmatchedKind = 81;
             jjmatchedPos = 4;
          }
          else if ((active1 & 0x2000000L) != 0L)
@@ -1336,91 +1341,96 @@
             jjmatchedKind = 89;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x400000a00000L, active1, 0x800000000000000L, active2, 0L);
+         else if ((active1 & 0x4000000L) != 0L)
+         {
+            jjmatchedKind = 90;
+            jjmatchedPos = 4;
+         }
+         return jjMoveStringLiteralDfa5_0(active0, 0x400000a00000L, active1, 0x1000000000000000L, active2, 0L);
       case 108:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x20L, active2, 0L);
       case 109:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10800000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x21000000L, active2, 0L);
       case 110:
          if ((active0 & 0x80000000000L) != 0L)
          {
             jjmatchedKind = 43;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x10000000000000L, active1, 0x20200000000000L, active2, 0x20000L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L, active1, 0x40400000000000L, active2, 0x40000L);
       case 111:
          return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L, active2, 0L);
       case 112:
-         if ((active0 & 0x8000000000000L) != 0L)
+         if ((active0 & 0x10000000000000L) != 0L)
          {
-            jjmatchedKind = 51;
+            jjmatchedKind = 52;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x28L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x50L, active2, 0L);
       case 114:
          if ((active0 & 0x80000000L) != 0L)
          {
             jjmatchedKind = 31;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x400000000L) != 0L)
+         else if ((active1 & 0x800000000L) != 0L)
          {
-            jjmatchedKind = 98;
+            jjmatchedKind = 99;
             jjmatchedPos = 4;
          }
-         else if ((active2 & 0x800L) != 0L)
+         else if ((active2 & 0x1000L) != 0L)
          {
-            jjmatchedKind = 139;
+            jjmatchedKind = 140;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x20000004000000L, active1, 0L, active2, 0x20L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000004000000L, active1, 0L, active2, 0x40L);
       case 115:
          if ((active0 & 0x100000000000L) != 0L)
          {
             jjmatchedKind = 44;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x8000000000000L) != 0L)
+         else if ((active1 & 0x10000000000000L) != 0L)
          {
-            jjmatchedKind = 115;
+            jjmatchedKind = 116;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8L, active2, 0L);
       case 116:
          if ((active0 & 0x20000000L) != 0L)
          {
             jjmatchedKind = 29;
             jjmatchedPos = 4;
          }
-         else if ((active0 & 0x80000000000000L) != 0L)
+         else if ((active0 & 0x100000000000000L) != 0L)
          {
-            jjmatchedKind = 55;
+            jjmatchedKind = 56;
             jjmatchedPos = 4;
          }
-         else if ((active1 & 0x100000L) != 0L)
+         else if ((active1 & 0x200000L) != 0L)
          {
-            jjmatchedKind = 84;
+            jjmatchedKind = 85;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x1000008000000L, active1, 0x10102048220000L, active2, 0x1040L);
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000008000000L, active1, 0x20204090440000L, active2, 0x2080L);
       case 117:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x400000000000000L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x800000000000000L, active2, 0x400000L);
       case 118:
-         if ((active0 & 0x4000000000000000L) != 0L)
+         if ((active0 & 0x8000000000000000L) != 0L)
          {
-            jjmatchedKind = 62;
+            jjmatchedKind = 63;
             jjmatchedPos = 4;
          }
-         return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0x1L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x3L, active2, 0L);
       case 120:
-         if ((active1 & 0x20000000L) != 0L)
+         if ((active1 & 0x40000000L) != 0L)
          {
-            jjmatchedKind = 93;
+            jjmatchedKind = 94;
             jjmatchedPos = 4;
          }
          break;
       case 122:
-         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x40000000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x80000000000000L, active2, 0L);
       default :
          break;
    }
@@ -1436,71 +1446,85 @@
    switch(curChar)
    {
       case 50:
-         if ((active2 & 0x2L) != 0L)
+         if ((active2 & 0x4L) != 0L)
          {
-            jjmatchedKind = 129;
+            jjmatchedKind = 130;
             jjmatchedPos = 5;
          }
          break;
       case 52:
-         if ((active1 & 0x4000000000000000L) != 0L)
-         {
-            jjmatchedKind = 126;
-            jjmatchedPos = 5;
-         }
-         else if ((active2 & 0x1L) != 0L)
-         {
-            jjmatchedKind = 128;
-            jjmatchedPos = 5;
-         }
-         break;
-      case 54:
          if ((active1 & 0x8000000000000000L) != 0L)
          {
             jjmatchedKind = 127;
             jjmatchedPos = 5;
          }
+         else if ((active2 & 0x2L) != 0L)
+         {
+            jjmatchedKind = 129;
+            jjmatchedPos = 5;
+         }
+         break;
+      case 54:
+         if ((active2 & 0x1L) != 0L)
+         {
+            jjmatchedKind = 128;
+            jjmatchedPos = 5;
+         }
          break;
       case 65:
-         return jjMoveStringLiteralDfa6_0(active0, 0x20000000000000L, active1, 0x100000800004L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000000000000L, active1, 0x200001000008L, active2, 0L);
       case 67:
-         return jjMoveStringLiteralDfa6_0(active0, 0x400000000000L, active1, 0x8000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x400000000000L, active1, 0x10000000000L, active2, 0L);
       case 68:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x20200000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x40400000000000L, active2, 0L);
       case 69:
-         if ((active1 & 0x10L) != 0L)
+         if ((active1 & 0x20L) != 0L)
          {
-            jjmatchedKind = 68;
+            jjmatchedKind = 69;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x40L) != 0L)
+         else if ((active2 & 0x80L) != 0L)
          {
-            jjmatchedKind = 134;
+            jjmatchedKind = 135;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x1000L) != 0L)
+         else if ((active2 & 0x2000L) != 0L)
          {
-            jjmatchedKind = 140;
+            jjmatchedKind = 141;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x10040058020000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x200800b0040000L, active2, 0L);
       case 70:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 71:
-         if ((active0 & 0x10000000000000L) != 0L)
+         if ((active0 & 0x20000000000000L) != 0L)
          {
-            jjmatchedKind = 52;
+            jjmatchedKind = 53;
             jjmatchedPos = 5;
          }
          break;
       case 73:
-         return jjMoveStringLiteralDfa6_0(active0, 0x4000000L, active1, 0x400080000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x4000000L, active1, 0x800100000000000L, active2, 0L);
       case 76:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0L, active2, 0x400000L);
       case 78:
-         if ((active0 & 0x1000000000000000L) != 0L)
+         if ((active0 & 0x2000000000000000L) != 0L)
          {
-            jjmatchedKind = 60;
+            jjmatchedKind = 61;
+            jjmatchedPos = 5;
+         }
+         else if ((active1 & 0x8000000000L) != 0L)
+         {
+            jjmatchedKind = 103;
+            jjmatchedPos = 5;
+         }
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000800000L, active1, 0x8100004L, active2, 0L);
+      case 79:
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1080000000000010L, active2, 0L);
+      case 82:
+         if ((active1 & 0x80L) != 0L)
+         {
+            jjmatchedKind = 71;
             jjmatchedPos = 5;
          }
          else if ((active1 & 0x4000000000L) != 0L)
@@ -1508,20 +1532,6 @@
             jjmatchedKind = 102;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0x40000800000L, active1, 0x4080002L, active2, 0L);
-      case 79:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x840000000000008L, active2, 0L);
-      case 82:
-         if ((active1 & 0x40L) != 0L)
-         {
-            jjmatchedKind = 70;
-            jjmatchedPos = 5;
-         }
-         else if ((active1 & 0x2000000000L) != 0L)
-         {
-            jjmatchedKind = 101;
-            jjmatchedPos = 5;
-         }
          return jjMoveStringLiteralDfa6_0(active0, 0x8000000L, active1, 0L, active2, 0L);
       case 83:
          if ((active0 & 0x200000000L) != 0L)
@@ -1529,12 +1539,12 @@
             jjmatchedKind = 33;
             jjmatchedPos = 5;
          }
-         else if ((active0 & 0x1000000000000L) != 0L)
+         else if ((active0 & 0x2000000000000L) != 0L)
          {
-            jjmatchedKind = 48;
+            jjmatchedKind = 49;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x200L, active2, 0L);
       case 84:
          if ((active0 & 0x400000L) != 0L)
          {
@@ -1546,22 +1556,22 @@
             jjmatchedKind = 30;
             jjmatchedPos = 5;
          }
-         else if ((active1 & 0x1000000000L) != 0L)
+         else if ((active1 & 0x2000000000L) != 0L)
          {
-            jjmatchedKind = 100;
+            jjmatchedKind = 101;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x20L) != 0L)
+         else if ((active2 & 0x40L) != 0L)
          {
-            jjmatchedKind = 133;
+            jjmatchedKind = 134;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x20000L) != 0L)
+         else if ((active2 & 0x40000L) != 0L)
          {
-            jjmatchedKind = 145;
+            jjmatchedKind = 146;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 88:
          if ((active0 & 0x200000L) != 0L)
          {
@@ -1570,49 +1580,63 @@
          }
          break;
       case 89:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x200000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x400000L, active2, 0L);
       case 95:
-         return jjMoveStringLiteralDfa6_0(active0, 0x8000000000000000L, active1, 0x21L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x43L, active2, 0L);
       case 97:
-         return jjMoveStringLiteralDfa6_0(active0, 0x20000000000000L, active1, 0x100000800004L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000000000000L, active1, 0x200001000008L, active2, 0L);
       case 99:
-         return jjMoveStringLiteralDfa6_0(active0, 0x400000000000L, active1, 0x8000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x400000000000L, active1, 0x10000000000L, active2, 0L);
       case 100:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x20200000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x40400000000000L, active2, 0L);
       case 101:
-         if ((active1 & 0x10L) != 0L)
+         if ((active1 & 0x20L) != 0L)
          {
-            jjmatchedKind = 68;
+            jjmatchedKind = 69;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x40L) != 0L)
+         else if ((active2 & 0x80L) != 0L)
          {
-            jjmatchedKind = 134;
+            jjmatchedKind = 135;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x1000L) != 0L)
+         else if ((active2 & 0x2000L) != 0L)
          {
-            jjmatchedKind = 140;
+            jjmatchedKind = 141;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x10040058020000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x1000000L, active1, 0x200800b0040000L, active2, 0L);
       case 102:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 103:
-         if ((active0 & 0x10000000000000L) != 0L)
+         if ((active0 & 0x20000000000000L) != 0L)
          {
-            jjmatchedKind = 52;
+            jjmatchedKind = 53;
             jjmatchedPos = 5;
          }
          break;
       case 105:
-         return jjMoveStringLiteralDfa6_0(active0, 0x4000000L, active1, 0x400080000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0x4000000L, active1, 0x800100000000000L, active2, 0L);
       case 108:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0L, active2, 0x200000L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0L, active2, 0x400000L);
       case 110:
-         if ((active0 & 0x1000000000000000L) != 0L)
+         if ((active0 & 0x2000000000000000L) != 0L)
          {
-            jjmatchedKind = 60;
+            jjmatchedKind = 61;
+            jjmatchedPos = 5;
+         }
+         else if ((active1 & 0x8000000000L) != 0L)
+         {
+            jjmatchedKind = 103;
+            jjmatchedPos = 5;
+         }
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000800000L, active1, 0x8100004L, active2, 0L);
+      case 111:
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1080000000000010L, active2, 0L);
+      case 114:
+         if ((active1 & 0x80L) != 0L)
+         {
+            jjmatchedKind = 71;
             jjmatchedPos = 5;
          }
          else if ((active1 & 0x4000000000L) != 0L)
@@ -1620,20 +1644,6 @@
             jjmatchedKind = 102;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0x40000800000L, active1, 0x4080002L, active2, 0L);
-      case 111:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x840000000000008L, active2, 0L);
-      case 114:
-         if ((active1 & 0x40L) != 0L)
-         {
-            jjmatchedKind = 70;
-            jjmatchedPos = 5;
-         }
-         else if ((active1 & 0x2000000000L) != 0L)
-         {
-            jjmatchedKind = 101;
-            jjmatchedPos = 5;
-         }
          return jjMoveStringLiteralDfa6_0(active0, 0x8000000L, active1, 0L, active2, 0L);
       case 115:
          if ((active0 & 0x200000000L) != 0L)
@@ -1641,12 +1651,12 @@
             jjmatchedKind = 33;
             jjmatchedPos = 5;
          }
-         else if ((active0 & 0x1000000000000L) != 0L)
+         else if ((active0 & 0x2000000000000L) != 0L)
          {
-            jjmatchedKind = 48;
+            jjmatchedKind = 49;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x200L, active2, 0L);
       case 116:
          if ((active0 & 0x400000L) != 0L)
          {
@@ -1658,22 +1668,22 @@
             jjmatchedKind = 30;
             jjmatchedPos = 5;
          }
-         else if ((active1 & 0x1000000000L) != 0L)
+         else if ((active1 & 0x2000000000L) != 0L)
          {
-            jjmatchedKind = 100;
+            jjmatchedKind = 101;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x20L) != 0L)
+         else if ((active2 & 0x40L) != 0L)
          {
-            jjmatchedKind = 133;
+            jjmatchedKind = 134;
             jjmatchedPos = 5;
          }
-         else if ((active2 & 0x20000L) != 0L)
+         else if ((active2 & 0x40000L) != 0L)
          {
-            jjmatchedKind = 145;
+            jjmatchedKind = 146;
             jjmatchedPos = 5;
          }
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 120:
          if ((active0 & 0x200000L) != 0L)
          {
@@ -1682,7 +1692,7 @@
          }
          break;
       case 121:
-         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x200000L, active2, 0L);
+         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x400000L, active2, 0L);
       default :
          break;
    }
@@ -1702,16 +1712,16 @@
       case 66:
          return jjMoveStringLiteralDfa7_0(active0, 0x4000000L, active1, 0L, active2, 0L);
       case 67:
-         return jjMoveStringLiteralDfa7_0(active0, 0x800000L, active1, 0x122L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0x800000L, active1, 0x244L, active2, 0L);
       case 68:
          if ((active0 & 0x1000000L) != 0L)
          {
             jjmatchedKind = 24;
             jjmatchedPos = 6;
          }
-         else if ((active1 & 0x400000000000000L) != 0L)
+         else if ((active1 & 0x800000000000000L) != 0L)
          {
-            jjmatchedKind = 122;
+            jjmatchedKind = 123;
             jjmatchedPos = 6;
          }
          break;
@@ -1721,55 +1731,50 @@
             jjmatchedKind = 46;
             jjmatchedPos = 6;
          }
-         else if ((active1 & 0x8000000000L) != 0L)
+         else if ((active1 & 0x10000000000L) != 0L)
          {
-            jjmatchedKind = 103;
+            jjmatchedKind = 104;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 71:
-         if ((active1 & 0x80000L) != 0L)
+         if ((active1 & 0x100000L) != 0L)
          {
-            jjmatchedKind = 83;
+            jjmatchedKind = 84;
             jjmatchedPos = 6;
          }
          break;
       case 75:
-         if ((active1 & 0x4000000L) != 0L)
+         if ((active1 & 0x8000000L) != 0L)
          {
-            jjmatchedKind = 90;
+            jjmatchedKind = 91;
             jjmatchedPos = 6;
          }
          break;
       case 77:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x4L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x8L, active2, 0L);
       case 78:
-         if ((active1 & 0x800000000000000L) != 0L)
+         if ((active1 & 0x1000000000000000L) != 0L)
          {
-            jjmatchedKind = 123;
+            jjmatchedKind = 124;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40080000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x80100000000000L, active2, 0L);
       case 79:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 80:
-         if ((active1 & 0x8L) != 0L)
+         if ((active1 & 0x10L) != 0L)
          {
-            jjmatchedKind = 67;
+            jjmatchedKind = 68;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x200001L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x400002L, active2, 0L);
       case 82:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x100058000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2000b0000000L, active2, 0L);
       case 83:
-         if ((active1 & 0x200000000000L) != 0L)
+         if ((active1 & 0x400000000000L) != 0L)
          {
-            jjmatchedKind = 109;
-            jjmatchedPos = 6;
-         }
-         else if ((active1 & 0x10000000000000L) != 0L)
-         {
-            jjmatchedKind = 116;
+            jjmatchedKind = 110;
             jjmatchedPos = 6;
          }
          else if ((active1 & 0x20000000000000L) != 0L)
@@ -1777,33 +1782,38 @@
             jjmatchedKind = 117;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L, active1, 0x20000L, active2, 0L);
-      case 84:
-         if ((active2 & 0x200000L) != 0L)
+         else if ((active1 & 0x40000000000000L) != 0L)
          {
-            jjmatchedKind = 149;
+            jjmatchedKind = 118;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0x20000000000000L, active1, 0x800000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40001L, active2, 0L);
+      case 84:
+         if ((active2 & 0x400000L) != 0L)
+         {
+            jjmatchedKind = 150;
+            jjmatchedPos = 6;
+         }
+         return jjMoveStringLiteralDfa7_0(active0, 0x40000000000000L, active1, 0x1000000L, active2, 0L);
       case 85:
          return jjMoveStringLiteralDfa7_0(active0, 0x8000000L, active1, 0L, active2, 0L);
       case 95:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x80000000000L, active2, 0L);
       case 97:
          return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L, active1, 0L, active2, 0L);
       case 98:
          return jjMoveStringLiteralDfa7_0(active0, 0x4000000L, active1, 0L, active2, 0L);
       case 99:
-         return jjMoveStringLiteralDfa7_0(active0, 0x800000L, active1, 0x122L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0x800000L, active1, 0x244L, active2, 0L);
       case 100:
          if ((active0 & 0x1000000L) != 0L)
          {
             jjmatchedKind = 24;
             jjmatchedPos = 6;
          }
-         else if ((active1 & 0x400000000000000L) != 0L)
+         else if ((active1 & 0x800000000000000L) != 0L)
          {
-            jjmatchedKind = 122;
+            jjmatchedKind = 123;
             jjmatchedPos = 6;
          }
          break;
@@ -1813,55 +1823,50 @@
             jjmatchedKind = 46;
             jjmatchedPos = 6;
          }
-         else if ((active1 & 0x8000000000L) != 0L)
+         else if ((active1 & 0x10000000000L) != 0L)
          {
-            jjmatchedKind = 103;
+            jjmatchedKind = 104;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1000000000000L, active2, 0L);
       case 103:
-         if ((active1 & 0x80000L) != 0L)
+         if ((active1 & 0x100000L) != 0L)
          {
-            jjmatchedKind = 83;
+            jjmatchedKind = 84;
             jjmatchedPos = 6;
          }
          break;
       case 107:
-         if ((active1 & 0x4000000L) != 0L)
+         if ((active1 & 0x8000000L) != 0L)
          {
-            jjmatchedKind = 90;
+            jjmatchedKind = 91;
             jjmatchedPos = 6;
          }
          break;
       case 109:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x4L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x8L, active2, 0L);
       case 110:
-         if ((active1 & 0x800000000000000L) != 0L)
+         if ((active1 & 0x1000000000000000L) != 0L)
          {
-            jjmatchedKind = 123;
+            jjmatchedKind = 124;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40080000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x80100000000000L, active2, 0L);
       case 111:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x400000000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x800000000000L, active2, 0L);
       case 112:
-         if ((active1 & 0x8L) != 0L)
+         if ((active1 & 0x10L) != 0L)
          {
-            jjmatchedKind = 67;
+            jjmatchedKind = 68;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x200001L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x400002L, active2, 0L);
       case 114:
-         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x100058000000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2000b0000000L, active2, 0L);
       case 115:
-         if ((active1 & 0x200000000000L) != 0L)
+         if ((active1 & 0x400000000000L) != 0L)
          {
-            jjmatchedKind = 109;
-            jjmatchedPos = 6;
-         }
-         else if ((active1 & 0x10000000000000L) != 0L)
-         {
-            jjmatchedKind = 116;
+            jjmatchedKind = 110;
             jjmatchedPos = 6;
          }
          else if ((active1 & 0x20000000000000L) != 0L)
@@ -1869,14 +1874,19 @@
             jjmatchedKind = 117;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L, active1, 0x20000L, active2, 0L);
-      case 116:
-         if ((active2 & 0x200000L) != 0L)
+         else if ((active1 & 0x40000000000000L) != 0L)
          {
-            jjmatchedKind = 149;
+            jjmatchedKind = 118;
             jjmatchedPos = 6;
          }
-         return jjMoveStringLiteralDfa7_0(active0, 0x20000000000000L, active1, 0x800000L, active2, 0L);
+         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40001L, active2, 0L);
+      case 116:
+         if ((active2 & 0x400000L) != 0L)
+         {
+            jjmatchedKind = 150;
+            jjmatchedPos = 6;
+         }
+         return jjMoveStringLiteralDfa7_0(active0, 0x40000000000000L, active1, 0x1000000L, active2, 0L);
       case 117:
          return jjMoveStringLiteralDfa7_0(active0, 0x8000000L, active1, 0L, active2, 0L);
       default :
@@ -1894,40 +1904,40 @@
    switch(curChar)
    {
       case 65:
-         return jjMoveStringLiteralDfa8_0(active0, 0x8000000000000000L, active1, 0x8000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x10000001L);
       case 67:
-         return jjMoveStringLiteralDfa8_0(active0, 0x8000000L, active1, 0x800000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0x8000000L, active1, 0x1000000L);
       case 69:
          if ((active0 & 0x4000000L) != 0L)
          {
             jjmatchedKind = 26;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x2L) != 0L)
+         else if ((active1 & 0x4L) != 0L)
          {
-            jjmatchedKind = 65;
+            jjmatchedKind = 66;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x100L) != 0L)
+         else if ((active1 & 0x200L) != 0L)
          {
-            jjmatchedKind = 72;
+            jjmatchedKind = 73;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x200000L) != 0L)
+         else if ((active1 & 0x400000L) != 0L)
          {
-            jjmatchedKind = 85;
+            jjmatchedKind = 86;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x40000000000000L) != 0L)
+         else if ((active1 & 0x80000000000000L) != 0L)
          {
-            jjmatchedKind = 118;
+            jjmatchedKind = 119;
             jjmatchedPos = 7;
          }
          break;
       case 70:
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x80000000000L);
       case 73:
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x10000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x20000000L);
       case 76:
          if ((active0 & 0x40000000000L) != 0L)
          {
@@ -1936,32 +1946,32 @@
          }
          break;
       case 77:
-         if ((active1 & 0x40000000L) != 0L)
+         if ((active1 & 0x80000000L) != 0L)
          {
-            jjmatchedKind = 94;
+            jjmatchedKind = 95;
             jjmatchedPos = 7;
          }
          break;
       case 79:
-         return jjMoveStringLiteralDfa8_0(active0, 0x20000000000000L, active1, 0x21L);
+         return jjMoveStringLiteralDfa8_0(active0, 0x40000000000000L, active1, 0x42L);
       case 80:
-         if ((active1 & 0x4L) != 0L)
+         if ((active1 & 0x8L) != 0L)
          {
-            jjmatchedKind = 66;
+            jjmatchedKind = 67;
             jjmatchedPos = 7;
          }
          break;
       case 82:
-         if ((active1 & 0x800000000000L) != 0L)
+         if ((active1 & 0x1000000000000L) != 0L)
          {
-            jjmatchedKind = 111;
+            jjmatchedKind = 112;
             jjmatchedPos = 7;
          }
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x400000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x800000000000L);
       case 83:
-         if ((active1 & 0x80000000000L) != 0L)
+         if ((active1 & 0x100000000000L) != 0L)
          {
-            jjmatchedKind = 107;
+            jjmatchedKind = 108;
             jjmatchedPos = 7;
          }
          break;
@@ -1971,47 +1981,47 @@
             jjmatchedKind = 23;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x20000L) != 0L)
+         else if ((active1 & 0x40000L) != 0L)
          {
-            jjmatchedKind = 81;
+            jjmatchedKind = 82;
             jjmatchedPos = 7;
          }
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x100000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x200000000000L);
       case 97:
-         return jjMoveStringLiteralDfa8_0(active0, 0x8000000000000000L, active1, 0x8000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x10000001L);
       case 99:
-         return jjMoveStringLiteralDfa8_0(active0, 0x8000000L, active1, 0x800000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0x8000000L, active1, 0x1000000L);
       case 101:
          if ((active0 & 0x4000000L) != 0L)
          {
             jjmatchedKind = 26;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x2L) != 0L)
+         else if ((active1 & 0x4L) != 0L)
          {
-            jjmatchedKind = 65;
+            jjmatchedKind = 66;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x100L) != 0L)
+         else if ((active1 & 0x200L) != 0L)
          {
-            jjmatchedKind = 72;
+            jjmatchedKind = 73;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x200000L) != 0L)
+         else if ((active1 & 0x400000L) != 0L)
          {
-            jjmatchedKind = 85;
+            jjmatchedKind = 86;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x40000000000000L) != 0L)
+         else if ((active1 & 0x80000000000000L) != 0L)
          {
-            jjmatchedKind = 118;
+            jjmatchedKind = 119;
             jjmatchedPos = 7;
          }
          break;
       case 102:
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x80000000000L);
       case 105:
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x10000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x20000000L);
       case 108:
          if ((active0 & 0x40000000000L) != 0L)
          {
@@ -2020,32 +2030,32 @@
          }
          break;
       case 109:
-         if ((active1 & 0x40000000L) != 0L)
+         if ((active1 & 0x80000000L) != 0L)
          {
-            jjmatchedKind = 94;
+            jjmatchedKind = 95;
             jjmatchedPos = 7;
          }
          break;
       case 111:
-         return jjMoveStringLiteralDfa8_0(active0, 0x20000000000000L, active1, 0x21L);
+         return jjMoveStringLiteralDfa8_0(active0, 0x40000000000000L, active1, 0x42L);
       case 112:
-         if ((active1 & 0x4L) != 0L)
+         if ((active1 & 0x8L) != 0L)
          {
-            jjmatchedKind = 66;
+            jjmatchedKind = 67;
             jjmatchedPos = 7;
          }
          break;
       case 114:
-         if ((active1 & 0x800000000000L) != 0L)
+         if ((active1 & 0x1000000000000L) != 0L)
          {
-            jjmatchedKind = 111;
+            jjmatchedKind = 112;
             jjmatchedPos = 7;
          }
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x400000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x800000000000L);
       case 115:
-         if ((active1 & 0x80000000000L) != 0L)
+         if ((active1 & 0x100000000000L) != 0L)
          {
-            jjmatchedKind = 107;
+            jjmatchedKind = 108;
             jjmatchedPos = 7;
          }
          break;
@@ -2055,12 +2065,12 @@
             jjmatchedKind = 23;
             jjmatchedPos = 7;
          }
-         else if ((active1 & 0x20000L) != 0L)
+         else if ((active1 & 0x40000L) != 0L)
          {
-            jjmatchedKind = 81;
+            jjmatchedKind = 82;
             jjmatchedPos = 7;
          }
-         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x100000000000L);
+         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x200000000000L);
       default :
          break;
    }
@@ -2076,52 +2086,52 @@
    switch(curChar)
    {
       case 67:
+         if ((active1 & 0x20000000L) != 0L)
+         {
+            jjmatchedKind = 93;
+            jjmatchedPos = 8;
+         }
+         break;
+      case 69:
+         if ((active1 & 0x800000000000L) != 0L)
+         {
+            jjmatchedKind = 111;
+            jjmatchedPos = 8;
+         }
+         break;
+      case 72:
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x1000000L);
+      case 76:
          if ((active1 & 0x10000000L) != 0L)
          {
             jjmatchedKind = 92;
             jjmatchedPos = 8;
          }
          break;
-      case 69:
-         if ((active1 & 0x400000000000L) != 0L)
-         {
-            jjmatchedKind = 110;
-            jjmatchedPos = 8;
-         }
-         break;
-      case 72:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x800000L);
-      case 76:
-         if ((active1 & 0x8000000L) != 0L)
-         {
-            jjmatchedKind = 91;
-            jjmatchedPos = 8;
-         }
-         break;
       case 77:
-         return jjMoveStringLiteralDfa9_0(active0, 0x8000000000000000L, active1, 0L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x1L);
       case 78:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x20L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x40L);
       case 79:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x80000000000L);
       case 80:
-         if ((active1 & 0x1L) != 0L)
+         if ((active1 & 0x2L) != 0L)
          {
-            jjmatchedKind = 64;
+            jjmatchedKind = 65;
             jjmatchedPos = 8;
          }
          break;
       case 82:
-         if ((active0 & 0x20000000000000L) != 0L)
+         if ((active0 & 0x40000000000000L) != 0L)
          {
-            jjmatchedKind = 53;
+            jjmatchedKind = 54;
             jjmatchedPos = 8;
          }
          break;
       case 83:
-         if ((active1 & 0x100000000000L) != 0L)
+         if ((active1 & 0x200000000000L) != 0L)
          {
-            jjmatchedKind = 108;
+            jjmatchedKind = 109;
             jjmatchedPos = 8;
          }
          break;
@@ -2133,52 +2143,52 @@
          }
          break;
       case 99:
+         if ((active1 & 0x20000000L) != 0L)
+         {
+            jjmatchedKind = 93;
+            jjmatchedPos = 8;
+         }
+         break;
+      case 101:
+         if ((active1 & 0x800000000000L) != 0L)
+         {
+            jjmatchedKind = 111;
+            jjmatchedPos = 8;
+         }
+         break;
+      case 104:
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x1000000L);
+      case 108:
          if ((active1 & 0x10000000L) != 0L)
          {
             jjmatchedKind = 92;
             jjmatchedPos = 8;
          }
          break;
-      case 101:
-         if ((active1 & 0x400000000000L) != 0L)
-         {
-            jjmatchedKind = 110;
-            jjmatchedPos = 8;
-         }
-         break;
-      case 104:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x800000L);
-      case 108:
-         if ((active1 & 0x8000000L) != 0L)
-         {
-            jjmatchedKind = 91;
-            jjmatchedPos = 8;
-         }
-         break;
       case 109:
-         return jjMoveStringLiteralDfa9_0(active0, 0x8000000000000000L, active1, 0L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x1L);
       case 110:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x20L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x40L);
       case 111:
-         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x80000000000L);
       case 112:
-         if ((active1 & 0x1L) != 0L)
+         if ((active1 & 0x2L) != 0L)
          {
-            jjmatchedKind = 64;
+            jjmatchedKind = 65;
             jjmatchedPos = 8;
          }
          break;
       case 114:
-         if ((active0 & 0x20000000000000L) != 0L)
+         if ((active0 & 0x40000000000000L) != 0L)
          {
-            jjmatchedKind = 53;
+            jjmatchedKind = 54;
             jjmatchedPos = 8;
          }
          break;
       case 115:
-         if ((active1 & 0x100000000000L) != 0L)
+         if ((active1 & 0x200000000000L) != 0L)
          {
-            jjmatchedKind = 108;
+            jjmatchedKind = 109;
             jjmatchedPos = 8;
          }
          break;
@@ -2204,38 +2214,38 @@
    switch(curChar)
    {
       case 67:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x20L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x40L);
       case 69:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x800000L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x1000000L);
       case 80:
-         if ((active0 & 0x8000000000000000L) != 0L)
+         if ((active1 & 0x1L) != 0L)
          {
-            jjmatchedKind = 63;
+            jjmatchedKind = 64;
             jjmatchedPos = 9;
          }
          break;
       case 82:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x80000000000L);
       case 99:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x20L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x40L);
       case 101:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x800000L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x1000000L);
       case 112:
-         if ((active0 & 0x8000000000000000L) != 0L)
+         if ((active1 & 0x1L) != 0L)
          {
-            jjmatchedKind = 63;
+            jjmatchedKind = 64;
             jjmatchedPos = 9;
          }
          break;
       case 114:
-         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa10_0(active1, 0x80000000000L);
       default :
          break;
    }
    return jjMoveNfa_0(0, 9);
 }
-private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long active1){
-   if (((active0 &= old0) | (active1 &= old1)) == 0L)
+private int jjMoveStringLiteralDfa10_0(long old1, long active1){
+   if (((active1 &= old1)) == 0L)
       return jjMoveNfa_0(0, 9);
    try { curChar = input_stream.readChar(); }
    catch(java.io.IOException e) {
@@ -2244,22 +2254,22 @@
    switch(curChar)
    {
       case 65:
-         return jjMoveStringLiteralDfa11_0(active1, 0x20L);
+         return jjMoveStringLiteralDfa11_0(active1, 0x40L);
       case 83:
-         if ((active1 & 0x800000L) != 0L)
+         if ((active1 & 0x1000000L) != 0L)
          {
-            jjmatchedKind = 87;
+            jjmatchedKind = 88;
             jjmatchedPos = 10;
          }
          break;
       case 95:
-         return jjMoveStringLiteralDfa11_0(active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa11_0(active1, 0x80000000000L);
       case 97:
-         return jjMoveStringLiteralDfa11_0(active1, 0x20L);
+         return jjMoveStringLiteralDfa11_0(active1, 0x40L);
       case 115:
-         if ((active1 & 0x800000L) != 0L)
+         if ((active1 & 0x1000000L) != 0L)
          {
-            jjmatchedKind = 87;
+            jjmatchedKind = 88;
             jjmatchedPos = 10;
          }
          break;
@@ -2278,23 +2288,23 @@
    switch(curChar)
    {
       case 84:
-         if ((active1 & 0x20L) != 0L)
+         if ((active1 & 0x40L) != 0L)
          {
-            jjmatchedKind = 69;
+            jjmatchedKind = 70;
             jjmatchedPos = 11;
          }
          break;
       case 85:
-         return jjMoveStringLiteralDfa12_0(active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa12_0(active1, 0x80000000000L);
       case 116:
-         if ((active1 & 0x20L) != 0L)
+         if ((active1 & 0x40L) != 0L)
          {
-            jjmatchedKind = 69;
+            jjmatchedKind = 70;
             jjmatchedPos = 11;
          }
          break;
       case 117:
-         return jjMoveStringLiteralDfa12_0(active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa12_0(active1, 0x80000000000L);
       default :
          break;
    }
@@ -2310,9 +2320,9 @@
    switch(curChar)
    {
       case 82:
-         return jjMoveStringLiteralDfa13_0(active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa13_0(active1, 0x80000000000L);
       case 114:
-         return jjMoveStringLiteralDfa13_0(active1, 0x40000000000L);
+         return jjMoveStringLiteralDfa13_0(active1, 0x80000000000L);
       default :
          break;
    }
@@ -2328,16 +2338,16 @@
    switch(curChar)
    {
       case 73:
-         if ((active1 & 0x40000000000L) != 0L)
+         if ((active1 & 0x80000000000L) != 0L)
          {
-            jjmatchedKind = 106;
+            jjmatchedKind = 107;
             jjmatchedPos = 13;
          }
          break;
       case 105:
-         if ((active1 & 0x40000000000L) != 0L)
+         if ((active1 & 0x80000000000L) != 0L)
          {
-            jjmatchedKind = 106;
+            jjmatchedKind = 107;
             jjmatchedPos = 13;
          }
          break;
@@ -2410,8 +2420,8 @@
                case 0:
                   if ((0x3ff000000000000L & l) != 0L)
                   {
-                     if (kind > 154)
-                        kind = 154;
+                     if (kind > 155)
+                        kind = 155;
                      { jjCheckNAddStates(0, 6); }
                   }
                   else if (curChar == 45)
@@ -2559,8 +2569,8 @@
                      jjstateSet[jjnewStateCnt++] = 32;
                   break;
                case 40:
-                  if ((0x8400000000L & l) != 0L && kind > 166)
-                     kind = 166;
+                  if ((0x8400000000L & l) != 0L && kind > 167)
+                     kind = 167;
                   break;
                case 41:
                   if (curChar == 39)
@@ -2575,8 +2585,8 @@
                      { jjCheckNAddStates(29, 31); }
                   break;
                case 45:
-                  if (curChar == 39 && kind > 167)
-                     kind = 167;
+                  if (curChar == 39 && kind > 168)
+                     kind = 168;
                   break;
                case 46:
                   if (curChar == 34)
@@ -2591,8 +2601,8 @@
                      { jjCheckNAddStates(26, 28); }
                   break;
                case 50:
-                  if (curChar == 34 && kind > 168)
-                     kind = 168;
+                  if (curChar == 34 && kind > 169)
+                     kind = 169;
                   break;
                case 51:
                   if (curChar == 39)
@@ -2616,8 +2626,8 @@
                      { jjAddStates(45, 46); }
                   break;
                case 58:
-                  if (curChar == 39 && kind > 169)
-                     kind = 169;
+                  if (curChar == 39 && kind > 170)
+                     kind = 170;
                   break;
                case 59:
                   if (curChar == 39)
@@ -2653,8 +2663,8 @@
                      { jjAddStates(51, 52); }
                   break;
                case 69:
-                  if (curChar == 34 && kind > 170)
-                     kind = 170;
+                  if (curChar == 34 && kind > 171)
+                     kind = 171;
                   break;
                case 70:
                   if (curChar == 34)
@@ -2689,8 +2699,8 @@
                      { jjCheckNAddStates(20, 22); }
                   break;
                case 78:
-                  if (curChar == 41 && kind > 173)
-                     kind = 173;
+                  if (curChar == 41 && kind > 174)
+                     kind = 174;
                   break;
                case 79:
                   if (curChar == 10)
@@ -2871,15 +2881,15 @@
                case 145:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 154)
-                     kind = 154;
+                  if (kind > 155)
+                     kind = 155;
                   { jjCheckNAddStates(0, 6); }
                   break;
                case 146:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 154)
-                     kind = 154;
+                  if (kind > 155)
+                     kind = 155;
                   { jjCheckNAdd(146); }
                   break;
                case 147:
@@ -2893,8 +2903,8 @@
                case 149:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 155)
-                     kind = 155;
+                  if (kind > 156)
+                     kind = 156;
                   { jjCheckNAdd(149); }
                   break;
                case 150:
@@ -2916,8 +2926,8 @@
                case 155:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 156)
-                     kind = 156;
+                  if (kind > 157)
+                     kind = 157;
                   { jjCheckNAdd(155); }
                   break;
                case 156:
@@ -2931,8 +2941,8 @@
                case 159:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 156)
-                     kind = 156;
+                  if (kind > 157)
+                     kind = 157;
                   { jjCheckNAdd(159); }
                   break;
                case 160:
@@ -2950,8 +2960,8 @@
                case 164:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 156)
-                     kind = 156;
+                  if (kind > 157)
+                     kind = 157;
                   { jjCheckNAdd(164); }
                   break;
                case 165:
@@ -2961,8 +2971,8 @@
                case 166:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 157)
-                     kind = 157;
+                  if (kind > 158)
+                     kind = 158;
                   { jjCheckNAdd(166); }
                   break;
                case 167:
@@ -2976,8 +2986,8 @@
                case 169:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 158)
-                     kind = 158;
+                  if (kind > 159)
+                     kind = 159;
                   { jjCheckNAdd(169); }
                   break;
                case 170:
@@ -2995,8 +3005,8 @@
                case 174:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 159)
-                     kind = 159;
+                  if (kind > 160)
+                     kind = 160;
                   { jjCheckNAdd(174); }
                   break;
                case 175:
@@ -3022,8 +3032,8 @@
                case 181:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 159)
-                     kind = 159;
+                  if (kind > 160)
+                     kind = 160;
                   { jjCheckNAdd(181); }
                   break;
                case 182:
@@ -3037,8 +3047,8 @@
                case 185:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 159)
-                     kind = 159;
+                  if (kind > 160)
+                     kind = 160;
                   { jjCheckNAdd(185); }
                   break;
                case 186:
@@ -3048,8 +3058,8 @@
                case 187:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 160)
-                     kind = 160;
+                  if (kind > 161)
+                     kind = 161;
                   { jjCheckNAdd(187); }
                   break;
                case 188:
@@ -3063,8 +3073,8 @@
                case 190:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 161)
-                     kind = 161;
+                  if (kind > 162)
+                     kind = 162;
                   { jjCheckNAdd(190); }
                   break;
                case 191:
@@ -3082,8 +3092,8 @@
                case 195:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 162)
-                     kind = 162;
+                  if (kind > 163)
+                     kind = 163;
                   { jjCheckNAdd(195); }
                   break;
                case 196:
@@ -3109,8 +3119,8 @@
                case 202:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 162)
-                     kind = 162;
+                  if (kind > 163)
+                     kind = 163;
                   { jjCheckNAdd(202); }
                   break;
                case 203:
@@ -3124,8 +3134,8 @@
                case 206:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 162)
-                     kind = 162;
+                  if (kind > 163)
+                     kind = 163;
                   { jjCheckNAdd(206); }
                   break;
                default : break;
@@ -3225,8 +3235,8 @@
                   { jjCheckNAddStates(32, 37); }
                   break;
                case 28:
-                  if ((0x200000002L & l) != 0L && kind > 135)
-                     kind = 135;
+                  if ((0x200000002L & l) != 0L && kind > 136)
+                     kind = 136;
                   break;
                case 29:
                   if ((0x10000000100000L & l) != 0L)
@@ -3265,8 +3275,8 @@
                      jjstateSet[jjnewStateCnt++] = 40;
                   break;
                case 40:
-                  if ((0x14404410000000L & l) != 0L && kind > 166)
-                     kind = 166;
+                  if ((0x14404410000000L & l) != 0L && kind > 167)
+                     kind = 167;
                   break;
                case 42:
                   if ((0xffffffffefffffffL & l) != 0L)
@@ -3327,8 +3337,8 @@
                   { jjCheckNAddStates(59, 64); }
                   break;
                case 86:
-                  if (curChar == 93 && kind > 178)
-                     kind = 178;
+                  if (curChar == 93 && kind > 179)
+                     kind = 179;
                   break;
                case 89:
                   if ((0x7fffffe07fffffeL & l) != 0L)
@@ -3427,8 +3437,8 @@
                   { jjCheckNAddStates(78, 83); }
                   break;
                case 119:
-                  if ((0x200000002L & l) != 0L && kind > 136)
-                     kind = 136;
+                  if ((0x200000002L & l) != 0L && kind > 137)
+                     kind = 137;
                   break;
                case 120:
                   if ((0x10000000100000L & l) != 0L)
@@ -3466,8 +3476,8 @@
                   { jjCheckNAddStates(87, 92); }
                   break;
                case 134:
-                  if ((0x2000000020L & l) != 0L && kind > 137)
-                     kind = 137;
+                  if ((0x2000000020L & l) != 0L && kind > 138)
+                     kind = 138;
                   break;
                case 135:
                   if ((0x4000000040000L & l) != 0L)
@@ -3799,11 +3809,11 @@
 null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
 null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
 null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
-null, null, null, null, "\50", "\51", null, "\173", "\175", "\133", "\135", null, 
-"\73", "\54", "\56", "\75", "\41\75", "\76", "\74", "\74\75", "\76\75", "\76\76", 
-"\74\74", "\41", "\176", "\72", "\174\174", "\46\46", "\53", "\55", "\52", "\57", 
-"\136\136", "\100", "\72\75", "\174", "\136", "\55\76", "\74\55", "\77", null, null, null, 
-null, null, null, null, null, null, null, null, };
+null, null, null, null, null, "\50", "\51", null, "\173", "\175", "\133", "\135", 
+null, "\73", "\54", "\56", "\75", "\41\75", "\76", "\74", "\74\75", "\76\75", 
+"\76\76", "\74\74", "\41", "\176", "\72", "\174\174", "\46\46", "\53", "\55", "\52", 
+"\57", "\136\136", "\100", "\72\75", "\174", "\136", "\55\76", "\74\55", "\77", null, 
+null, null, null, null, null, null, null, null, null, null, };
 protected Token jjFillToken()
 {
    final Token t;
@@ -3990,7 +4000,7 @@
    "DEFAULT",
 };
 static final long[] jjtoToken = {
-   0xfffffffffff9fe01L, 0xffffffffffffffffL, 0xffffffc7fdffffffL, 0x7fffL, 
+   0xfffffffffff9fe01L, 0xffffffffffffffffL, 0xffffff8ffbffffffL, 0xffffL, 
 };
 static final long[] jjtoSkip = {
    0x7eL, 0x0L, 0x0L, 0x0L, 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11.java
index 3258ff1..1924a19 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11.java
@@ -2019,10 +2019,11 @@
     }
   }
 
-  final public void InlineDataOneVar() throws ParseException {Var v ; Node n ; Token t ;
+  final public void InlineDataOneVar() throws ParseException {Var v ; Node n ; Token t ; ; int beginLine; int beginColumn;
     v = Var();
 emitDataBlockVariable(v) ;
     t = jj_consume_token(LBRACE);
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
     label_15:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -2053,9 +2054,9 @@
         break label_15;
       }
       n = DataBlockValue();
-startDataBlockValueRow(-1, -1) ;
-      emitDataBlockValue(n, -1, -1) ;
-      finishDataBlockValueRow(-1, -1) ;
+startDataBlockValueRow(beginLine, beginColumn) ;
+      emitDataBlockValue(n, beginLine, beginColumn) ;
+      finishDataBlockValueRow(beginLine, beginColumn) ;
     }
     t = jj_consume_token(RBRACE);
   }
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
deleted file mode 100644
index 0ae775f..0000000
--- a/jena-arq/src/main/java/org/apache/jena/sparql/modify/NodeTransformBNodesToVariables.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 org.apache.jena.sparql.modify;
-
-import java.util.HashMap ;
-import java.util.Map ;
-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
-{
-    private VarAlloc varAlloc = new VarAlloc(ARQConstants.allocVarBNodeToVar) ;
-    private Map<Node, Var> mapping ;
-
-    public NodeTransformBNodesToVariables()
-    {
-        this.mapping = new HashMap<>();
-    }
-
-    @Override
-    public Node apply(Node node)
-    {
-        if ( ! node.isBlank() )
-            return node ;
-        Node node2 = mapping.get(node) ;
-        if ( node2 == null )
-        {
-            Var v = varAlloc.allocVar() ;
-            mapping.put(node, v) ;
-            node2 = v ;
-        }
-        return node2 ;
-    }
-}
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 fa8bccb..26385a0 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
@@ -51,8 +51,6 @@
 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 ;
 import org.apache.jena.sparql.syntax.ElementGroup ;
@@ -438,11 +436,6 @@
         return g;
     }
 
-    protected static List<Quad> unused_convertBNodesToVariables(List<Quad> quads) {
-        NodeTransform bnodesToVariables = new NodeTransformBNodesToVariables();
-        return NodeTransformLib.transformQuads(bnodesToVariables, quads);
-    }
-
     protected Element elementFromQuads(List<Quad> quads) {
         ElementGroup el = new ElementGroup();
         ElementTriplesBlock x = new ElementTriplesBlock();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/PathCompiler.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/PathCompiler.java
index 0d15352..ab84fd6 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/PathCompiler.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/PathCompiler.java
@@ -30,7 +30,7 @@
     // Convert to work on OpPath.
     // Need pre (and post) BGPs.
     
-    private static VarAlloc varAlloc = new VarAlloc(ARQConstants.allocVarAnonMarker+"P") ;
+    private static VarAlloc varAlloc = new VarAlloc(ARQConstants.allocPathVariables) ;
     
     // Move to AlgebraCompiler and have a per-transaction scoped var generator 
     
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java
index d0f6fae..185aa08 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java
@@ -117,17 +117,19 @@
     /** Lookup by URI */
     public PropertyFunctionFactory get(String uri)
     {
+        // Is it mapped?
         String mappedUri = MappedLoader.mapDynamicURI(uri) ;
         if ( mappedUri != null )
-            uri = mappedUri ; 
-        
-        PropertyFunctionFactory ext = registry.get(uri) ;
-        if ( ext != null )
-            return ext ;
-        
+            uri = mappedUri ;
+
+        // Plain registration, after mapping.
+        PropertyFunctionFactory factory = registry.get(uri) ;
+        if ( factory != null )
+            return factory;
+
         if ( attemptedLoads.contains(uri) )
             return null ;
-
+        
         Class<?> extClass = MappedLoader.loadClass(uri, PropertyFunction.class) ;
         if ( extClass == null )
             return null ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/StandardPropertyFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/StandardPropertyFunctions.java
index 92ee396..c06d89c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/StandardPropertyFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/StandardPropertyFunctions.java
@@ -18,31 +18,38 @@
 
 package org.apache.jena.sparql.pfunction;
 
-import org.apache.jena.sparql.vocabulary.ListPFunction ;
+import org.apache.jena.sparql.ARQConstants;
+import org.apache.jena.sparql.pfunction.library.triple.TripleTermFind;
+import org.apache.jena.sparql.vocabulary.ListPFunction;
 import org.apache.jena.vocabulary.RDFS;
 
 public class StandardPropertyFunctions {
     @SuppressWarnings("deprecation")
     public static void loadStdDefs(PropertyFunctionRegistry registry) {
-        add(registry, ListPFunction.member.getURI() , org.apache.jena.sparql.pfunction.library.listMember.class) ;
-        add(registry, ListPFunction.index.getURI() , org.apache.jena.sparql.pfunction.library.listIndex.class) ;
-        add(registry, ListPFunction.length.getURI() , org.apache.jena.sparql.pfunction.library.listLength.class) ;
-        add(registry, ListPFunction.memberJ2.getURI() , org.apache.jena.sparql.pfunction.library.listMember.class) ;
-        add(registry, ListPFunction.indexJ2.getURI() , org.apache.jena.sparql.pfunction.library.listIndex.class) ;
-        add(registry, ListPFunction.lengthJ2.getURI() , org.apache.jena.sparql.pfunction.library.listLength.class) ;
+        add(registry, ListPFunction.member.getURI(),    org.apache.jena.sparql.pfunction.library.listMember.class);
+        add(registry, ListPFunction.index.getURI(),     org.apache.jena.sparql.pfunction.library.listIndex.class);
+        add(registry, ListPFunction.length.getURI(),    org.apache.jena.sparql.pfunction.library.listLength.class);
+        add(registry, ListPFunction.memberJ2.getURI(),  org.apache.jena.sparql.pfunction.library.listMember.class);
+        add(registry, ListPFunction.indexJ2.getURI(),   org.apache.jena.sparql.pfunction.library.listIndex.class);
+        add(registry, ListPFunction.lengthJ2.getURI(),  org.apache.jena.sparql.pfunction.library.listLength.class);
 
         // (Very) old forms
-        add(registry, ListPFunction.listMember.getURI() , org.apache.jena.sparql.pfunction.library.listMember.class) ;
-        add(registry, ListPFunction.listIndex.getURI() , org.apache.jena.sparql.pfunction.library.listIndex.class) ;
-        add(registry, ListPFunction.listLength.getURI() , org.apache.jena.sparql.pfunction.library.listLength.class) ;
-        
+        add(registry, ListPFunction.listMember.getURI(),    org.apache.jena.sparql.pfunction.library.listMember.class);
+        add(registry, ListPFunction.listIndex.getURI(),     org.apache.jena.sparql.pfunction.library.listIndex.class);
+        add(registry, ListPFunction.listLength.getURI(),    org.apache.jena.sparql.pfunction.library.listLength.class);
+
         // This is called during Jena-wide initialization.
         // Use function for constant (JENA-1294)
-        add(registry, RDFS.Init.member().getURI(), org.apache.jena.sparql.pfunction.library.container.class) ;
+        add(registry, RDFS.Init.member().getURI(), org.apache.jena.sparql.pfunction.library.container.class);
+
+        // Property function - RDF*
+//        PropertyFunctionFactory factory = (uri)->new TripleTermFind();
+//        registry.put(ARQConstants.ARQPropertyFunctionLibraryURI+"find", factory);
+        add(registry, ARQConstants.ARQPropertyFunctionLibraryURI+"find", TripleTermFind.class);
+        
     }
-    
-    private static void add(PropertyFunctionRegistry registry, String uri, Class<?> funcClass)
-    {
-        registry.put(uri, funcClass) ;
+
+    private static void add(PropertyFunctionRegistry registry, String uri, Class<? > funcClass) {
+        registry.put(uri, funcClass);
     }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/triple/TripleTermFind.java b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/triple/TripleTermFind.java
new file mode 100644
index 0000000..c033ff1
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/library/triple/TripleTermFind.java
@@ -0,0 +1,81 @@
+/*
+ * 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 org.apache.jena.sparql.pfunction.library.triple;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Node_Triple;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.ExecutionContext;
+import org.apache.jena.sparql.engine.QueryIterator;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.engine.iterator.QueryIterNullIterator;
+import org.apache.jena.sparql.engine.iterator.QueryIterSingleton;
+import org.apache.jena.sparql.engine.iterator.RX;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.pfunction.*;
+
+/** Property function for FIND() - allows already bound.
+ * <pre>
+ *    << ?s ?p ?o >> apf:find ?t .
+ * <pre>
+ * This binds all the variables, with <tt>?t</tt> bound to a triple term for the match of <tt>?s ?p ?o</tt>. 
+ */ 
+public class TripleTermFind extends PropertyFunctionEval {
+
+    static public void init() {
+        PropertyFunctionFactory factory = (uri)->new TripleTermFind();
+        Node uri = NodeFactory.createURI("http://arq/find");
+        PropertyFunctionRegistry.get().put(uri.getURI(), factory);
+    }
+
+    public TripleTermFind() {
+        super(PropFuncArgType.PF_ARG_SINGLE, PropFuncArgType.PF_ARG_SINGLE);
+    }
+
+    @Override
+    public QueryIterator execEvaluated(Binding binding, PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt) {
+
+        Node sArg = argSubject.getArg();
+        if ( ! sArg.isNodeTriple() )
+            throw new ExprEvalException("Not a triple term: "+sArg);
+        Triple triple = Node_Triple.triple(sArg);
+
+        Node nAssign = argObject.getArg();
+        if ( ! Var.isVar(nAssign) ) {
+            if ( ! nAssign.isNodeTriple() )
+                return QueryIterNullIterator.create(execCxt); 
+            Triple t2 = Node_Triple.triple(nAssign);
+            if ( t2.equals(triple) )
+                return QueryIterSingleton.create(binding, execCxt);
+            return QueryIterNullIterator.create(execCxt);
+        }
+        
+        Var var = Var.alloc(nAssign);
+
+        QueryIterator input = QueryIterSingleton.create(binding, execCxt);
+
+        // This matches the triple inside the Node_Triple, recursively,
+        // and adds the binding for "(<< >> AS ?t)".
+
+        QueryIterator qIter = RX.matchTripleStar(input, var, triple, execCxt);
+        return qIter;
+    }
+}
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 57516eb..7a1b518 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
@@ -22,12 +22,17 @@
 
 import org.apache.jena.atlas.iterator.Iter ;
 import org.apache.jena.graph.Node ;
-import org.apache.jena.query.* ;
+import org.apache.jena.graph.Node_Triple;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.ResultSet;
+import org.apache.jena.query.ResultSetFactory;
+import org.apache.jena.query.ResultSetRewindable;
 import org.apache.jena.rdf.model.Model ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.engine.binding.Binding ;
 import org.apache.jena.sparql.engine.binding.BindingUtils ;
 import org.apache.jena.sparql.util.EqualityTest;
+import org.apache.jena.sparql.util.Iso;
 import org.apache.jena.sparql.util.NodeIsomorphismMap ;
 import org.apache.jena.sparql.util.NodeUtils ;
 
@@ -323,10 +328,16 @@
                 return literalTest.equal(n1, n2) ;
             
             if ( n1.isBlank() && n2.isBlank() )
-                return mapping.makeIsomorphic(n1, n2) ;
+                return Iso.nodeIso(n1, n2, mapping);
             
             if ( n1.isVariable() && n2.isVariable() )
                 return mapping.makeIsomorphic(n1, n2) ;
+
+            if ( n1.isNodeTriple() && n2.isNodeTriple() ) {
+                Triple t1 = Node_Triple.triple(n1);
+                Triple t2 = Node_Triple.triple(n2);
+                return  Iso.tripleIso(t1, t2, mapping);
+            }
             
             return false ;
         }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java b/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
index e3a6aa6..ac68e43 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
@@ -237,6 +237,17 @@
     }
 
     @Override
+    public void visit(ElementFind el) {
+        out.print("FIND(");
+        out.print("<< ");
+        formatTriple(el.getTriple());
+        out.print(" >>");
+        out.print(" AS ");
+        out.print("?" + el.getVar().getVarName());
+        out.print(")");
+    }
+
+    @Override
     public void visit(ElementData el) {
         QuerySerializer.outputDataBlock(out, el.getVars(), el.getRows(), context);
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/Tags.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/Tags.java
index 5b90326..071d2df 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/Tags.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/Tags.java
@@ -83,6 +83,7 @@
     public static final String tagDistinct        = "distinct" ;
     public static final String tagReduced         = "reduced" ;
     public static final String tagAssign          = "assign" ;
+    public static final String tagFind            = "find" ;
     public static final String tagExtend          = "extend" ;
     public static final String symAssign          = ":=" ;
     public static final String tagSlice           = "slice" ;
@@ -114,7 +115,6 @@
     public static final String tagExt             = "ext" ;
 
     // Expressions
-    // NB RDF* triple terms use { }. , not << or >>
     // sym => swiggly thing, tag => word-ish thing
 
     public static final String tagExpr            = "expr" ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/builders/BuilderOp.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/builders/BuilderOp.java
index 2382a88..941f8ad 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/builders/BuilderOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/builders/BuilderOp.java
@@ -94,6 +94,7 @@
         addBuild(Tags.tagAssign,        buildAssign) ;
         addBuild(Tags.tagExtend,        buildExtend) ;
         addBuild(Tags.symAssign,        buildAssign) ;
+        addBuild(Tags.tagFind,          buildFind) ;
         addBuild(Tags.tagSlice,         buildSlice) ;
 
         addBuild(Tags.tagTable,         buildTable) ;
@@ -194,41 +195,28 @@
 
     // >>>> ----
     
-    static public interface Build { Op make(ItemList list) ; }
+    @FunctionalInterface
+    public interface Build { Op make(ItemList list) ; }
 
     // Not static.  The initialization through the singleton would not work
     // (static initialization order - these operations would need to go
     // before the singelton. 
     // Or assign null and create object on first call but that breaks add/remove
-    final protected Build buildTable = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
+    final protected Build buildTable = (ItemList list) -> {
             Item t = Item.createList(list) ;
             Table table = BuilderTable.build(t) ; 
             return OpTable.create(table) ;
-        }
     } ;
 
-    final protected Build buildBGP = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BasicPattern triples = buildBGP(list) ;
-            return new OpBGP(triples) ;
-        }
+    final protected Build buildBGP = (ItemList list) ->	{
+		BasicPattern triples = buildBGP(list) ;
+		return new OpBGP(triples) ;
     } ;
 
-    final protected Build buildQuadPattern = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            Node g = null ;
-            BasicPattern bp = new BasicPattern() ;
-            for ( int i = 1 ; i < list.size() ; i++ )
+    final protected Build buildQuadPattern = (ItemList list) -> {
+		Node g = null ;
+		BasicPattern bp = new BasicPattern() ;
+		for ( int i = 1 ; i < list.size() ; i++ )
             {
                 Item item = list.get(i) ;
                 if ( ! item.isList() )
@@ -237,27 +225,22 @@
                 if ( g == null )
                     g = q.getGraph() ;
                 else
-                {
-                    if ( ! g.equals(q.getGraph()) )
-                        BuilderLib.broken(item, "Quad has different graph node in quadapttern: "+q) ;
-                }
+					{
+						if ( ! g.equals(q.getGraph()) )
+							BuilderLib.broken(item, "Quad has different graph node in quadapttern: "+q) ;
+					}
                 bp.add(q.asTriple()) ;
                 
             }
             
-            OpQuadPattern op = new OpQuadPattern(g, bp) ;
-            return op ;
-        }
+		OpQuadPattern op = new OpQuadPattern(g, bp) ;
+		return op ;
     } ;
 
-    final protected Build buildQuadBlock = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            Node g = null ;
-            QuadPattern qp = new QuadPattern() ;
-            for ( int i = 1 ; i < list.size() ; i++ )
+    final protected Build buildQuadBlock = (ItemList list) -> {
+		Node g = null ;
+		QuadPattern qp = new QuadPattern() ;
+		for ( int i = 1 ; i < list.size() ; i++ )
             {
                 Item item = list.get(i) ;
                 if ( ! item.isList() )
@@ -266,62 +249,42 @@
                 qp.add(q) ;
             }
             
-            OpQuadBlock op = new OpQuadBlock(qp) ;
-            return op ;
-        }
+		OpQuadBlock op = new OpQuadBlock(qp) ;
+		return op ;
     } ;
 
 
-    final protected Build buildTriple = new Build(){
-        @Override
-        public Op make(ItemList list)
-        {
-            Triple t = BuilderGraph.buildTriple(list) ;
-            return new OpTriple(t) ;
-        }} ;
+    final protected Build buildTriple = (ItemList list) -> {
+		Triple t = BuilderGraph.buildTriple(list) ;
+		return new OpTriple(t) ;
+	} ;
     
-    final protected Build buildQuad = new Build(){
-        @Override
-        public Op make(ItemList list)
-        {
-            Quad q = BuilderGraph.buildQuad(list) ;
-            return new OpQuad(q) ;
-        }} ;
+    final protected Build buildQuad = (ItemList list) -> {
+		Quad q = BuilderGraph.buildQuad(list) ;
+		return new OpQuad(q) ;
+	} ;
     
-    final protected Build buildTriplePath = new Build(){
-        @Override
-        public Op make(ItemList list)
-        {
-            TriplePath tp = BuilderPath.buildTriplePath(list) ;
-            return new OpPath(tp) ;
-        }} ;
+    final protected Build buildTriplePath = (ItemList list) -> {
+		TriplePath tp = BuilderPath.buildTriplePath(list) ;
+		return new OpPath(tp) ;
+	} ;
     
-    final protected Build buildFilter = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "Malformed filter") ;
-            Item itemExpr = list.get(1) ;
-            Item itemOp = list.get(2) ;
+    final protected Build buildFilter = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "Malformed filter") ;
+		Item itemExpr = list.get(1) ;
+		Item itemOp = list.get(2) ;
 
-            Op op = build(itemOp.getList()) ;
-            ExprList exprList = BuilderExpr.buildExprOrExprList(itemExpr) ;
-            return OpFilter.filterDirect(exprList, op) ;
-        }
+		Op op = build(itemOp.getList()) ;
+		ExprList exprList = BuilderExpr.buildExprOrExprList(itemExpr) ;
+		return OpFilter.filterDirect(exprList, op) ;
     } ;
 
-    final protected Build buildJoin = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "Join") ;
-            Op left = build(list, 1) ;
-            Op right  = build(list, 2) ;
-            Op op = OpJoin.create(left, right) ;
-            return op ;
-        }
+    final protected Build buildJoin = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "Join") ;
+		Op left = build(list, 1) ;
+		Op right  = build(list, 2) ;
+		Op op = OpJoin.create(left, right) ;
+		return op ;
     } ;
 
     // Add all the operations from the list to the OpN
@@ -334,140 +297,91 @@
         }
     }
 
-    final protected Build buildSequence = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLengthAtLeast(2, list, "Sequence") ;
-            OpSequence op = OpSequence.create() ;
-            addOps(op, list) ;
-            return op ;
-        }
+    final protected Build buildSequence = (ItemList list) -> {
+		BuilderLib.checkLengthAtLeast(2, list, "Sequence") ;
+		OpSequence op = OpSequence.create() ;
+		addOps(op, list) ;
+		return op ;
     } ;
     
-    final protected Build buildDisjunction = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLengthAtLeast(2, list, "Disjunction") ;
-            OpDisjunction op = OpDisjunction.create() ;
-            addOps(op, list) ;
-            return op ;
-        }
+    final protected Build buildDisjunction = (ItemList list) -> {
+		BuilderLib.checkLengthAtLeast(2, list, "Disjunction") ;
+		OpDisjunction op = OpDisjunction.create() ;
+		addOps(op, list) ;
+		return op ;
     } ;
 
-    final protected Build buildLeftJoin = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, 4, list, "leftjoin: wanted 2 or 3 arguments") ;
-            Op left = build(list, 1) ;
-            Op right  = build(list, 2) ;
-            ExprList expr = null ;
-            if ( list.size() == 4 )
+    final protected Build buildLeftJoin = (ItemList list) -> {
+		BuilderLib.checkLength(3, 4, list, "leftjoin: wanted 2 or 3 arguments") ;
+		Op left = build(list, 1) ;
+		Op right  = build(list, 2) ;
+		ExprList expr = null ;
+		if ( list.size() == 4 )
             {
                 Item exprItem = list.get(3) ;
                 // Allow empty 
                 if ( exprItem.isList() && exprItem.getList().isEmpty() )
-                {}
+					{}
                 else
                     expr = BuilderExpr.buildExprOrExprList(exprItem) ;
             }
-            Op op = OpLeftJoin.create(left, right, expr) ;
-            return op ;
-        }
+		Op op = OpLeftJoin.create(left, right, expr) ;
+		return op ;
     } ;
 
-    final protected Build buildDiff = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, 4, list, "diff: wanted 2 arguments") ;
-            Op left = build(list, 1) ;
-            Op right  = build(list, 2) ;
-            Op op = OpDiff.create(left, right) ;
-            return op ;
-        }
+    final protected Build buildDiff = (ItemList list) -> {
+		BuilderLib.checkLength(3, 4, list, "diff: wanted 2 arguments") ;
+		Op left = build(list, 1) ;
+		Op right  = build(list, 2) ;
+		Op op = OpDiff.create(left, right) ;
+		return op ;
     } ;
 
-    final protected Build buildMinus = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, 4, list, "minus: wanted 2 arguments") ;
-            Op left = build(list, 1) ;
-            Op right  = build(list, 2) ;
-            Op op = OpMinus.create(left, right) ;
-            return op ;
-        }
+    final protected Build buildMinus = (ItemList list) -> {
+		BuilderLib.checkLength(3, 4, list, "minus: wanted 2 arguments") ;
+		Op left = build(list, 1) ;
+		Op right  = build(list, 2) ;
+		Op op = OpMinus.create(left, right) ;
+		return op ;
     } ;
 
-    final protected Build buildUnion = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "union") ;
-            Op left = build(list, 1) ;
-            Op right  = build(list, 2) ;
-            Op op = new OpUnion(left, right) ;
-            return op ;
-        }
+    final protected Build buildUnion = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "union") ;
+		Op left = build(list, 1) ;
+		Op right  = build(list, 2) ;
+		Op op = new OpUnion(left, right) ;
+		return op ;
     } ;
     
-    final protected Build buildDatasetNames = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, list, Tags.tagDatasetNames) ;
-            Node n = BuilderNode.buildNode(list.get(1)) ;
-            return new OpDatasetNames(n) ;
-        }
+    final protected Build buildDatasetNames = (ItemList list) -> {
+		BuilderLib.checkLength(2, list, Tags.tagDatasetNames) ;
+		Node n = BuilderNode.buildNode(list.get(1)) ;
+		return new OpDatasetNames(n) ;
     } ;
     
-    final protected Build buildConditional = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, 3, list, "condition") ;
-            Op left = build(list, 1) ;
-            // No second argument means unit.
-            Op right = OpTable.unit() ;
-            if ( list.size() != 2 )
-                right  = build(list, 2) ;
-            Op op = new OpConditional(left, right) ;
-            return op ;
-        }
+    final protected Build buildConditional = (ItemList list) -> {
+		BuilderLib.checkLength(2, 3, list, "condition") ;
+		Op left = build(list, 1) ;
+		// No second argument means unit.
+		Op right = OpTable.unit() ;
+		if ( list.size() != 2 )
+			right  = build(list, 2) ;
+		Op op = new OpConditional(left, right) ;
+		return op ;
     } ;
 
-    final protected Build buildGraph = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "graph") ;
-            Node graph = BuilderNode.buildNode(list.get(1)) ;
-            Op sub  = build(list, 2) ;
-            return new OpGraph(graph, sub) ;
-        }
+    final protected Build buildGraph = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "graph") ;
+		Node graph = BuilderNode.buildNode(list.get(1)) ;
+		Op sub  = build(list, 2) ;
+		return new OpGraph(graph, sub) ;
     } ;
 
-    final protected Build buildService = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            boolean silent = false ;
-            BuilderLib.checkLength(3, 4, list, "service") ;
-            list = list.cdr() ;
-            if ( list.size() == 3 )
+    final protected Build buildService = (ItemList list) -> {
+		boolean silent = false ;
+		BuilderLib.checkLength(3, 4, list, "service") ;
+		list = list.cdr() ;
+		if ( list.size() == 3 )
             {
                 if ( !list.car().isSymbol() )
                     BuilderLib.broken(list, "Expected a keyword") ;
@@ -477,49 +391,37 @@
                 list = list.cdr() ;
             }
             
-            Node service = BuilderNode.buildNode(list.car()) ;
-            if ( ! service.isURI() && ! service.isVariable() )
-                BuilderLib.broken(list, "Service must provide a URI or variable") ;
-            list = list.cdr() ;
-            Op sub  = build(list, 0) ;
-            return new OpService(service, sub, silent) ;
-        }
+		Node service = BuilderNode.buildNode(list.car()) ;
+		if ( ! service.isURI() && ! service.isVariable() )
+			BuilderLib.broken(list, "Service must provide a URI or variable") ;
+		list = list.cdr() ;
+		Op sub  = build(list, 0) ;
+		return new OpService(service, sub, silent) ;
     } ;
     
-    final protected Build buildProcedure = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            // (proc <foo> (args) form)
-            BuilderLib.checkLength(4, list, "proc") ;
-            Node procId = BuilderNode.buildNode(list.get(1)) ;
-            if ( ! procId.isURI() )
-                BuilderLib.broken(list, "Procedure name must be a URI") ;
-            ExprList args = BuilderExpr.buildExprOrExprList(list.get(2)) ;
-            Op sub  = build(list, 3) ;
-            return new OpProcedure(procId, args, sub) ;
-        }
+    final protected Build buildProcedure = (ItemList list) -> {
+		// (proc <foo> (args) form)
+		BuilderLib.checkLength(4, list, "proc") ;
+		Node procId = BuilderNode.buildNode(list.get(1)) ;
+		if ( ! procId.isURI() )
+			BuilderLib.broken(list, "Procedure name must be a URI") ;
+		ExprList args = BuilderExpr.buildExprOrExprList(list.get(2)) ;
+		Op sub  = build(list, 3) ;
+		return new OpProcedure(procId, args, sub) ;
+    } ; 
 
-    } ;
-
-    final protected Build buildPropertyFunction = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            // (proc <foo> (subject args) (object args) form)
-            BuilderLib.checkLength(5, list, "propfunc") ;
-            Node property = BuilderNode.buildNode(list.get(1)) ;
+    final protected Build buildPropertyFunction = (ItemList list) -> {
+		// (proc <foo> (subject args) (object args) form)
+		BuilderLib.checkLength(5, list, "propfunc") ;
+		Node property = BuilderNode.buildNode(list.get(1)) ;
             
-            if ( ! property.isURI() )
-                BuilderLib.broken(list, "Property function name must be a URI") ;
+		if ( ! property.isURI() )
+			BuilderLib.broken(list, "Property function name must be a URI") ;
 
-            PropFuncArg subjArg = readPropFuncArg(list.get(2)) ;
-            PropFuncArg objArg = readPropFuncArg(list.get(3)) ;
-            Op sub  = build(list, 4) ;
-            return new OpPropFunc(property, subjArg, objArg, sub) ;
-        }
+		PropFuncArg subjArg = readPropFuncArg(list.get(2)) ;
+		PropFuncArg objArg = readPropFuncArg(list.get(3)) ;
+		Op sub  = build(list, 4) ;
+		return new OpPropFunc(property, subjArg, objArg, sub) ;
     } ;
     
     static final private PropFuncArg readPropFuncArg(Item item)
@@ -532,31 +434,21 @@
         return null ;
     }
 
-    final protected Build buildToList = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, list, "tolist") ;
-            Op sub = build(list, 1) ;
-            Op op = new OpList(sub) ;
-            return op ;
-        }
+    final protected Build buildToList = (ItemList list) -> {
+		BuilderLib.checkLength(2, list, "tolist") ;
+		Op sub = build(list, 1) ;
+		Op op = new OpList(sub) ;
+		return op ;
     } ;
 
 
-    final protected Build buildGroupBy = new Build()
-    {
-        // See buildProject
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, 4, list,  "Group") ;
-            // GroupBy
-            VarExprList vars = BuilderExpr.buildNamedExprList(list.get(1).getList()) ;
-            List<ExprAggregator> aggregators = new ArrayList<>() ;
+    final protected Build buildGroupBy = (ItemList list) ->{
+		BuilderLib.checkLength(3, 4, list,  "Group") ;
+		// GroupBy
+		VarExprList vars = BuilderExpr.buildNamedExprList(list.get(1).getList()) ;
+		List<ExprAggregator> aggregators = new ArrayList<>() ;
             
-            if ( list.size() == 4 )
+		if ( list.size() == 4 )
             {
                 // Aggregations : assume that the exprs are legal.
                 VarExprList y = BuilderExpr.buildNamedExprList(list.get(2).getList()) ;
@@ -567,45 +459,38 @@
                 // Remember to process in order that VarExprList keeps the variables.
                 
                 for ( Var aggVar : y.getVars() )
-                {
-                    Expr e = y.getExpr(aggVar) ;
-                    if ( ! ( e instanceof ExprAggregator ) )
-                        BuilderLib.broken(list, "Not a aggregate expression: "+e) ;
-                    ExprAggregator eAgg = (ExprAggregator)e ;
-                    eAgg.setVar(aggVar) ;
-                    aggregators.add(eAgg) ;    
-                }
+					{
+						Expr e = y.getExpr(aggVar) ;
+						if ( ! ( e instanceof ExprAggregator ) )
+							BuilderLib.broken(list, "Not a aggregate expression: "+e) ;
+						ExprAggregator eAgg = (ExprAggregator)e ;
+						eAgg.setVar(aggVar) ;
+						aggregators.add(eAgg) ;    
+					}
             }
             
-            Op sub = build(list, list.size()-1) ;
-            Op op = OpGroup.create(sub,vars, aggregators) ;
-            return op ;
-        }
+		Op sub = build(list, list.size()-1) ;
+		Op op = OpGroup.create(sub,vars, aggregators) ;
+		return op ;
     } ;
 
-
-    final protected Build buildOrderBy = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list,  "Order") ;
-            ItemList conditions = list.get(1).getList() ;
+    final protected Build buildOrderBy = (ItemList list) -> {
+		BuilderLib.checkLength(3, list,  "Order") ;
+		ItemList conditions = list.get(1).getList() ;
             
-            // Maybe tagged (asc, desc or a raw expression)
-            List<SortCondition> x = new ArrayList<>() ;
+		// Maybe tagged (asc, desc or a raw expression)
+		List<SortCondition> x = new ArrayList<>() ;
             
-            for ( int i = 0 ; i < conditions.size() ; i++ )
+		for ( int i = 0 ; i < conditions.size() ; i++ )
             {
                 //int direction = Query.ORDER_DEFAULT ;
                 Item item = conditions.get(i) ;
                 SortCondition sc = scBuilder(item) ;
                 x.add(sc) ;
             }
-            Op sub = build(list, 2) ;
-            Op op = new OpOrder(sub, x) ;
-            return op ;
-        }
+		Op sub = build(list, 2) ;
+		Op op = new OpOrder(sub, x) ;
+		return op ;
     } ;
 
     SortCondition scBuilder(Item item)
@@ -628,172 +513,139 @@
             return new SortCondition(expr, direction) ;
     }
     
-    final protected Build buildTopN = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list,  Tags.tagTopN) ;
-            int N = BuilderNode.buildInt(list.get(1).getList(), 0, -1) ;
-            ItemList conditions = list.get(1).getList().cdr() ;
+    final protected Build buildTopN = (ItemList list) -> {
+		BuilderLib.checkLength(3, list,  Tags.tagTopN) ;
+		int N = BuilderNode.buildInt(list.get(1).getList(), 0, -1) ;
+		ItemList conditions = list.get(1).getList().cdr() ;
             
-            // Maybe tagged (asc, desc or a raw expression)
-            List<SortCondition> x = new ArrayList<>() ;
+		// Maybe tagged (asc, desc or a raw expression)
+		List<SortCondition> x = new ArrayList<>() ;
             
-            for ( int i = 0 ; i < conditions.size() ; i++ )
+		for ( int i = 0 ; i < conditions.size() ; i++ )
             {
                 //int direction = Query.ORDER_DEFAULT ;
                 Item item = conditions.get(i) ;
                 SortCondition sc = scBuilder(item) ;
                 x.add(sc) ;
             }
-            Op sub = build(list, 2) ;
-            Op op = new OpTopN(sub, N, x) ;
-            return op ;
-        }
+		Op sub = build(list, 2) ;
+		Op op = new OpTopN(sub, N, x) ;
+		return op ;
     } ;
-
     
-    final protected Build buildProject = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "project") ;
-            Item item1 = list.get(1);
-            List<Var> x = null;
-            if ( item1.isList() ) {
-                x = BuilderNode.buildVars(list.get(1).getList()) ; 
-            } else if ( list.get(1).isVar() ) {
-                Var var = BuilderNode.buildVar(item1);
-                x = Collections.singletonList(var);
-            } else 
-                BuilderLib.broken("Not a list of variable for project: "+list.get(1)) ;
-            Op sub = build(list, 2) ;
-            return new OpProject(sub, x) ;
-        }
+    final protected Build buildProject = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "project") ;
+		Item item1 = list.get(1);
+		List<Var> x = null;
+		if ( item1.isList() ) {
+			x = BuilderNode.buildVars(list.get(1).getList()) ; 
+		} else if ( list.get(1).isVar() ) {
+			Var var = BuilderNode.buildVar(item1);
+			x = Collections.singletonList(var);
+		} else 
+			BuilderLib.broken("Not a list of variable for project: "+list.get(1)) ;
+		Op sub = build(list, 2) ;
+		return new OpProject(sub, x) ;
     } ;
-
     
-    final protected Build buildDistinct = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, list, "distinct") ;
-            Op sub = build(list, 1) ;
-            return OpDistinct.create(sub) ;
-        }
+    final protected Build buildDistinct = (ItemList list) -> {
+		BuilderLib.checkLength(2, list, "distinct") ;
+		Op sub = build(list, 1) ;
+		return OpDistinct.create(sub) ;
     } ;
 
-    final protected Build buildReduced = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, list, "reduced") ;
-            Op sub = build(list, 1) ;
-            return OpReduced.create(sub) ;
-        }
+    final protected Build buildReduced = (ItemList list) -> {
+		BuilderLib.checkLength(2, list, "reduced") ;
+		Op sub = build(list, 1) ;
+		return OpReduced.create(sub) ;
     } ;
 
-    final protected Build buildAssign = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(3, list, "assign") ;
-            VarExprList x = BuilderExpr.buildNamedExprOrExprList(list.get(1)) ; 
-            Op sub ; 
-            if ( list.size() == 2 )
-                sub = OpTable.unit() ;
-            else
-                sub = build(list, 2) ;
-            return OpAssign.create(sub, x) ;
-        }
+    final protected Build buildAssign = (ItemList list) -> {
+		BuilderLib.checkLength(3, list, "assign") ;
+		VarExprList x = BuilderExpr.buildNamedExprOrExprList(list.get(1)) ; 
+		Op sub ; 
+		if ( list.size() == 2 )
+			sub = OpTable.unit() ;
+		else
+			sub = build(list, 2) ;
+		return OpAssign.create(sub, x) ;
     } ;
 
-    final protected Build buildExtend = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, 3, list, "extend") ;
-            VarExprList x = BuilderExpr.buildNamedExprOrExprList(list.get(1)) ;
-            Op sub ; 
-            if ( list.size() == 2 )
-                sub = OpTable.unit() ;
-            else
-                sub = build(list, 2) ;
-            return OpExtend.create(sub, x) ;
-        }
+    final protected Build buildExtend = (ItemList list) -> {
+		BuilderLib.checkLength(2, 3, list, "extend") ;
+		VarExprList x = BuilderExpr.buildNamedExprOrExprList(list.get(1)) ;
+		Op sub ; 
+		if ( list.size() == 2 )
+			sub = OpTable.unit() ;
+		else
+			sub = build(list, 2) ;
+		return OpExtend.create(sub, x) ;
+    } ;
+    
+    final protected Build buildFind = list -> {
+        BuilderLib.checkLength(3, list, "find") ;
+        // Var
+        Item item1 = list.get(1); // var
+        Var var = BuilderNode.buildVar(item1);
+        // Triple
+        Item tItem = list.get(2);
+        BuilderLib.checkList(tItem);
+        Triple triple = BuilderGraph.buildTriple(tItem.getList()) ;
+        
+        return new OpFind(triple, var);
+    };
+
+    final protected Build buildSlice = list -> {
+        BuilderLib.checkLength(4, list, "slice") ;
+        long start = BuilderNode.buildLong(list, 1, -1) ;
+        long length = BuilderNode.buildLong(list, 2, -1) ;
+
+        if ( start == -1 )
+            start = Query.NOLIMIT ;
+        if ( length == -1 )
+            length = Query.NOLIMIT ;
+
+        Op sub = build(list, 3) ;
+        return new OpSlice(sub, start, length) ;
+    };
+
+
+    final protected Build buildNull = (ItemList list) -> {
+		BuilderLib.checkLength(1, list, Tags.tagNull) ;
+		return OpNull.create() ;
     } ;
 
-    final protected Build buildSlice = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(4, list, "slice") ;
-            long start = BuilderNode.buildLong(list, 1, -1) ;
-            long length = BuilderNode.buildLong(list, 2, -1) ;
-
-            if ( start == -1 )
-                start = Query.NOLIMIT ;
-            if ( length == -1 )
-                length = Query.NOLIMIT ;
-
-            Op sub = build(list, 3) ;
-            return new OpSlice(sub, start, length) ;
-        }
-    } ;
-
-    final protected Build buildNull = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(1, list, Tags.tagNull) ;
-            return OpNull.create() ;
-        }
-    } ;
-
-    final protected Build buildLabel = new Build()
-    {
-        @Override
-        public Op make(ItemList list)
-        {
-            BuilderLib.checkLength(2, 3, list, Tags.tagLabel) ;
-            Item label = list.get(1) ;
-            Object str = null ;
-            if ( label.isSymbol() )
-                str = label.getSymbol() ;
-            else if ( label.isNode() )
+    final protected Build buildLabel = (ItemList list) -> {
+		BuilderLib.checkLength(2, 3, list, Tags.tagLabel) ;
+		Item label = list.get(1) ;
+		Object str = null ;
+		if ( label.isSymbol() )
+			str = label.getSymbol() ;
+		else if ( label.isNode() )
             {
                 if ( label.getNode().isLiteral() )
-                {
-                    if ( label.getNode().getLiteralLanguage() == null ||
-                        label.getNode().getLiteralLanguage().equals("") )
-                    str = label.getNode().getLiteralLexicalForm() ;
-                }
+					{
+						if ( label.getNode().getLiteralLanguage() == null ||
+							 label.getNode().getLiteralLanguage().equals("") )
+							str = label.getNode().getLiteralLexicalForm() ;
+					}
                 else
                     str = label.getNode() ;
             }
-            else
-                BuilderLib.broken("No a symbol or a node") ;
+		else
+			BuilderLib.broken("No a symbol or a node") ;
             
-            if ( str == null )
-                str = label.toString() ;
+		if ( str == null )
+			str = label.toString() ;
             
-            Op op = null ;
+		Op op = null ;
             
-            if ( list.size() == 3 )
-                op = build(list, 2) ;
-            return OpLabel.create(str, op) ;
-//            if ( op == null )
-//                return new OpLabel(str) ;
-//            else
-//                return new OpLabel(str , op) ;
-        }
+		if ( list.size() == 3 )
+			op = build(list, 2) ;
+		return OpLabel.create(str, op) ;
+		//            if ( op == null )
+		//                return new OpLabel(str) ;
+		//            else
+		//                return new OpLabel(str , op) ;
     } ;
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCore.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCore.java
index e99eb96..6b447d6 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCore.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCore.java
@@ -68,7 +68,7 @@
     case STRING_LITERAL2:
     case STRING_LITERAL_LONG1:
     case STRING_LITERAL_LONG2:
-    case LBRACE:
+    case LT2:
     case SYMBOL:{
       Term();
       label_2:
@@ -192,8 +192,8 @@
       case STRING_LITERAL_LONG1:
       case STRING_LITERAL_LONG2:
       case LPAREN:
-      case LBRACE:
       case LBRACKET:
+      case LT2:
       case SYMBOL:{
         ;
         break;
@@ -224,7 +224,7 @@
     case STRING_LITERAL2:
     case STRING_LITERAL_LONG1:
     case STRING_LITERAL_LONG2:
-    case LBRACE:{
+    case LT2:{
       RDFTerm();
       break;
       }
@@ -264,7 +264,7 @@
       BlankNode();
       break;
       }
-    case LBRACE:{
+    case LT2:{
       TripleTerm();
       break;
       }
@@ -339,7 +339,7 @@
   }
 
   final public void TripleTerm() throws ParseException {Token t1 = null ; Token t2 = null ;
-    t1 = jj_consume_token(LBRACE);
+    t1 = jj_consume_token(LT2);
     label_8:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -396,7 +396,7 @@
       }
       jj_consume_token(WS);
     }
-    t2 = jj_consume_token(RBRACE);
+    t2 = jj_consume_token(GT2);
 tripleTermFinish(t2.beginLine, t2.beginColumn);
   }
 
@@ -515,10 +515,10 @@
       jj_la1_init_1();
    }
    private static void jj_la1_init_0() {
-      jj_la1_0 = new int[] {0x2,0x2,0x2be1df0,0x2,0x2,0x2,0x2,0x2200000,0x2be1df0,0x9e1df0,0x9e1df0,0x180,0x1e1c00,0x2,0x2,0x2,0x2,0x1e0000,0x30,0x18000000,0x18000000,0x1c00,};
+      jj_la1_0 = new int[] {0x2,0x2,0xa3e1df0,0x2,0x2,0x2,0x2,0x2200000,0xa3e1df0,0x81e1df0,0x81e1df0,0x180,0x1e1c00,0x2,0x2,0x2,0x2,0x1e0000,0x30,0x60000000,0x60000000,0x1c00,};
    }
    private static void jj_la1_init_1() {
-      jj_la1_1 = new int[] {0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x200,0x200,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_1 = new int[] {0x0,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x800,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
 
   /** Constructor with InputStream. */
@@ -635,7 +635,7 @@
   /** Generate ParseException. */
   public ParseException generateParseException() {
     jj_expentries.clear();
-    boolean[] la1tokens = new boolean[43];
+    boolean[] la1tokens = new boolean[45];
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
@@ -652,7 +652,7 @@
         }
       }
     }
-    for (int i = 0; i < 43; i++) {
+    for (int i = 0; i < 45; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreConstants.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreConstants.java
index 596ef29..5a82a1f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreConstants.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreConstants.java
@@ -80,37 +80,41 @@
   /** RegularExpression Id. */
   int RBRACKET = 26;
   /** RegularExpression Id. */
-  int DATATYPE = 27;
+  int LT2 = 27;
   /** RegularExpression Id. */
-  int LANGTAG = 28;
+  int GT2 = 28;
   /** RegularExpression Id. */
-  int AT = 29;
+  int DATATYPE = 29;
   /** RegularExpression Id. */
-  int A2Z = 30;
+  int LANGTAG = 30;
   /** RegularExpression Id. */
-  int A2ZN = 31;
+  int AT = 31;
   /** RegularExpression Id. */
-  int PN_CHARS_BASE = 32;
+  int A2Z = 32;
   /** RegularExpression Id. */
-  int PN_CHARS_U = 33;
+  int A2ZN = 33;
   /** RegularExpression Id. */
-  int PN_CHARS = 34;
+  int PN_CHARS_BASE = 34;
   /** RegularExpression Id. */
-  int PN_PREFIX = 35;
+  int PN_CHARS_U = 35;
   /** RegularExpression Id. */
-  int PN_LOCAL = 36;
+  int PN_CHARS = 36;
   /** RegularExpression Id. */
-  int VARNAME = 37;
+  int PN_PREFIX = 37;
   /** RegularExpression Id. */
-  int SYM = 38;
+  int PN_LOCAL = 38;
   /** RegularExpression Id. */
-  int SYM1 = 39;
+  int VARNAME = 39;
   /** RegularExpression Id. */
-  int SYM_ESC = 40;
+  int SYM = 40;
   /** RegularExpression Id. */
-  int SYMBOL = 41;
+  int SYM1 = 41;
   /** RegularExpression Id. */
-  int UNKNOWN = 42;
+  int SYM_ESC = 42;
+  /** RegularExpression Id. */
+  int SYMBOL = 43;
+  /** RegularExpression Id. */
+  int UNKNOWN = 44;
 
   /** Lexical state. */
   int DEFAULT = 0;
@@ -144,6 +148,8 @@
     "\"}\"",
     "\"[\"",
     "\"]\"",
+    "\"<<\"",
+    "\">>\"",
     "\"^^\"",
     "<LANGTAG>",
     "\"@\"",
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreTokenManager.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreTokenManager.java
index 86705f4..249bb45 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreTokenManager.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/lang/parser/SSE_ParserCoreTokenManager.java
@@ -30,6 +30,18 @@
 private final int jjStopStringLiteralDfa_0(int pos, long active0){
    switch (pos)
    {
+      case 0:
+         if ((active0 & 0x8000000L) != 0L)
+         {
+            jjmatchedKind = 43;
+            return 94;
+         }
+         if ((active0 & 0x10000000L) != 0L)
+         {
+            jjmatchedKind = 43;
+            return 66;
+         }
+         return -1;
       default :
          return -1;
    }
@@ -50,12 +62,16 @@
          return jjStopAtPos(0, 21);
       case 41:
          return jjStopAtPos(0, 22);
+      case 60:
+         return jjMoveStringLiteralDfa1_0(0x8000000L);
+      case 62:
+         return jjMoveStringLiteralDfa1_0(0x10000000L);
       case 91:
          return jjStopAtPos(0, 25);
       case 93:
          return jjStopAtPos(0, 26);
       case 94:
-         return jjMoveStringLiteralDfa1_0(0x8000000L);
+         return jjMoveStringLiteralDfa1_0(0x20000000L);
       case 123:
          return jjStopAtPos(0, 23);
       case 125:
@@ -72,10 +88,18 @@
    }
    switch(curChar)
    {
-      case 94:
+      case 60:
          if ((active0 & 0x8000000L) != 0L)
             return jjStopAtPos(1, 27);
          break;
+      case 62:
+         if ((active0 & 0x10000000L) != 0L)
+            return jjStopAtPos(1, 28);
+         break;
+      case 94:
+         if ((active0 & 0x20000000L) != 0L)
+            return jjStopAtPos(1, 29);
+         break;
       default :
          break;
    }
@@ -120,7 +144,7 @@
 private int jjMoveNfa_0(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 93;
+   jjnewStateCnt = 94;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -135,12 +159,27 @@
          {
             switch(jjstateSet[--i])
             {
+               case 94:
+                  if ((0xaffffc7affffc9ffL & l) != 0L)
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
+                  }
+                  else if (curChar == 62)
+                  {
+                     if (kind > 4)
+                        kind = 4;
+                  }
+                  if ((0xaffffffe00000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(12, 13); }
+                  break;
                case 0:
                   if ((0xfffffc7affffc9ffL & l) != 0L)
                   {
-                     if (kind > 41)
-                        kind = 41;
-                     { jjCheckNAdd(65); }
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
                   }
                   else if ((0x100003600L & l) != 0L)
                   {
@@ -159,8 +198,13 @@
                   }
                   else if ((0x280000000000L & l) != 0L)
                      { jjCheckNAddStates(7, 10); }
+                  else if ((0x5000000000000000L & l) != 0L)
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                  }
                   else if (curChar == 46)
-                     { jjCheckNAddTwoStates(76, 89); }
+                     { jjCheckNAddTwoStates(77, 90); }
                   else if (curChar == 34)
                      { jjCheckNAddStates(11, 13); }
                   else if (curChar == 39)
@@ -171,8 +215,6 @@
                         kind = 5;
                      jjstateSet[jjnewStateCnt++] = 18;
                   }
-                  else if (curChar == 60)
-                     { jjCheckNAddTwoStates(12, 13); }
                   else if (curChar == 59)
                   {
                      if (kind > 3)
@@ -189,8 +231,10 @@
                   {
                      if (kind > 7)
                         kind = 7;
-                     { jjCheckNAddTwoStates(67, 69); }
+                     { jjCheckNAddTwoStates(68, 70); }
                   }
+                  if (curChar == 60)
+                     { jjCheckNAddTwoStates(12, 13); }
                   break;
                case 1:
                   if (curChar != 35)
@@ -425,143 +469,153 @@
                case 63:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 30)
+                     kind = 30;
                   { jjCheckNAddTwoStates(62, 63); }
                   break;
                case 64:
+                  if ((0x5000000000000000L & l) != 0L && kind > 43)
+                     kind = 43;
+                  break;
                case 65:
                   if ((0xfffffc7affffc9ffL & l) == 0L)
                      break;
-                  if (kind > 41)
-                     kind = 41;
-                  { jjCheckNAdd(65); }
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
                   break;
                case 66:
+                  if ((0xaffffc7affffc9ffL & l) == 0L)
+                     break;
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
+                  break;
+               case 67:
                   if (curChar != 63)
                      break;
                   if (kind > 7)
                      kind = 7;
-                  { jjCheckNAddTwoStates(67, 69); }
+                  { jjCheckNAddTwoStates(68, 70); }
                   break;
-               case 67:
                case 68:
+               case 69:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 7)
                      kind = 7;
-                  { jjCheckNAdd(68); }
-                  break;
-               case 69:
-                  if ((0xfffffc7affffc9ffL & l) == 0L)
-                     break;
-                  if (kind > 8)
-                     kind = 8;
                   { jjCheckNAdd(69); }
                   break;
                case 70:
+                  if ((0xaffffc7affffc9ffL & l) == 0L)
+                     break;
+                  if (kind > 8)
+                     kind = 8;
+                  { jjCheckNAdd(70); }
+                  break;
+               case 71:
                   if ((0x280000000000L & l) != 0L)
                      { jjCheckNAddStates(7, 10); }
                   break;
-               case 71:
+               case 72:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 10)
                      kind = 10;
-                  { jjCheckNAdd(71); }
-                  break;
-               case 72:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     { jjCheckNAddTwoStates(72, 73); }
+                  { jjCheckNAdd(72); }
                   break;
                case 73:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(73, 74); }
+                  break;
+               case 74:
                   if (curChar != 46)
                      break;
                   if (kind > 11)
                      kind = 11;
-                  { jjCheckNAdd(74); }
-                  break;
-               case 74:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 11)
-                     kind = 11;
-                  { jjCheckNAdd(74); }
+                  { jjCheckNAdd(75); }
                   break;
                case 75:
-                  if (curChar == 46)
-                     { jjCheckNAdd(76); }
-                  break;
-               case 76:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 11)
                      kind = 11;
-                  { jjCheckNAdd(76); }
+                  { jjCheckNAdd(75); }
+                  break;
+               case 76:
+                  if (curChar == 46)
+                     { jjCheckNAdd(77); }
                   break;
                case 77:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     { jjCheckNAddTwoStates(77, 78); }
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 11)
+                     kind = 11;
+                  { jjCheckNAdd(77); }
                   break;
                case 78:
-                  if (curChar == 46)
-                     { jjCheckNAddTwoStates(79, 80); }
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(78, 79); }
                   break;
                case 79:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     { jjCheckNAddTwoStates(79, 80); }
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(80, 81); }
                   break;
-               case 81:
-                  if ((0x280000000000L & l) != 0L)
-                     { jjCheckNAdd(82); }
+               case 80:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(80, 81); }
                   break;
                case 82:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(83); }
+                  break;
+               case 83:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 12)
                      kind = 12;
-                  { jjCheckNAdd(82); }
+                  { jjCheckNAdd(83); }
                   break;
-               case 83:
+               case 84:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 10)
                      kind = 10;
                   { jjCheckNAddStates(0, 6); }
                   break;
-               case 84:
+               case 85:
                   if ((0x3ff000000000000L & l) != 0L)
-                     { jjCheckNAddTwoStates(84, 85); }
-                  break;
-               case 86:
-                  if ((0x280000000000L & l) != 0L)
-                     { jjCheckNAdd(87); }
+                     { jjCheckNAddTwoStates(85, 86); }
                   break;
                case 87:
-                  if ((0x3ff000000000000L & l) == 0L)
-                     break;
-                  if (kind > 12)
-                     kind = 12;
-                  { jjCheckNAdd(87); }
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(88); }
                   break;
                case 88:
-                  if (curChar == 46)
-                     { jjCheckNAddTwoStates(76, 89); }
-                  break;
-               case 89:
-                  if ((0x3ff000000000000L & l) != 0L)
-                     { jjCheckNAddTwoStates(89, 90); }
-                  break;
-               case 91:
-                  if ((0x280000000000L & l) != 0L)
-                     { jjCheckNAdd(92); }
-                  break;
-               case 92:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
                   if (kind > 12)
                      kind = 12;
-                  { jjCheckNAdd(92); }
+                  { jjCheckNAdd(88); }
+                  break;
+               case 89:
+                  if (curChar == 46)
+                     { jjCheckNAddTwoStates(77, 90); }
+                  break;
+               case 90:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     { jjCheckNAddTwoStates(90, 91); }
+                  break;
+               case 92:
+                  if ((0x280000000000L & l) != 0L)
+                     { jjCheckNAdd(93); }
+                  break;
+               case 93:
+                  if ((0x3ff000000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  { jjCheckNAdd(93); }
                   break;
                default : break;
             }
@@ -574,12 +628,21 @@
          {
             switch(jjstateSet[--i])
             {
+               case 94:
+                  { jjCheckNAddTwoStates(12, 13); }
+                  if ((0xd7ffffffd7ffffffL & l) != 0L)
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
+                  }
+                  break;
                case 0:
                   if ((0xd7ffffff97fffffeL & l) != 0L)
                   {
-                     if (kind > 41)
-                        kind = 41;
-                     { jjCheckNAdd(65); }
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
                   }
                   else if (curChar == 64)
                      { jjCheckNAdd(61); }
@@ -601,7 +664,7 @@
                   { jjAddStates(17, 19); }
                   break;
                case 12:
-                  { jjAddStates(40, 41); }
+                  { jjCheckNAddTwoStates(12, 13); }
                   break;
                case 14:
                   if ((0x7fffffe07fffffeL & l) != 0L)
@@ -712,58 +775,58 @@
                case 61:
                   if ((0x7fffffe07fffffeL & l) == 0L)
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 30)
+                     kind = 30;
                   { jjCheckNAddTwoStates(61, 62); }
                   break;
                case 63:
                   if ((0x7fffffe07fffffeL & l) == 0L)
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 30)
+                     kind = 30;
                   { jjCheckNAddTwoStates(62, 63); }
                   break;
-               case 64:
+               case 65:
                   if ((0xd7ffffff97fffffeL & l) == 0L)
                      break;
-                  if (kind > 41)
-                     kind = 41;
-                  { jjCheckNAdd(65); }
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
                   break;
-               case 65:
+               case 66:
                   if ((0xd7ffffffd7ffffffL & l) == 0L)
                      break;
-                  if (kind > 41)
-                     kind = 41;
-                  { jjCheckNAdd(65); }
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
                   break;
-               case 67:
                case 68:
+               case 69:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
                   if (kind > 7)
                      kind = 7;
-                  { jjCheckNAdd(68); }
+                  { jjCheckNAdd(69); }
                   break;
-               case 69:
+               case 70:
                   if ((0xd7ffffffd7ffffffL & l) == 0L)
                      break;
                   if (kind > 8)
                      kind = 8;
-                  jjstateSet[jjnewStateCnt++] = 69;
+                  jjstateSet[jjnewStateCnt++] = 70;
                   break;
-               case 80:
+               case 81:
+                  if ((0x2000000020L & l) != 0L)
+                     { jjAddStates(40, 41); }
+                  break;
+               case 86:
                   if ((0x2000000020L & l) != 0L)
                      { jjAddStates(42, 43); }
                   break;
-               case 85:
+               case 91:
                   if ((0x2000000020L & l) != 0L)
                      { jjAddStates(44, 45); }
                   break;
-               case 90:
-                  if ((0x2000000020L & l) != 0L)
-                     { jjAddStates(46, 47); }
-                  break;
                default : break;
             }
          } while(i != startsAt);
@@ -779,14 +842,24 @@
          {
             switch(jjstateSet[--i])
             {
+               case 94:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(12, 13); }
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                  {
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
+                  }
+                  break;
                case 0:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
                      { jjCheckNAddStates(37, 39); }
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 41)
-                        kind = 41;
-                     { jjCheckNAdd(65); }
+                     if (kind > 43)
+                        kind = 43;
+                     { jjCheckNAdd(66); }
                   }
                   break;
                case 2:
@@ -805,7 +878,7 @@
                   break;
                case 12:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     { jjAddStates(40, 41); }
+                     { jjCheckNAddTwoStates(12, 13); }
                   break;
                case 14:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
@@ -865,34 +938,40 @@
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                      { jjAddStates(31, 34); }
                   break;
-               case 64:
                case 65:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 41)
-                     kind = 41;
-                  { jjCheckNAdd(65); }
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
                   break;
-               case 67:
+               case 66:
+                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 43)
+                     kind = 43;
+                  { jjCheckNAdd(66); }
+                  break;
+               case 68:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 7)
                      kind = 7;
-                  { jjCheckNAdd(68); }
+                  { jjCheckNAdd(69); }
                   break;
-               case 68:
+               case 69:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 7)
                      kind = 7;
-                  { jjCheckNAdd(68); }
+                  { jjCheckNAdd(69); }
                   break;
-               case 69:
+               case 70:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 8)
                      kind = 8;
-                  jjstateSet[jjnewStateCnt++] = 69;
+                  jjstateSet[jjnewStateCnt++] = 70;
                   break;
                default : if (i1 == 0 || l1 == 0 || i2 == 0 ||  l2 == 0) break; else break;
             }
@@ -905,16 +984,16 @@
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 93 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 94 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
    }
 }
 static final int[] jjnextStates = {
-   71, 72, 73, 77, 78, 84, 85, 71, 72, 75, 77, 34, 35, 37, 29, 30, 
+   72, 73, 74, 78, 79, 85, 86, 72, 73, 76, 78, 34, 35, 37, 29, 30, 
    32, 7, 8, 10, 2, 3, 5, 15, 16, 39, 40, 41, 43, 44, 46, 50, 
-   51, 52, 54, 55, 57, 15, 16, 17, 12, 13, 81, 82, 86, 87, 91, 92, 
+   51, 52, 54, 55, 57, 15, 16, 17, 82, 83, 87, 88, 92, 93, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
 {
@@ -981,8 +1060,8 @@
 public static final String[] jjstrLiteralImages = {
 "", null, null, null, null, null, null, null, null, null, null, null, null, 
 null, null, null, null, null, null, null, null, "\50", "\51", "\173", "\175", 
-"\133", "\135", "\136\136", null, null, null, null, null, null, null, null, null, null, 
-null, null, null, null, null, };
+"\133", "\135", "\74\74", "\76\76", "\136\136", null, null, null, null, null, null, 
+null, null, null, null, null, null, null, null, null, };
 protected Token jjFillToken()
 {
    final Token t;
@@ -1144,7 +1223,7 @@
   {
     int i;
     jjround = 0x80000001;
-    for (i = 93; i-- > 0;)
+    for (i = 94; i-- > 0;)
       jjrounds[i] = 0x80000000;
   }
 
@@ -1169,7 +1248,7 @@
    "DEFAULT",
 };
 static final long[] jjtoToken = {
-   0x2001fff1df3L, 
+   0x8007fff1df3L, 
 };
 static final long[] jjtoSkip = {
    0xcL, 
@@ -1179,8 +1258,8 @@
 };
     protected JavaCharStream  input_stream;
 
-    private final int[] jjrounds = new int[93];
-    private final int[] jjstateSet = new int[2 * 93];
+    private final int[] jjrounds = new int[94];
+    private final int[] jjstateSet = new int[2 * 94];
 
     
     protected char curChar;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterNode.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterNode.java
index 21582e3..8332e9f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterNode.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterNode.java
@@ -91,14 +91,13 @@
     {
         if ( node.isNodeTriple() ) {
             Triple t = Node_Triple.triple(node);
-            // special syntax.
-            out.print("{ ");
+            out.print("<< ");
             output(out, t.getSubject(), naming);
             out.print(" ");
             output(out, t.getPredicate(), naming);
             out.print(" ");
             output(out, t.getObject(), naming);
-            out.print(" }");
+            out.print(" >>");
         } else
             out.print(FmtUtils.stringForNode(node, naming)) ;
     }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterOp.java b/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterOp.java
index c8ff308..9779d85 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/sse/writers/WriterOp.java
@@ -235,6 +235,15 @@
         }
 
         @Override
+        public void visit(OpFind opFind) {
+            start(opFind, NoNL) ;
+            out.print(opFind.getVar());
+            out.print(" ");
+            formatTriple(opFind.getTriple()) ;
+            finish(opFind) ;
+        }
+
+        @Override
         public void visit(OpProcedure opProc) {
             start(opProc, NoNL) ;
             WriterNode.output(out, opProc.getProcId(), sContext) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementFind.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementFind.java
new file mode 100644
index 0000000..b82b302
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementFind.java
@@ -0,0 +1,77 @@
+/*
+ * 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 org.apache.jena.sparql.syntax;
+
+import java.util.Objects;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Node_Triple;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.ARQException;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.util.NodeIsomorphismMap;
+
+public class ElementFind extends Element {
+    private final Var  var;
+    private final Triple triple;
+
+    public ElementFind(Var v, Node node) {
+        Objects.requireNonNull(node);
+        if ( ! node.isNodeTriple() ) {
+            throw new ARQException("Not a triple term: "+node); 
+        }
+        this.var = v;
+        this.triple = Node_Triple.triple(node);
+    }
+
+    public ElementFind(Var v, Triple triple) {
+        this.var = Objects.requireNonNull(v);
+        this.triple = Objects.requireNonNull(triple);
+    }
+
+    public Var getVar() {
+        return var;
+    }
+
+    public Triple getTriple() {
+        return triple;
+    }
+
+    @Override
+    public boolean equalTo(Element el2, NodeIsomorphismMap isoMap) {
+        if ( !(el2 instanceof ElementFind) )
+            return false;
+        ElementFind f2 = (ElementFind)el2;
+        if ( !this.getVar().equals(f2.getVar()) )
+            return false;
+        if ( !this.getTriple().equals(f2.getTriple()) )
+            return false;
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return var.hashCode() ^ triple.hashCode();
+    }
+
+    @Override
+    public void visit(ElementVisitor v) {
+        v.visit(this);
+    }
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitor.java
index c1e7cf1..fa7929d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitor.java
@@ -25,6 +25,7 @@
     public void visit(ElementFilter el) ;
     public void visit(ElementAssign el) ;
     public void visit(ElementBind el) ;
+    public void visit(ElementFind el) ;
     public void visit(ElementData el) ;
     public void visit(ElementUnion el) ;
     public void visit(ElementOptional el) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitorBase.java
index 0e3e445..93bd298 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementVisitorBase.java
@@ -37,6 +37,9 @@
     public void visit(ElementBind el)           { }
 
     @Override
+    public void visit(ElementFind el)           { }
+
+    @Override
     public void visit(ElementData el)           { }
 
     @Override
@@ -56,16 +59,16 @@
 
     @Override
     public void visit(ElementExists el)         { }
-    
+
     @Override
     public void visit(ElementNotExists el)      { }
-    
+
     @Override
     public void visit(ElementMinus el)          { }
 
     @Override
     public void visit(ElementService el)        { }
-    
+
     @Override
     public void visit(ElementSubQuery el)       { }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementWalker.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementWalker.java
index 36c0434..74bd54c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementWalker.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementWalker.java
@@ -50,26 +50,26 @@
         protected final ElementVisitor proc ;
         protected final ElementVisitor beforeVisitor ;
         protected final ElementVisitor afterVisitor ;
-        
+
         protected EltWalker(ElementVisitor visitor, ElementVisitor beforeVisitor, ElementVisitor afterVisitor)
         { 
             proc = visitor ;
             this.beforeVisitor= beforeVisitor ; 
             this.afterVisitor = afterVisitor ;
         }
-        
+
         private void before(Element elt)
         {
             if ( beforeVisitor != null )
                 elt.visit(beforeVisitor) ;
         }
-        
+
         private void after(Element elt)
         {
             if ( afterVisitor != null )
                 elt.visit(afterVisitor) ;
         }
-        
+
         @Override
         public void visit(ElementTriplesBlock el)
         {
@@ -77,7 +77,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementFilter el)
         {
@@ -93,7 +93,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementBind el)
         {
@@ -101,7 +101,16 @@
             proc.visit(el) ;
             after(el) ;
         }
+
+        @Override
+        public void visit(ElementFind el)
+        {
+            before(el) ;
+            proc.visit(el) ;
+            after(el) ;
+        }
         
+
         @Override
         public void visit(ElementData el)
         {
@@ -109,7 +118,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementUnion el)
         {
@@ -119,7 +128,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementGroup el)
         {
@@ -129,7 +138,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-    
+
         @Override
         public void visit(ElementOptional el)
         {
@@ -139,7 +148,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementDataset el)
         {
@@ -159,7 +168,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-    
+
         @Override
         public void visit(ElementService el)
         {
@@ -197,7 +206,7 @@
             proc.visit(el) ;
             after(el) ;
         }
-        
+
         @Override
         public void visit(ElementSubQuery el)
         {
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVars.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVars.java
index 247c933..a7e8c7e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVars.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVars.java
@@ -25,7 +25,7 @@
 
 /** Get the variables potentially bound by an element.
  *  All mentioned variables except those in MINUS and FILTER (and hence NOT EXISTS)
- *  The work is done by PatternVarsVisitor.  
+ *  The work is done by PatternVarsVisitor.
  */
 public class PatternVars
 {
@@ -37,13 +37,13 @@
         vars(element, v) ;
         return s ;
     }
-    
+
     public static void vars(Element element, PatternVarsVisitor visitor)
     {
         ElementWalker.EltWalker walker = new WalkerSkipMinus(visitor) ;
         ElementWalker.walk$(element, walker) ;
     }
-    
+
     public static class WalkerSkipMinus extends ElementWalker.EltWalker
     {
         protected WalkerSkipMinus(ElementVisitor visitor)
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVarsVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVarsVisitor.java
index 0270b5f..b89d256 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVarsVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/PatternVarsVisitor.java
@@ -18,44 +18,42 @@
 
 package org.apache.jena.sparql.syntax;
 
-import java.util.Collection ;
-import java.util.Iterator ;
+import java.util.Collection;
+import java.util.Iterator;
 
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.sparql.core.TriplePath ;
-import org.apache.jena.sparql.core.Var ;
-import org.apache.jena.sparql.core.VarExprList ;
-import org.apache.jena.sparql.util.VarUtils ;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.TriplePath;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.core.VarExprList;
+import org.apache.jena.sparql.util.VarUtils;
 
 public class PatternVarsVisitor extends ElementVisitorBase
 {
-    public Collection<Var> acc ;
-    public PatternVarsVisitor(Collection<Var> s) { acc = s ; } 
-    
+    public Collection<Var> acc;
+    public PatternVarsVisitor(Collection<Var> s) {
+        acc = s;
+    }
+
     @Override
-    public void visit(ElementTriplesBlock el)
-    {
-        for (Iterator<Triple> iter = el.patternElts() ; iter.hasNext() ; )
-        {
-            Triple t = iter.next() ;
-            VarUtils.addVarsFromTriple(acc, t) ;
+    public void visit(ElementTriplesBlock el) {
+        for ( Iterator<Triple> iter = el.patternElts() ; iter.hasNext() ; ) {
+            Triple t = iter.next();
+            VarUtils.addVarsFromTriple(acc, t);
         }
     }
 
     @Override
-    public void visit(ElementPathBlock el) 
-    {
-        for (Iterator<TriplePath> iter = el.patternElts() ; iter.hasNext() ; )
-        {
-            TriplePath tp = iter.next() ;
-            // If it's triple-izable, then use the triple. 
+    public void visit(ElementPathBlock el) {
+        for ( Iterator<TriplePath> iter = el.patternElts() ; iter.hasNext() ; ) {
+            TriplePath tp = iter.next();
+            // If it's triple-izable, then use the triple.
             if ( tp.isTriple() )
-                VarUtils.addVarsFromTriple(acc, tp.asTriple()) ;
+                VarUtils.addVarsFromTriple(acc, tp.asTriple());
             else
-                VarUtils.addVarsFromTriplePath(acc, tp) ;
+                VarUtils.addVarsFromTriplePath(acc, tp);
         }
     }
-        
+
     // Variables here are non-binding.
     @Override public void visit(ElementExists el)       { }
     @Override public void visit(ElementNotExists el)    { }
@@ -63,43 +61,41 @@
     @Override public void visit(ElementFilter el)       { }
 
     @Override
-    public void visit(ElementNamedGraph el)
-    {
-        VarUtils.addVar(acc, el.getGraphNameNode()) ;
+    public void visit(ElementNamedGraph el) {
+        VarUtils.addVar(acc, el.getGraphNameNode());
     }
 
     @Override
-    public void visit(ElementSubQuery el)
-    {
-        el.getQuery().setResultVars() ;
-        VarExprList x = el.getQuery().getProject() ;
-        acc.addAll(x.getVars()) ;
+    public void visit(ElementSubQuery el) {
+        el.getQuery().setResultVars();
+        VarExprList x = el.getQuery().getProject();
+        acc.addAll(x.getVars());
     }
 
     @Override
-    public void visit(ElementAssign el)
-    {
-        acc.add(el.getVar()) ;
+    public void visit(ElementAssign el) {
+        acc.add(el.getVar());
     }
 
     @Override
-    public void visit(ElementBind el)
-    {
-        acc.add(el.getVar()) ;
+    public void visit(ElementBind el) {
+        acc.add(el.getVar());
     }
 
     @Override
-    public void visit(ElementData el)
-    {
-        acc.addAll(el.getVars()) ;
+    public void visit(ElementFind el) {
+        acc.add(el.getVar());
+        VarUtils.addVarsFromTriple(acc, el.getTriple());
     }
 
-    
+    @Override
+    public void visit(ElementData el) {
+        acc.addAll(el.getVars());
+    }
+
 //    @Override
-//    public void visit(ElementService el)
-//    {
+//    public void visit(ElementService el) {
 //        // Although if this isn't defined elsewhere the query won't work.
-//        VarUtils.addVar(acc, el.getServiceNode()) ;
+//        VarUtils.addVar(acc, el.getServiceNode());
 //    }
-    
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/RecursiveElementVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/RecursiveElementVisitor.java
index ebdccd8..42e6d08 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/RecursiveElementVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/RecursiveElementVisitor.java
@@ -41,27 +41,30 @@
 
 public class RecursiveElementVisitor implements ElementVisitor
 {
-    
+
     // ---- Call points.
     // Not abstract, because subclasses don't have to implement them.
-    
+
     public void startElement(ElementTriplesBlock el) {}
     public void endElement  (ElementTriplesBlock el) {}
 
     public void startElement(ElementDataset el) {}
     public void endElement  (ElementDataset el) {}
 
-    public void startElement(ElementFilter el) {} 
-    public void endElement  (ElementFilter el) {} 
+    public void startElement(ElementFilter el) {}
+    public void endElement  (ElementFilter el) {}
 
-    public void startElement(ElementAssign el) {} 
-    public void endElement  (ElementAssign el) {} 
+    public void startElement(ElementAssign el) {}
+    public void endElement  (ElementAssign el) {}
 
-    public void startElement(ElementBind el) {} 
-    public void endElement  (ElementBind el) {} 
+    public void startElement(ElementBind el) {}
+    public void endElement  (ElementBind el) {}
 
-    public void startElement(ElementData el) {} 
-    public void endElement  (ElementData el) {} 
+    public void startElement(ElementFind el) {}
+    public void endElement  (ElementFind el) {}
+
+    public void startElement(ElementData el) {}
+    public void endElement  (ElementData el) {}
 
     public void startElement(ElementUnion el) {}
     public void endElement  (ElementUnion el) {}
@@ -98,22 +101,22 @@
     public void startElement(ElementPathBlock el)   {}
 
     protected ElementVisitor visitor = null ;
-    
+
     // ---- 
-    
+
     private RecursiveElementVisitor() { this.visitor = new ElementVisitorBase() ; }
     
     public RecursiveElementVisitor(ElementVisitor visitor) { this.visitor = visitor ; }
-    
+
     // Visitor pattern on Elements
-    
+
     @Override
     public final void visit(ElementTriplesBlock el)
     {
         startElement(el) ;
         endElement(el) ;
     }
-    
+
     @Override
     public final void visit(ElementDataset el)
     {
@@ -142,14 +145,21 @@
         startElement(el) ;
         endElement(el) ;
     }
-    
+
+    @Override
+    public void visit(ElementFind el)
+    {
+        startElement(el) ;
+        endElement(el) ;
+    }
+
     @Override
     public void visit(ElementData el)
     {
         startElement(el) ;
         endElement(el) ;
     }
-    
+
     @Override
     public final void visit(ElementUnion el)
     {
@@ -162,7 +172,7 @@
         }
         endElement(el) ;
     }
-    
+
     @Override
     public final void visit(ElementGroup el)
     {
@@ -184,7 +194,6 @@
         endElement(el) ;
     }
 
-
     @Override
     public final void visit(ElementNamedGraph el)
     {
@@ -200,7 +209,7 @@
         el.getElement().visit(this) ;
         endElement(el) ;
     }
-    
+
     @Override
     public final void visit(ElementExists el)
     {
@@ -225,14 +234,13 @@
         endElement(el) ;
     }
 
-
-    
     @Override
     public void visit(ElementSubQuery el)
     { 
         startElement(el) ;
         endElement(el) ;
     }
+
     @Override
     public void visit(ElementPathBlock el)
     {
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ApplyElementTransformVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ApplyElementTransformVisitor.java
index 2ebd8fd..8db3f4f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ApplyElementTransformVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ApplyElementTransformVisitor.java
@@ -24,6 +24,7 @@
 
 import org.apache.jena.atlas.logging.Log;
 import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.Query;
 import org.apache.jena.sparql.core.Var;
 import org.apache.jena.sparql.expr.Expr;
@@ -95,7 +96,16 @@
         Var v1 = TransformElementLib.applyVar(v, exprTransform) ;
         Expr expr = el.getExpr() ;
         Expr expr1 = ExprTransformer.transform(exprTransform, expr) ;
-        Element el2 = transform.transform(el, v1, expr1 ) ;
+        Element el2 = transform.transform(el, v1, expr1) ;
+        push(el2) ;
+    }
+
+    @Override
+    public void visit(ElementFind el) {
+        Var v = el.getVar() ;
+        Var v1 = TransformElementLib.applyVar(v, exprTransform) ;
+        Triple t1 = transform.transform(el.getTriple());
+        Element el2 = transform.transform(el, v1, t1);
         push(el2) ;
     }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransform.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransform.java
index f0bbcd3..cc586de 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransform.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransform.java
@@ -18,34 +18,36 @@
 
 package org.apache.jena.sparql.syntax.syntaxtransform;
 
-import java.util.List ;
+import java.util.List;
 
-import org.apache.jena.graph.Node ;
-import org.apache.jena.query.Query ;
-import org.apache.jena.sparql.core.Var ;
-import org.apache.jena.sparql.expr.Expr ;
-import org.apache.jena.sparql.syntax.* ;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.Query;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.syntax.*;
 
 /** Transformation function on an Element
  *  @see ElementTransformer
  */
 public interface ElementTransform
 {
-    public Element transform(ElementTriplesBlock el) ;
-    public Element transform(ElementPathBlock el) ;
-    public Element transform(ElementFilter el, Expr expr2) ;
-    public Element transform(ElementAssign el, Var v, Expr expr2) ;
-    public Element transform(ElementBind el, Var v, Expr expr2) ;
-    public Element transform(ElementData el) ;
-    public Element transform(ElementDataset el, Element subElt) ;
-    public Element transform(ElementUnion el, List<Element> elements) ;
-    public Element transform(ElementOptional el, Element opElt) ;
-    public Element transform(ElementGroup el, List<Element> members) ;
-    public Element transform(ElementNamedGraph el, Node gn, Element subElt) ;
-    public Element transform(ElementExists el, Element subElt) ;
-    public Element transform(ElementNotExists el, Element subElt) ;
-    public Element transform(ElementMinus el, Element eltRHS) ;
-    public Element transform(ElementService el, Node service, Element subElt) ;
-    public Element transform(ElementSubQuery el, Query query) ;
+    public Element transform(ElementTriplesBlock el);
+    public Element transform(ElementPathBlock el);
+    public Element transform(ElementFilter el, Expr expr2);
+    public Element transform(ElementAssign el, Var v, Expr expr2);
+    public Element transform(ElementBind el, Var v, Expr expr2);
+    public Element transform(ElementFind el, Var v, Triple triple2);
+    public Triple  transform(Triple triple);
+    public Element transform(ElementData el);
+    public Element transform(ElementDataset el, Element subElt);
+    public Element transform(ElementUnion el, List<Element> elements);
+    public Element transform(ElementOptional el, Element opElt);
+    public Element transform(ElementGroup el, List<Element> members);
+    public Element transform(ElementNamedGraph el, Node gn, Element subElt);
+    public Element transform(ElementExists el, Element subElt);
+    public Element transform(ElementNotExists el, Element subElt);
+    public Element transform(ElementMinus el, Element eltRHS);
+    public Element transform(ElementService el, Node service, Element subElt);
+    public Element transform(ElementSubQuery el, Query query);
 }
-
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformCopyBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformCopyBase.java
index 19bb35a..ff30a95 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformCopyBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformCopyBase.java
@@ -21,6 +21,7 @@
 import java.util.List ;
 
 import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.Query ;
 import org.apache.jena.sparql.core.BasicPattern ;
 import org.apache.jena.sparql.core.PathBlock ;
@@ -54,7 +55,6 @@
             before.getList().forEach(copy::add);
             el = new ElementTriplesBlock(copy);
         }
-
         return el ;
     }
 
@@ -66,11 +66,15 @@
             before.getList().forEach(copy::add);
             el = new ElementPathBlock(copy);
         }
-
         return el ;
     }
 
     @Override
+    public Triple transform(Triple triple) {
+        return triple;
+    }
+
+    @Override
     public Element transform(ElementFilter el, Expr expr2) {
         if ( !alwaysCopy && el.getExpr() == expr2 )
             return el ;
@@ -92,6 +96,13 @@
     }
 
     @Override
+    public Element transform(ElementFind el, Var v, Triple triple2) {
+        if ( !alwaysCopy && el.getVar() == v && el.getTriple() == triple2 )
+            return el ;
+        return new ElementFind(v, triple2) ;
+    }
+
+    @Override
     public Element transform(ElementData el) {
          if( alwaysCopy ) {
              ElementData copy = new ElementData();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformIdentity.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformIdentity.java
index 777be34..98d006c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformIdentity.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformIdentity.java
@@ -21,6 +21,7 @@
 import java.util.List ;
 
 import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.Query ;
 import org.apache.jena.sparql.core.Var ;
 import org.apache.jena.sparql.expr.Expr ;
@@ -49,6 +50,10 @@
     @Override
     public Element transform(ElementBind el, Var v, Expr expr2) { return el ; }
     @Override
+    public Element transform(ElementFind el, Var v, Triple triple2) { return el ; }
+    @Override
+    public Triple transform(Triple triple) { return triple; }
+    @Override
     public Element transform(ElementData el) { return el ; }
     @Override
     public Element transform(ElementUnion el, List<Element> elements) { return el ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformSubst.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformSubst.java
index 868b04c..240f5fe 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformSubst.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformSubst.java
@@ -34,7 +34,7 @@
  * Because a {@link Var} is a subclass of {@link Node_Variable} which is a {@link Node},
  * this includes variable renaming.
  * <p>
- * This is a transformation on the syntax - all occurences of a variable are replaced, even if
+ * This is a transformation on the syntax - all occurrences of a variable are replaced, even if
  * inside sub-select's and not project (which means it is effectively a different variable).
  */
 public class ElementTransformSubst extends ElementTransformCopyBase {
@@ -90,7 +90,8 @@
         return new TriplePath(s1, path.getPath(), o1) ;
     }
 
-    private Triple transform(Triple triple) {
+    @Override
+    public Triple transform(Triple triple) {
         Node s = triple.getSubject() ;
         Node s1 = transform(s) ;
         Node p = triple.getPredicate() ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/MappedLoader.java b/jena-arq/src/main/java/org/apache/jena/sparql/util/MappedLoader.java
index 9ff04aa..7be7db8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/MappedLoader.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/MappedLoader.java
@@ -87,7 +87,6 @@
                 return e;
             }
         }
-
         return null;
     }
 
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/util/QueryUtils.java b/jena-arq/src/main/java/org/apache/jena/sparql/util/QueryUtils.java
index 4cfc74a..47e3324 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/util/QueryUtils.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/util/QueryUtils.java
@@ -111,7 +111,12 @@
         if ( query.hashCode() != query2.hashCode() )
             throw new QueryCheckException("reparsed query hashCode does not equal parsed input query \nQuery (hashCode: " + query.hashCode() + ")=\n" + query + "\n\nQuery2 (hashCode: " + query2.hashCode() + ")=\n" + query2) ;
         
-        if ( ! query.equals(query2) ) 
+        if ( ! query.equals(query2) ) {
+            if ( false ) {
+                System.err.println(query);
+                System.err.println(query2);
+            }
             throw new QueryCheckException("reparsed output does not equal parsed input") ;
+        }
     }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java
index 677e227..1067356 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java
@@ -67,6 +67,12 @@
     /** <p>Syntax tests (query)</p> */
     public static final Resource PositiveSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveSyntaxTestARQ" );
     
+    /** <p>Syntax tests which expect a parse failure</p> */
+    public static final Resource NegativeUpdateSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#NegativeUpdateSyntaxTestARQ" );
+    
+    /** <p>Syntax tests (query)</p> */
+    public static final Resource PositiveUpdateSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveUpdateSyntaxTestARQ" );
+    
     /** <p>The class of test that are Query tests (query, data, results)</p> */
     public static final Resource TestQuery = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestQuery" );
     
diff --git a/jena-arq/src/test/java/org/apache/jena/rdf_star/TS_RDF_Star.java b/jena-arq/src/test/java/org/apache/jena/rdf_star/TS_RDF_Star.java
index 3d68987..fdb6d84 100644
--- a/jena-arq/src/test/java/org/apache/jena/rdf_star/TS_RDF_Star.java
+++ b/jena-arq/src/test/java/org/apache/jena/rdf_star/TS_RDF_Star.java
@@ -30,7 +30,7 @@
     TestSPARQLStarParse.class,
     TestSPARQLStarExtra.class
 
-    //See also TC_Scripted SPARQL-star/manifest.ttl which run from JUnit3-centric ARQTestSuite 
+    //See also TC_Scripted SPARQL-Star/manifest.ttl which run from JUnit3-centric ARQTestSuite 
 })
 public class TS_RDF_Star {
 }
diff --git a/jena-arq/src/test/java/org/apache/jena/rdf_star/TestSPARQLStarExtra.java b/jena-arq/src/test/java/org/apache/jena/rdf_star/TestSPARQLStarExtra.java
index 5b30b42..7e39e22 100644
--- a/jena-arq/src/test/java/org/apache/jena/rdf_star/TestSPARQLStarExtra.java
+++ b/jena-arq/src/test/java/org/apache/jena/rdf_star/TestSPARQLStarExtra.java
@@ -38,4 +38,3 @@
         ResultSetFormatter.consume(rs);
     }
 }
-
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizer.java b/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizer.java
index 65ae632..019b3e1 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizer.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/tokens/TestTokenizer.java
@@ -666,7 +666,7 @@
 
     @Test
     public void tokenUnit_var9() {
-        tokenizeAndTestExact("?" + ARQConstants.allocVarBNodeToVar + "ABC", TokenType.VAR, ARQConstants.allocVarBNodeToVar + "ABC") ;
+        tokenizeAndTestExact("?" + ARQConstants.allocVarTripleTerm + "9", TokenType.VAR, ARQConstants.allocVarTripleTerm + "9") ;
     }
 
     @Test
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/TC_Scripted.java b/jena-arq/src/test/java/org/apache/jena/sparql/TC_Scripted.java
index 6b18f7b..c9a6351 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/TC_Scripted.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/TC_Scripted.java
@@ -34,9 +34,8 @@
         ts.addTest(ScriptTestSuiteFactory.make(ARQTestSuite.testDirARQ+"/Serialization/manifest.ttl")) ;
         
         String testDirRDFStar = "testing/ARQ/RDF-Star";
-        ts.addTest(FactoryTestRiot.make(testDirRDFStar+"/Turtle-star/manifest.ttl"));
-        ts.addTest(ScriptTestSuiteFactory.make(testDirRDFStar+"/SPARQL-star/manifest.ttl")) ;
-
+        ts.addTest(FactoryTestRiot.make(testDirRDFStar+"/Turtle-Star/manifest.ttl"));
+        ts.addTest(ScriptTestSuiteFactory.make(testDirRDFStar+"/SPARQL-Star/manifest.ttl")) ;
         
         return ts ;
     }
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/junit/ScriptTestSuiteFactory.java b/jena-arq/src/test/java/org/apache/jena/sparql/junit/ScriptTestSuiteFactory.java
index a054fb7..065f16c 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/junit/ScriptTestSuiteFactory.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/junit/ScriptTestSuiteFactory.java
@@ -106,8 +106,13 @@
             // ---- Update tests
             if ( testType.equals(TestManifest_11.PositiveUpdateSyntaxTest11) )
                 return new SyntaxUpdateTest(testName, results, item, true) ;
+            if ( testType.equals(TestManifestX.PositiveUpdateSyntaxTestARQ) )
+                return new SyntaxUpdateTest(testName, results, item, true) ;
+            
             if ( testType.equals(TestManifest_11.NegativeUpdateSyntaxTest11) )
                 return new SyntaxUpdateTest(testName, results, item, false) ;
+            if ( testType.equals(TestManifestX.NegativeUpdateSyntaxTestARQ) )
+                return new SyntaxUpdateTest(testName, results, item, false) ;
 
             // Two names for same thing.
             // Note item is not passed down.
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/junit/TestItem.java b/jena-arq/src/test/java/org/apache/jena/sparql/junit/TestItem.java
index eedd64e..3ff0632 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/junit/TestItem.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/junit/TestItem.java
@@ -108,7 +108,7 @@
         namedGraphURIs = new ArrayList<>() ;
         resultFile = _resultFile ;
         comment = "" ;
-        queryFileSyntax = Syntax.guessFileSyntax(_queryFile) ;
+        queryFileSyntax = guessFileSyntax(_queryFile) ;
     }
 
     public Resource getResource() {
@@ -190,6 +190,16 @@
         return buildLuceneIndex ;
     }
 
+    // *.rq is strictly SPARQL 1.1 tests.
+    protected Syntax guessFileSyntax(String filename) {
+        if ( filename.endsWith(".rq") )
+            return Syntax.syntaxSPARQL_11;
+        if ( filename.endsWith(".ru") )
+            return Syntax.syntaxSPARQL_11;
+        
+        return Syntax.guessFileSyntax(filename);
+    }
+
     private String _getName() {
         
         Statement s = testResource.getProperty(TestManifest.name) ;
@@ -299,7 +309,7 @@
         }
 
         if ( uri != null ) {
-            Syntax synFileName = Syntax.guessFileSyntax(uri) ;
+            Syntax synFileName = guessFileSyntax(uri) ;
             if ( synFileName != null )
                 return synFileName ;
         }
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/sse/TestSSE_Basic.java b/jena-arq/src/test/java/org/apache/jena/sparql/sse/TestSSE_Basic.java
index 52311fb..3c5373d 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/sse/TestSSE_Basic.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/sse/TestSSE_Basic.java
@@ -246,15 +246,15 @@
     @Test public void testMisc_11()    { testNotEquals("(a)", "()") ; }
     @Test public void testMisc_12()    { testNotEquals("(a)", "(<a>)") ; }
 
-    @Test public void testTripleTerm_1()  { testNode("{:s :p :o}"); }
-    @Test public void testTripleTerm_2()  { testNode("{ :s :p :o }"); }
-    @Test public void testTripleTerm_3()  { testNode("{ ?s ?p ?o }"); }
-    @Test public void testTripleTerm_4()  { testNode("{{ :s :p :o } :q { :s :p :o }}"); }
+    @Test public void testTripleTerm_1()  { testNode("<< :s :p :o >>"); }
+    @Test public void testTripleTerm_2()  { testNode("<<:s :p :o>>"); }
+    @Test public void testTripleTerm_3()  { testNode("<< ?s ?p ?o >>"); }
+    @Test public void testTripleTerm_4()  { testNode("<<<< :s :p :o >> :q << :s :p :o >>>>"); }
 
-    @Test public void testTripleTerm_10()  { parseBad("{ :s :p :o "); }
-    @Test public void testTripleTerm_11()  { parseBad("{ :s }"); }
-    @Test public void testTripleTerm_12()  { parseBad("{ :s :p }"); }
-    @Test public void testTripleTerm_13()  { parseBad("{ {:s :p :o} :q } "); }
+    @Test public void testTripleTerm_10()  { parseBad("<< :s :p :o "); }
+    @Test public void testTripleTerm_11()  { parseBad("<< :s >>"); }
+    @Test public void testTripleTerm_12()  { parseBad("<< :s :p >>"); }
+    @Test public void testTripleTerm_13()  { parseBad("<< <<:s :p :o >> :q >> "); }
 
     @Test public void testTaggedList_1()
     {
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data-quads.trig b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data-quads.trig
new file mode 100644
index 0000000..d03c51f
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data-quads.trig
@@ -0,0 +1,15 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+GRAPH :g1 {
+  :s :p1 :o .
+  <<:s :p1 :o>> :q1 :z1 .
+}
+
+GRAPH :g2 {
+  << <<:s :p1 :o>> :q1 :z1 >> :q1 :z1 . 
+  :s :p2 :o .
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/data1.ttl b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data1.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/data1.ttl
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data1.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/data2.ttl b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data2.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/data2.ttl
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data2.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data3.ttl b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data3.ttl
new file mode 100644
index 0000000..a3e864f
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/data3.ttl
@@ -0,0 +1,10 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+:s :p1 :o .
+<<:s :p1 :o>> :q1 :z1 .
+<< <<:s :p1 :o>> :q1 :z1 >> :q1 :z1 . 
+:s :p2 :o .
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/manifest.ttl b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/manifest.ttl
similarity index 64%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/manifest.ttl
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/manifest.ttl
index 55703b1..e9eb664 100644
--- a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/manifest.ttl
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/manifest.ttl
@@ -28,84 +28,106 @@
         :sparql-star-syntax-2
         :sparql-star-syntax-3
         :sparql-star-syntax-4
+        :sparql-star-syntax-5
 
         :sparql-star-bad-syntax-1
         :sparql-star-bad-syntax-2
         :sparql-star-bad-syntax-3
         :sparql-star-bad-syntax-4
+        :sparql-star-bad-syntax-5
 
         :sparql-star-basic-1
         :sparql-star-basic-2
         :sparql-star-basic-3
         :sparql-star-basic-4
 
-        :sparql-pattern-1
-        :sparql-pattern-2
-        :sparql-pattern-3
-        :sparql-pattern-4
-        :sparql-pattern-5
-        :sparql-pattern-6
-        :sparql-pattern-7
-        :sparql-pattern-8
+        :sparql-star-pattern-1
+        :sparql-star-pattern-2
+        :sparql-star-pattern-3
+        :sparql-star-pattern-4
+        :sparql-star-pattern-5
+        :sparql-star-pattern-6
+        :sparql-star-pattern-7
+        :sparql-star-pattern-8
 
-        :sparql-update-syntax-1
-        :sparql-update-syntax-2
-        :sparql-update-bad-syntax-1
-        :sparql-update-bad-syntax-2
+        :sparql-star-find-1
+
+        :sparql-star-update-syntax-1
+        :sparql-star-update-syntax-2
+        :sparql-star-update-bad-syntax-1
+        :sparql-star-update-bad-syntax-2
+
+        :sparql-star-union-1
+        :sparql-star-union-2
+
+        :sparql-star-named-graph-1
+        :sparql-star-named-graph-2
     ) .
 
 ## Good syntax
 
 :sparql-star-syntax-1
-    rdf:type   mf:PositiveSyntaxTest11 ;
+    rdf:type   mfx:PositiveSyntaxTestARQ ;
     mf:name    "sparql-star-syntax-01.arq" ;
     mf:action  <sparql-star-syntax-01.arq>
     .
 
 :sparql-star-syntax-2
-    rdf:type   mf:PositiveSyntaxTest11 ;
+    rdf:type   mfx:PositiveSyntaxTestARQ ;
     mf:name    "sparql-star-syntax-02.arq" ;
     mf:action  <sparql-star-syntax-02.arq>
     .
 
 :sparql-star-syntax-3
-    rdf:type   mf:PositiveSyntaxTest11 ;
+    rdf:type   mfx:PositiveSyntaxTestARQ ;
     mf:name    "sparql-star-syntax-03.arq" ;
     mf:action  <sparql-star-syntax-03.arq>
     .
 
 :sparql-star-syntax-4
-    rdf:type   mf:PositiveSyntaxTest11 ;
+    rdf:type   mfx:PositiveSyntaxTestARQ ;
     mf:name    "sparql-star-syntax-04.arq" ;
     mf:action  <sparql-star-syntax-04.arq>
     .
 
+:sparql-star-syntax-5
+    rdf:type   mfx:PositiveSyntaxTestARQ ;
+    mf:name    "sparql-star-syntax-05.arq" ;
+    mf:action  <sparql-star-syntax-05.arq>
+    .
+
 ## Bad syntax
 
 :sparql-star-bad-syntax-1
-    rdf:type   mf:NegativeSyntaxTest11 ;
+    rdf:type   mfx:NegativeSyntaxTestARQ ;
     mf:name    "sparql-star-bad-syntax-01" ;
     mf:action  <sparql-star-bad-syntax-01.arq>
     .
 
 :sparql-star-bad-syntax-2
-    rdf:type   mf:NegativeSyntaxTest11 ;
+    rdf:type   mfx:NegativeSyntaxTestARQ ;
     mf:name    "sparql-star-bad-syntax-02" ;
     mf:action  <sparql-star-bad-syntax-02.arq>
     .
 
 :sparql-star-bad-syntax-3
-    rdf:type   mf:NegativeSyntaxTest11 ;
+    rdf:type   mfx:NegativeSyntaxTestARQ ;
     mf:name    "sparql-star-bad-syntax-03" ;
     mf:action  <sparql-star-bad-syntax-03.arq>
     .
 
 :sparql-star-bad-syntax-4
-    rdf:type   mf:NegativeSyntaxTest11 ;
+    rdf:type   mfx:NegativeSyntaxTestARQ ;
     mf:name    "sparql-star-bad-syntax-04" ;
     mf:action  <sparql-star-bad-syntax-04.arq>
     .
 
+:sparql-star-bad-syntax-5
+    rdf:type   mfx:NegativeSyntaxTestARQ ;
+    mf:name    "sparql-star-bad-syntax-05" ;
+    mf:action  <sparql-star-bad-syntax-05.arq>
+    .
+
 ## Execution - one triple pattern, no nesting
 
 :sparql-star-basic-1
@@ -142,7 +164,7 @@
 
 ## Execution - patterns
 
-:sparql-pattern-1
+:sparql-star-pattern-1
     mf:name    "SPARQL* - Pattern - 1" ;
     mf:action
         [ qt:query  <sparql-star-pattern-01.arq> ;
@@ -150,7 +172,7 @@
     mf:result  <sparql-star-pattern-01.srj>
 .
 
-:sparql-pattern-2
+:sparql-star-pattern-2
     mf:name    "SPARQL* - Pattern - 2" ;
     mf:action
         [ qt:query  <sparql-star-pattern-02.arq> ;
@@ -158,7 +180,7 @@
     mf:result  <sparql-star-pattern-02.srj>
 .
 
-:sparql-pattern-3
+:sparql-star-pattern-3
     mf:name    "SPARQL* - Pattern - Variable for triple term" ;
     mf:action
         [ qt:query  <sparql-star-pattern-03.arq> ;
@@ -166,7 +188,7 @@
     mf:result  <sparql-star-pattern-03.srj>
 .
 
-:sparql-pattern-4
+:sparql-star-pattern-4
     mf:name    "SPARQL* - Pattern - No match" ;
     mf:action
         [ qt:query  <sparql-star-pattern-04.arq> ;
@@ -174,7 +196,7 @@
     mf:result  <sparql-star-pattern-04.srj>
 .
 
-:sparql-pattern-5
+:sparql-star-pattern-5
     mf:name    "SPARQL* - Pattern - match variables in triple terms" ;
     mf:action
         [ qt:query  <sparql-star-pattern-05.arq> ;
@@ -182,7 +204,7 @@
     mf:result  <sparql-star-pattern-05.srj>
 .
 
-:sparql-pattern-6
+:sparql-star-pattern-6
     mf:name    "SPARQL* - Pattern - Nesting 1" ;
     mf:action
         [ qt:query  <sparql-star-pattern-06.arq> ;
@@ -190,7 +212,7 @@
     mf:result  <sparql-star-pattern-06.srj>
 .
 
-:sparql-pattern-7
+:sparql-star-pattern-7
     mf:name    "SPARQL* - Pattern - Nesting - 2" ;
     mf:action
         [ qt:query  <sparql-star-pattern-07.arq> ;
@@ -198,7 +220,7 @@
     mf:result  <sparql-star-pattern-07.srj>
 .
 
-:sparql-pattern-8
+:sparql-star-pattern-8
     mf:name    "SPARQL* - Pattern - Match and nesting" ;
     mf:action
         [ qt:query  <sparql-star-pattern-08.arq> ;
@@ -206,28 +228,78 @@
     mf:result  <sparql-star-pattern-08.srj>
 .
 
+:sparql-star-pattern-9
+    mf:name    "SPARQL* - Pattern - No Match" ;
+    mf:action
+        [ qt:query  <sparql-star-pattern-09.arq> ;
+          qt:data   <data2.ttl> ] ;
+    mf:result  <sparql-star-pattern-09.srj>
+.
+
+## SPARQL FIND*
+
+:sparql-star-find-1
+    mf:name    "SPARQL* - FIND - 1" ;
+    mf:action
+        [ qt:query  <sparql-star-find-01.arq> ;
+          qt:data   <data3.ttl> ] ;
+    mf:result  <sparql-star-find-01.srj>
+.
+
 ## SPARQL* Update
 
-:sparql-update-syntax-1
-    rdf:type mf:PositiveUpdateSyntaxTest11;
+:sparql-star-update-syntax-1
+    rdf:type mfx:PositiveUpdateSyntaxTestARQ;
     mf:name    "sparql-star-update-syntax-01" ;
     mf:action  <sparql-star-update-syntax-01.aru>
     .
     
-:sparql-update-syntax-2
-    rdf:type mf:PositiveUpdateSyntaxTest11;
+:sparql-star-update-syntax-2
+    rdf:type mfx:PositiveUpdateSyntaxTestARQ;
     mf:name    "sparql-star-update-syntax-02" ;
     mf:action  <sparql-star-update-syntax-02.aru>
     .
     
-:sparql-update-bad-syntax-1
-    rdf:type mf:NegativeUpdateSyntaxTest11;
+:sparql-star-update-bad-syntax-1
+    rdf:type mfx:NegativeUpdateSyntaxTestARQ;
     mf:name    "sparql-star-update-bad-syntax-01" ;
     mf:action  <sparql-star-update-bad-syntax-01.aru>
     .
     
-:sparql-update-bad-syntax-2
-    rdf:type mf:NegativeUpdateSyntaxTest11;
+:sparql-star-update-bad-syntax-2
+    rdf:type mfx:NegativeUpdateSyntaxTestARQ;
     mf:name    "sparql-star-update-bad-syntax-02" ;
     mf:action  <sparql-star-update-bad-syntax-02.aru>
     .
+
+:sparql-star-union-1
+    mf:name    "SPARQL* - Pattern - union graph" ;
+    mf:action
+        [ qt:query  <sparql-star-union-1.arq> ;
+          qt:data   <data-quads.trig> ] ;
+    mf:result  <sparql-star-union-1.srj>
+.
+
+:sparql-star-union-2
+    mf:name    "SPARQL* - Pattern - union graph" ;
+    mf:action
+        [ qt:query  <sparql-star-union-2.arq> ;
+          qt:data   <data-quads.trig> ] ;
+    mf:result  <sparql-star-union-2.srj>
+.
+
+:sparql-star-named-graph-1
+    mf:name    "SPARQL* - Pattern - named graph" ;
+    mf:action
+        [ qt:query  <sparql-star-named-graph-1.arq> ;
+          qt:data   <data-quads.trig> ] ;
+    mf:result  <sparql-star-named-graph-1.srj>
+.
+
+:sparql-star-named-graph-2
+    mf:name    "SPARQL* - FIND - named graph" ;
+    mf:action
+        [ qt:query  <sparql-star-named-graph-2.arq> ;
+          qt:data   <data-quads.trig> ] ;
+    mf:result  <sparql-star-named-graph-2.srj>
+.
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-01.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-01.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-01.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-01.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-02.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-02.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-02.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-02.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-03.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-03.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-03.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-03.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-04.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-04.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-bad-syntax-04.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-04.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-05.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-05.arq
new file mode 100644
index 0000000..4190765
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-bad-syntax-05.arq
@@ -0,0 +1,10 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+    ?t ?p ?o .
+    FIND ( << :s :p1 :o >> as ?t )
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-1.rq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-1.rq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-1.rq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-1.rq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-1.srx b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-1.srx
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-1.srx
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-1.srx
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-2.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-2.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-2.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-2.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-2.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-2.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-2.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-2.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-3.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-3.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-3.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-3.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-3.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-3.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-3.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-3.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-4.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-4.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-4.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-4.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-4.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-4.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-basic-4.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-basic-4.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.arq
new file mode 100644
index 0000000..4bb8a65
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.arq
@@ -0,0 +1,10 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+    FIND ( << :s :p1 :o >> as ?t )
+    ?t ?p ?o .
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.srj
new file mode 100644
index 0000000..bf7c1eb
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-01.srj
@@ -0,0 +1,20 @@
+{ "head": {
+    "vars": [ "t" , "p" , "o" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p1" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        } ,
+        "p": { "type": "uri" , "value": "http://example/q1" } ,
+        "o": { "type": "uri" , "value": "http://example/z1" }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.arq
new file mode 100644
index 0000000..61a5071
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.arq
@@ -0,0 +1,11 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+    ?s :p1 ?o .
+    BIND ( ?p1 AS ?p )
+    FIND ( << ?s ?p ?o >> as ?t )
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.srj
new file mode 100644
index 0000000..a5f1a3d
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-find-02.srj
@@ -0,0 +1,34 @@
+{ "head": {
+    "vars": [ "s" , "o" , "p" , "t" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "s": { "type": "uri" , "value": "http://example/s" } ,
+        "o": { "type": "uri" , "value": "http://example/o" } ,
+        "p": { "type": "uri" , "value": "http://example/p2" } ,
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p2" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        }
+      } ,
+      { 
+        "s": { "type": "uri" , "value": "http://example/s" } ,
+        "o": { "type": "uri" , "value": "http://example/o" } ,
+        "p": { "type": "uri" , "value": "http://example/p1" } ,
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p1" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.arq
new file mode 100644
index 0000000..cb6d81a
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.arq
@@ -0,0 +1,12 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+  GRAPH :g1 {
+    FIND(<<?s ?p ?o >> AS ?t )
+  }
+}
+
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.srj
new file mode 100644
index 0000000..96fbcca
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-1.srj
@@ -0,0 +1,48 @@
+{ "head": {
+    "vars": [ "t" , "s" , "p" , "o" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  {
+              "type": "triple" , 
+              "value": {
+                "subject":  { "type": "uri" , "value": "http://example/s" } ,
+                "property": { "type": "uri" , "value": "http://example/p1" } ,
+                "object":   { "type": "uri" , "value": "http://example/o" }
+              }
+            } ,
+            "property": { "type": "uri" , "value": "http://example/q1" } ,
+            "object":   { "type": "uri" , "value": "http://example/z1" }
+          }
+        } ,
+        "s": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p1" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        } ,
+        "p": { "type": "uri" , "value": "http://example/q1" } ,
+        "o": { "type": "uri" , "value": "http://example/z1" }
+      } ,
+      { 
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p1" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        } ,
+        "s": { "type": "uri" , "value": "http://example/s" } ,
+        "p": { "type": "uri" , "value": "http://example/p1" } ,
+        "o": { "type": "uri" , "value": "http://example/o" }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.arq
new file mode 100644
index 0000000..059f460
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.arq
@@ -0,0 +1,12 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+  GRAPH :g1 {
+    <<?s ?p ?o >> ?q ?z .
+  }
+}
+
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.srj
new file mode 100644
index 0000000..5f7b82d
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-named-graph-2.srj
@@ -0,0 +1,15 @@
+{ "head": {
+    "vars": [ "s" , "p" , "o" , "q" , "z" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "s": { "type": "uri" , "value": "http://example/s" } ,
+        "p": { "type": "uri" , "value": "http://example/p1" } ,
+        "o": { "type": "uri" , "value": "http://example/o" } ,
+        "q": { "type": "uri" , "value": "http://example/q1" } ,
+        "z": { "type": "uri" , "value": "http://example/z1" }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-01.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-01.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-01.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-01.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-01.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-01.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-01.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-01.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-02.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-02.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-02.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-02.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-02.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-02.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-02.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-02.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-03.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-03.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-03.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-03.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-03.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-03.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-03.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-03.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-04.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-04.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-04.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-04.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-04.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-04.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-04.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-04.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-05.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-05.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-05.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-05.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-05.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-05.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-05.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-05.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-06.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-06.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-06.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-06.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-06.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-06.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-06.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-06.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-07.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-07.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-07.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-07.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-07.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-07.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-07.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-07.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-08.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-08.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-08.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-08.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-08.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-08.srj
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-pattern-08.srj
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-08.srj
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.arq
new file mode 100644
index 0000000..2532efb
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.arq
@@ -0,0 +1,10 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+# No match
+SELECT * {
+   <<?s ?p :nomatch>> ?q ?z .
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.srj
new file mode 100644
index 0000000..6525df9
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-pattern-09.srj
@@ -0,0 +1,9 @@
+{ "head": {
+    "vars": [ "s" , "p" , "q" , "z" ]
+  } ,
+  "results": {
+    "bindings": [
+      
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-01.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-01.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-01.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-01.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-02.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-02.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-02.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-02.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-03.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-03.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-03.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-03.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-04.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-04.arq
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-syntax-04.arq
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-04.arq
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-05.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-05.arq
new file mode 100644
index 0000000..4bb8a65
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-syntax-05.arq
@@ -0,0 +1,10 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+    FIND ( << :s :p1 :o >> as ?t )
+    ?t ?p ?o .
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.arq
new file mode 100644
index 0000000..c56e293
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.arq
@@ -0,0 +1,12 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+SELECT * {
+  GRAPH <urn:x-arq:UnionGraph> {
+     # Spans graphs
+     << <<:s :p1 ?o>> :q1 :z1 >> :q1 ?z .
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.srj
new file mode 100644
index 0000000..bea53f1
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-1.srj
@@ -0,0 +1,12 @@
+{ "head": {
+    "vars": [ "o" , "z" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "o": { "type": "uri" , "value": "http://example/o" } ,
+        "z": { "type": "uri" , "value": "http://example/z1" }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.arq b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.arq
new file mode 100644
index 0000000..4213363
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.arq
@@ -0,0 +1,13 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX :       <http://example/>
+
+# Nesting via match
+SELECT * {
+  GRAPH <urn:x-arq:UnionGraph> {
+     FIND( <<:s :p1 ?o>> AS ?t )
+     << ?t :q1 :z1 >> :q1 ?z .
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.srj b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.srj
new file mode 100644
index 0000000..ff18e9e
--- /dev/null
+++ b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-union-2.srj
@@ -0,0 +1,20 @@
+{ "head": {
+    "vars": [ "t" , "o" , "z" ]
+  } ,
+  "results": {
+    "bindings": [
+      { 
+        "t": {
+          "type": "triple" , 
+          "value": {
+            "subject":  { "type": "uri" , "value": "http://example/s" } ,
+            "property": { "type": "uri" , "value": "http://example/p1" } ,
+            "object":   { "type": "uri" , "value": "http://example/o" }
+          }
+        } ,
+        "o": { "type": "uri" , "value": "http://example/o" } ,
+        "z": { "type": "uri" , "value": "http://example/z1" }
+      }
+    ]
+  }
+}
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-bad-syntax-01.aru b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-bad-syntax-01.aru
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-bad-syntax-01.aru
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-bad-syntax-01.aru
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-bad-syntax-02.aru b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-bad-syntax-02.aru
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-bad-syntax-02.aru
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-bad-syntax-02.aru
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-syntax-01.aru b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-syntax-01.aru
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-syntax-01.aru
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-syntax-01.aru
diff --git a/jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-syntax-02.aru b/jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-syntax-02.aru
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/SPARQL-star/sparql-star-update-syntax-02.aru
rename to jena-arq/testing/ARQ/RDF-Star/SPARQL-Star/sparql-star-update-syntax-02.aru
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/manifest.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/manifest.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/manifest.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/manifest.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-01.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-01.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-01.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-01.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-02.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-02.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-02.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-02.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-03.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-03.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-03.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-03.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-04.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-04.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-04.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-04.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-05.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-05.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-05.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-05.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-06.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-06.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-06.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-06.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-07.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-07.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-07.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-07.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-01.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-01.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-01.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-01.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-02.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-02.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-02.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-02.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-03.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-03.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-03.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-03.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-04.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-04.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-04.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-04.ttl
diff --git a/jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-05.ttl b/jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-05.ttl
similarity index 100%
rename from jena-arq/testing/ARQ/RDF-Star/Turtle-star/turtle-star-syntax-bad-05.ttl
rename to jena-arq/testing/ARQ/RDF-Star/Turtle-Star/turtle-star-syntax-bad-05.ttl
diff --git a/jena-cmds/src/main/java/arq/cmdline/ModQueryIn.java b/jena-cmds/src/main/java/arq/cmdline/ModQueryIn.java
index 290df7c..26e41e3 100644
--- a/jena-cmds/src/main/java/arq/cmdline/ModQueryIn.java
+++ b/jena-cmds/src/main/java/arq/cmdline/ModQueryIn.java
@@ -66,7 +66,7 @@
 
         if ( cmdline.contains(queryFileDecl) ) {
             queryFilename = cmdline.getValue(queryFileDecl) ;
-            querySyntax = Syntax.guessFileSyntax(queryFilename, defaultQuerySyntax) ;
+            querySyntax = Syntax.guessQueryFileSyntax(queryFilename, defaultQuerySyntax) ;
         }
 
         if ( cmdline.getNumPositional() == 0 && queryFilename == null )
@@ -82,7 +82,7 @@
             // One positional argument.
             String qs = cmdline.getPositionalArg(0) ;
             if ( cmdline.matchesIndirect(qs) )
-                querySyntax = Syntax.guessFileSyntax(qs, defaultQuerySyntax) ;
+                querySyntax = Syntax.guessQueryFileSyntax(qs, defaultQuerySyntax) ;
 
             queryString = cmdline.indirect(qs) ;
         }
diff --git a/jena-cmds/src/main/java/arq/qparse.java b/jena-cmds/src/main/java/arq/qparse.java
index 041ebeb..2cee976 100644
--- a/jena-cmds/src/main/java/arq/qparse.java
+++ b/jena-cmds/src/main/java/arq/qparse.java
@@ -20,6 +20,7 @@
 
 import java.io.PrintStream ;
 import java.util.Iterator ;
+import java.util.Locale;
 
 import arq.cmdline.CmdARQ ;
 import arq.cmdline.ModEngine ;
@@ -43,7 +44,7 @@
 
 public class qparse extends CmdARQ
 {
-    protected ModQueryIn    modQuery        = new ModQueryIn(Syntax.syntaxSPARQL_11) ;
+    protected ModQueryIn    modQuery        = new ModQueryIn(Syntax.syntaxARQ) ;
     protected ModQueryOut   modOutput       = new ModQueryOut() ; 
     protected ModEngine     modEngine       = new ModEngine() ;
     protected final ArgDecl argDeclPrint    = new ArgDecl(ArgDecl.HasValue, "print") ;
@@ -71,7 +72,7 @@
         super.addModule(modOutput) ;
         super.addModule(modEngine) ;
         super.getUsage().startCategory(null) ;
-        super.add(argDeclPrint, "--print", "Print in various forms [query, op, quad, plan]") ;
+        super.add(argDeclPrint, "--print", "Print in various forms [query, op, quad, optquad, plan]") ;
         super.add(argDeclExplain, "--explain", "Print with algebra-level optimization") ;
         super.add(argDeclOpt, "--opt", "[deprecated]") ;
         super.add(argDeclFixup, "--fixup", "Convert undeclared prefix names to URIs") ;
@@ -99,48 +100,30 @@
 
         for ( String arg : getValues( argDeclPrint ) )
         {
-            if ( arg.equalsIgnoreCase( "query" ) )
-            {
-                printQuery = true;
-            }
-            else if ( arg.equalsIgnoreCase( "op" ) ||
-                arg.equalsIgnoreCase( "alg" ) ||
-                arg.equalsIgnoreCase( "algebra" ) )
-            {
-                printOp = true;
-            }
-            else if ( arg.equalsIgnoreCase( "quad" ) )
-            {
-                printQuad = true;
-            }
-            else if ( arg.equalsIgnoreCase( "quads" ) )
-            {
-                printQuad = true;
-            }
-            else if ( arg.equalsIgnoreCase( "plan" ) )
-            {
-                printPlan = true;
-            }
-            else if ( arg.equalsIgnoreCase( "opt" ) )
-            {
-                printOpt = true;
-            }
-            else if ( arg.equalsIgnoreCase( "optquad" ) )
-            {
-                printQuadOpt = true;
-            }
-            else if ( arg.equalsIgnoreCase( "quadopt" ) )
-            {
-                printQuadOpt = true;
-            }
-            else if ( arg.equalsIgnoreCase( "none" ) )
-            {
-                printNone = true;
-            }
-            else
-            {
-                throw new CmdException(
-                    "Not a recognized print form: " + arg + " : Choices are: query, op, quad, opt, optquad" );
+            switch(arg.toLowerCase(Locale.ROOT)) {
+                case "query":
+                    printQuery = true;
+                    break;
+                case "op": case "alg": case "algebra":
+                    printOp = true;
+                    break;
+                case "quad": case "quads":
+                    printQuad = true;
+                    break;
+                case "plan":
+                    printPlan = true;
+                    break;
+                case "opt": 
+                    printOpt = true;
+                    break;
+                case "optquad": case "quadopt":
+                    printQuadOpt = true;
+                    break;
+                case "none": 
+                    printNone = true;
+                    break;
+                default:
+                    throw new CmdException("Not a recognized print form: " + arg + " : Choices are: query, op, quad, opt, optquad, plan" );
             }
         }
         
diff --git a/jena-cmds/src/main/java/arq/uparse.java b/jena-cmds/src/main/java/arq/uparse.java
index 22290b5..019b315 100644
--- a/jena-cmds/src/main/java/arq/uparse.java
+++ b/jena-cmds/src/main/java/arq/uparse.java
@@ -111,20 +111,17 @@
         {
             Syntax syntax = updateSyntax ;
             if ( syntax == null )
-                syntax = Syntax.guessUpdateFileSyntax(filename) ;
+                syntax = Syntax.guessFileSyntax(filename) ;
             String x = oneFile( filename );
             if ( x != null )
                 execOne( x, syntax );
         }
-
-        
-        
         
         for ( String x : super.positionals ) {
             Syntax syntax = updateSyntax ;    
             if ( matchesIndirect(x) ) {
                 if ( syntax == null )
-                    syntax = Syntax.guessUpdateFileSyntax(x) ;
+                    syntax = Syntax.guessFileSyntax(x) ;
                 x = indirect( x );
             }
             if ( syntax == null )
diff --git a/jena-core/src/main/java/org/apache/jena/graph/Node_Triple.java b/jena-core/src/main/java/org/apache/jena/graph/Node_Triple.java
index e3a215e..89fd08c 100644
--- a/jena-core/src/main/java/org/apache/jena/graph/Node_Triple.java
+++ b/jena-core/src/main/java/org/apache/jena/graph/Node_Triple.java
@@ -71,7 +71,7 @@
     public boolean isNodeTriple() {
         return true;
     }
-
+    
     @Override
     public String toString(PrefixMapping pm, boolean quoting) {
         return "<< " + label.toString() + " >>";
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/lib/NodeLib.java b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/lib/NodeLib.java
index fc1b7f4..0184336 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/lib/NodeLib.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/lib/NodeLib.java
@@ -33,6 +33,7 @@
 import org.apache.jena.atlas.logging.Log;
 import org.apache.jena.dboe.base.record.Record;
 import org.apache.jena.graph.Node;
+import org.apache.jena.riot.out.NodeFmtLib;
 import org.apache.jena.sparql.util.NodeUtils;
 import org.apache.jena.tdb2.TDBException;
 import org.apache.jena.tdb2.store.Hash;
@@ -47,9 +48,10 @@
         return h;
     }
 
-    private static String BNODE   = "bnode";
-    private static String URI     = "uri";
-    private static String LITERAL = "literal";
+    private static String BNODE         = "bnode";
+    private static String URI           = "uri";
+    private static String LITERAL       = "literal";
+    private static String TRIPLE_TERM   = "tripleTerm";
 
     public static void setHash(Hash h, Node n) {
         if ( n.isURI() )
@@ -65,6 +67,10 @@
                 dt = null;
             }
             hash(h, n.getLiteralLexicalForm(), n.getLiteralLanguage(), dt, LITERAL);
+        } else if ( n.isNodeTriple() ) { 
+            String lex = NodeFmtLib.str(n);
+            hash(h, lex, null, null, TRIPLE_TERM);
+            return;
         } else
             throw new TDBException("Attempt to hash something strange: " + n);
     }
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverLib.java b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverLib.java
index ee13351..0e0c317 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverLib.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverLib.java
@@ -125,7 +125,10 @@
             else
                 // 4-tuples.
                 tuple = TupleFactory.tuple(graphNode, triple.getSubject(), triple.getPredicate(), triple.getObject());
-            chain = solve(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt);
+            // Plain RDF
+            //chain = solve(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;
+            // RDF*
+            chain = SolverRX.solveRX(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;
             chain = makeAbortable(chain, killList);
         }
 
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverRX.java b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverRX.java
new file mode 100644
index 0000000..f43d2aa
--- /dev/null
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/SolverRX.java
@@ -0,0 +1,315 @@
+/*
+ * 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 org.apache.jena.tdb2.solver;
+
+import static org.apache.jena.graph.Node_Triple.triple;
+
+import java.util.Iterator;
+import java.util.function.Predicate;
+
+import org.apache.jena.atlas.iterator.Iter;
+import org.apache.jena.atlas.lib.Pair;
+import org.apache.jena.atlas.lib.tuple.Tuple;
+import org.apache.jena.atlas.lib.tuple.TupleFactory;
+import org.apache.jena.atlas.logging.FmtLog;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+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.engine.ExecutionContext;
+import org.apache.jena.sparql.engine.iterator.RX;
+import org.apache.jena.sparql.util.Context;
+import org.apache.jena.tdb2.TDBException;
+import org.apache.jena.tdb2.store.NodeId;
+import org.apache.jena.tdb2.store.nodetable.NodeTable;
+import org.apache.jena.tdb2.store.nodetupletable.NodeTupleTable;
+
+/**
+ * See {@link RX} which is the same algorithm for Triple/Node space.
+ */
+public class SolverRX {
+
+    // These argument get passed around a lot, making the argument lists long.
+    private static class Args {
+        final NodeTupleTable nodeTupleTable;
+        final boolean anyGraph;
+        final Predicate<Tuple<NodeId>> filter;
+        final ExecutionContext execCxt;
+        final VarAlloc varAlloc;
+        Args(NodeTupleTable nodeTupleTable, boolean anyGraph, Predicate<Tuple<NodeId>> filter, ExecutionContext execCxt) {
+            super();
+            this.nodeTupleTable = nodeTupleTable;
+            this.anyGraph = anyGraph;
+            this.filter = filter;
+            this.execCxt = execCxt;
+            this.varAlloc = varAlloc(execCxt);
+        }
+    }
+
+    private static VarAlloc varAlloc(ExecutionContext execCxt) {
+        Context context = execCxt.getContext();
+        VarAlloc varAlloc = VarAlloc.get(context, ARQConstants.sysVarAllocRDFStar);
+        if ( varAlloc == null ) {
+            varAlloc = new VarAlloc(ARQConstants.allocVarTripleTerm);
+            context.set(ARQConstants.sysVarAllocRDFStar, varAlloc);  
+        }
+        return varAlloc;
+    }
+
+    // Call point for SolverLib.execute
+    public static Iterator<BindingNodeId> solveRX(NodeTupleTable nodeTupleTable, Tuple<Node> pattern, boolean anyGraph,
+                                                  Iterator<BindingNodeId> chain, Predicate<Tuple<NodeId>> filter,
+                                                  ExecutionContext execCxt) {
+        if ( ! tripleHasNodeTriple(pattern) )
+            SolverLib.solve(nodeTupleTable, pattern, anyGraph, chain, filter, execCxt);
+        
+        Args args = new Args(nodeTupleTable, anyGraph, filter, execCxt);
+        return rdfStarTriple(chain, pattern, args);
+    }
+
+    /**
+     * Match a single triple pattern that may involve RDF* terms. This is the top
+     * level function for matching triples. The function {@link #matchTripleStar}
+     * matches a triple term and assigns the triple matched to a variable. It is used
+     * within {@link #rdfStarTriple} for nested triple term and a temporary allocated
+     * variable as well can for {@code FIND(<<...>> AS ?t)}.
+     *
+     * @implNote 
+     * Without RDF*, this would be a plain call of {@link #matchData} which
+     * is simply a call to {@link SolverLib#solve}.
+     */
+    private static Iterator<BindingNodeId> rdfStarTriple(Iterator<BindingNodeId> input, Tuple<Node> pattern, Args args) {
+        // Should all work without this trap for plain RDF.
+        if ( ! tripleHasNodeTriple(pattern) )
+            return matchData( input, pattern, args);
+        return rdfStarTripleSub(input, pattern, args);
+    }
+
+    /**
+     * Insert the stages necessary for a triple with triple pattern term inside it.
+     * If the triple pattern has a triple term, possibly with variables, introduce
+     * an iterator to solve for that, assign the matching triple term to a hidden
+     * variable, and put allocated variable in to main triple pattern. Do for subject
+     * and object positions, and also any nested triple pattern terms.
+     */
+    private static Iterator<BindingNodeId> rdfStarTripleSub(Iterator<BindingNodeId> input,
+                                                            Tuple<Node> pattern, Args args) {
+        Pair<Iterator<BindingNodeId>, Tuple<Node>> pair = preprocessForTripleTerms(input, pattern, args);
+        Iterator<BindingNodeId> chain2 = matchData(pair.getLeft(), pair.getRight(), args);
+        return chain2;
+    }
+
+    /**
+     * Match a triple pattern (which may have nested triple terms in it).
+     * Any matched triples are added as triple terms bound to the supplied variable.
+     */
+    private static Iterator<BindingNodeId> matchTripleStar(Iterator<BindingNodeId> chain, Var var, Tuple<Node> pattern, Args args) {
+        if ( tripleHasNodeTriple(pattern) ) {
+            Pair<Iterator<BindingNodeId>, Tuple<Node>> pair =
+                preprocessForTripleTerms(chain, pattern, args);
+            chain = pair.getLeft();
+            pattern = pair.getRight();
+        }
+        // Match to data and assign to var in each binding, based on the triple pattern grounded by the match.
+        Iterator<BindingNodeId> qIter = bindTripleTerm(chain, var, pattern, args);
+        return qIter;
+    }
+
+    /**
+     * Process a triple for triple terms.
+     * <p>
+     * This creates additional matchers for triple terms in the pattern triple recursively.
+     */
+    private static Pair<Iterator<BindingNodeId>, Tuple<Node>>
+            preprocessForTripleTerms(Iterator<BindingNodeId> chain, Tuple<Node> patternTuple, Args args) {
+        int sIdx = subjectIdx(patternTuple);
+        int oIdx = objectIdx(patternTuple);
+
+        Node subject = patternTuple.get(sIdx);
+        Node object = patternTuple.get(oIdx);
+        Node subject1 = null;
+        Node object1 = null;
+
+        if ( subject.isNodeTriple() && ! subject.isConcrete() ) {
+            Triple tripleTerm = triple(subject);
+            Var var = args.varAlloc.allocVar();
+            patternTuple = createTuple(patternTuple, var, sIdx);
+            Tuple<Node> patternTuple2 = tuple(patternTuple, tripleTerm);
+            chain = matchTripleStar(chain, var, patternTuple2, args);
+            subject1 = var;
+        }
+
+        if ( object.isNodeTriple() && ! object.isConcrete() ) {
+            Triple tripleTerm = triple(object);
+            Var var = args.varAlloc.allocVar();
+            patternTuple = createTuple(patternTuple, var, oIdx);
+            Tuple<Node> patternTuple2 = tuple(patternTuple, tripleTerm);
+            chain = matchTripleStar(chain, var, patternTuple2, args);
+            object1 = var;
+        }
+
+        if ( subject1 == null && object1 == null )
+            return Pair.create(chain, patternTuple);
+        return Pair.create(chain, patternTuple);
+    }
+
+    /**
+     * Add a binding to each row with triple grounded by the current row.
+     * If the triple isn't concrete, then just return the row as-is.
+     */
+    private static Iterator<BindingNodeId> bindTripleTerm(Iterator<BindingNodeId> chain, Var var, Tuple<Node> pattern, Args args) {
+        NodeTable nodeTable = args.nodeTupleTable.getNodeTable();
+        chain = matchData(chain, pattern, args);
+        // Add (var, triple term), filter no matches.
+        chain = Iter.iter(chain).map(b->bindVarTripleTerm(var, pattern, b, nodeTable)).removeNulls();
+        return chain;
+    }
+
+    // We need to reconstruct the reason the pattern matched
+    // to find the NodeId for the Node_Triple.
+    // This involves creating a Node_Triple and looking it up.
+    // This isn't ideal but without triple ids in the database,
+    // there isn't much we can do.
+    private static BindingNodeId bindVarTripleTerm(Var var, Tuple<Node> pattern, BindingNodeId binding, NodeTable nodeTable) {
+        // Get triple out of tuple of length 3 or 4.
+        int idx = (pattern.len()==4) ? 1 : 0;
+
+        // Access to Nodes.
+        Node s = pattern.get(idx);
+        Node s1 = substitute(s, binding, nodeTable);
+        if ( s1 == null || ! s1.isConcrete() )
+            return null;
+
+        Node p = pattern.get(idx+1);
+        Node p1 = substitute(p, binding, nodeTable);
+        if ( p1 == null || ! p1.isConcrete() )
+            return null;
+
+        Node o = pattern.get(idx+2);
+        Node o1 = substitute(o, binding, nodeTable);
+        if ( o1 == null || ! o1.isConcrete() )
+            return null;
+
+        // Does it exist?
+        Node t = NodeFactory.createTripleNode(s1,p1,o1);
+        NodeId tid = nodeTable.getNodeIdForNode(t);
+        // Should not happen.
+        if ( NodeId.isDoesNotExist(tid) )
+            return null;
+        // Already bound (FIND)?
+        if ( binding.containsKey(var) ) {
+            NodeId tid2 = binding.get(var);
+            if ( tid.equals(tid2) )
+                return binding;
+            return null;
+        }
+        
+        BindingNodeId b2 = new BindingNodeId(binding);
+        b2.put(var, tid);
+        return b2;
+    }
+
+    private static Node substitute(Node node, BindingNodeId binding, NodeTable nodeTable) {
+        if ( ! Var.isVar(node) )
+            return node;
+        Var var = Var.alloc(node);
+        try {
+            NodeId id = binding.get(var) ;
+            if ( id == null )
+                return null ;
+            if ( NodeId.isDoesNotExist(id) )
+                return null;
+            Node n = nodeTable.getNodeForNodeId(id) ;
+            if ( n == null )
+                // But there was to put it in the BindingNodeId.
+                throw new TDBException("No node in NodeTable for NodeId "+id);
+            return n ;
+        } catch (Exception ex)
+        {
+            FmtLog.error(SolverRX.class, ex, "SolverRX: substitute(%s) %s", node, binding) ;
+            return null ;
+        }
+    }
+
+    /**
+     * Match the NodeTupleTable with a tuple pattern.
+     * This is the accessor to the data.
+     * It assumes any triple terms have been dealt with.
+     */
+
+    private static Iterator<BindingNodeId> matchData(Iterator<BindingNodeId> chain, Tuple<Node> pattern, Args args) {
+        return SolverLib.solve(args.nodeTupleTable, pattern, args.anyGraph, chain, args.filter, args.execCxt);
+    }
+
+    private static Tuple<Node> createTuple(Tuple<Node> tuple, Var var, int idx) {
+        switch(idx) {
+            case 0: return TupleFactory.create3(var, tuple.get(1), tuple.get(2));
+            case 1: return TupleFactory.create4(tuple.get(0), var, tuple.get(2), tuple.get(3));
+            case 2: return TupleFactory.create3(tuple.get(0), tuple.get(1), var);
+            case 3: return TupleFactory.create4(tuple.get(0), tuple.get(1), tuple.get(2), var);
+            default:
+                throw new TDBException("Index is not recognized: "+idx);
+        }
+    }
+
+    private static int subjectIdx(Tuple<Node> pattern) {
+        switch(pattern.len()) {
+            case 3: return 0;
+            case 4: return 1;
+            default: throw new TDBException("Tuple not of length 3 or 4");
+        }
+    }
+
+    private static int objectIdx(Tuple<Node> pattern) {
+        switch(pattern.len()) {
+            case 3: return 2;
+            case 4: return 3;
+            default: throw new TDBException("Tuple not of length 3 or 4");
+        }
+    }
+
+    // Get NodeId for constants
+    private static NodeId idFor(NodeTable nodeTable, Node node) {
+        if ( Var.isVar(node) )
+            return null;
+        return nodeTable.getNodeIdForNode(node);
+    }
+
+    private static boolean tripleHasNodeTriple(Tuple<Node> pattern) {
+        int sIdx = subjectIdx(pattern);
+        if ( pattern.get(sIdx).isNodeTriple() )
+            return true;
+        int oIdx = subjectIdx(pattern);
+        if ( pattern.get(oIdx).isNodeTriple() )
+            return true;
+        return false;
+    }
+
+    private static Tuple<Node> tuple(Tuple<Node> base, Triple triple) {
+        switch(base.len()){
+            case 3: 
+                return TupleFactory.create3(triple.getSubject(), triple.getPredicate(), triple.getObject());   
+            case 4:
+                return TupleFactory.create4(base.get(0), triple.getSubject(), triple.getPredicate(), triple.getObject());
+            default:
+        }       throw new TDBException("Tuple not of length 3 or 4"); 
+    }
+}
\ No newline at end of file
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TC_TDB2.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TC_TDB2.java
index 4d9c459..c4a26ae 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TC_TDB2.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TC_TDB2.java
@@ -55,6 +55,7 @@
     , TS_TDBAssembler.class
     , TS_Sys.class
     , TS_Loader.class
+    , TS_ScriptsTDB2.class
 } )
 
 public class TC_TDB2
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TS_ScriptsTDB2.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TS_ScriptsTDB2.java
new file mode 100644
index 0000000..73c2094
--- /dev/null
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TS_ScriptsTDB2.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.jena.tdb2;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestScriptsTDB2.class
+})
+
+public class TS_ScriptsTDB2 {}
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestScriptsTDB2.java
similarity index 62%
copy from jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java
copy to jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestScriptsTDB2.java
index 22cc7e7..5e44bde 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestScriptsTDB2.java
@@ -16,25 +16,29 @@
  * limitations under the License.
  */
 
-package org.apache.jena.tdb.store;
+package org.apache.jena.tdb2;
 
 import junit.framework.TestSuite ;
-import org.apache.jena.tdb.ConfigTest ;
-import org.apache.jena.tdb.junit.TestFactoryTDB ;
+import org.apache.jena.tdb2.junit.TestFactoryTDB2;
 import org.junit.runner.RunWith ;
 import org.junit.runners.AllTests ;
 
 /** Scripted test generation */
 
 @RunWith(AllTests.class)
-public class TestSuiteGraphTDB extends TestSuite
+public class TestScriptsTDB2 extends TestSuite
 {
-    static public TestSuite suite() { return new TestSuiteGraphTDB() ; }
+    static final String ARQ_DIR = "../../jena-arq/testing/ARQ";
+    static public TestSuite suite() { return new TestScriptsTDB2(); }
     
-    private TestSuiteGraphTDB()
+    private TestScriptsTDB2()
     {
         super("TDB-Scripts") ;
-        String manifestMain = ConfigTest.getTestingDataRoot()+"/manifest.ttl" ;
-        TestFactoryTDB.make(this, manifestMain, "TDB-") ;
+        String manifestMain1 = ConfigTest.getTestingDataRoot()+"/manifest.ttl";
+        TestFactoryTDB2.make(this, manifestMain1, "TDB2-");
+
+        // From ARQ
+        String manifestMain2 = ARQ_DIR + "/RDF-Star/SPARQL-Star/manifest.ttl";
+        TestFactoryTDB2.make(this, manifestMain2, "TDB2-");
     }
 }
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestTDB2.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestTDB2.java
index d1af13c..a7fd3c8 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestTDB2.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/TestTDB2.java
@@ -40,8 +40,8 @@
 /** Misc tests for TDB2. */
 public class TestTDB2 {
     // Safe on MS Windows - different directories for abort1 and abort2.
-    static String DIR1 = "DB_1";
-    static String DIR2 = "DB_2";
+    static String DIR1 = "target/tdb-testing/DB_1";
+    static String DIR2 = "target/tdb-testing/DB_2";
 
     @BeforeClass public static void beforeClass() {
         FileOps.ensureDir(DIR1);
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB2.java
similarity index 85%
rename from jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB.java
rename to jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB2.java
index f0951ed..1b78db6 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/QueryTestTDB2.java
@@ -20,9 +20,8 @@
 
 import java.util.List;
 
-import org.apache.jena.system.Txn;
 import org.apache.jena.query.*;
-import org.apache.jena.rdf.model.Model;
+import org.apache.jena.riot.RDFDataMgr;
 import org.apache.jena.sparql.SystemARQ;
 import org.apache.jena.sparql.engine.QueryEngineFactory;
 import org.apache.jena.sparql.engine.QueryExecutionBase;
@@ -32,17 +31,17 @@
 import org.apache.jena.sparql.junit.TestItem;
 import org.apache.jena.sparql.resultset.ResultSetCompare;
 import org.apache.jena.sparql.resultset.SPARQLResult;
+import org.apache.jena.system.Txn;
 import org.apache.jena.tdb2.TDB2Factory;
-import org.apache.jena.util.FileManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class QueryTestTDB extends EarlTestCase
+public class QueryTestTDB2 extends EarlTestCase
 {
     // Changed to using in-memory graphs/datasets because this is testing the query
     // processing.  Physical graph/datsets is in package "store".
 
-    private static Logger log = LoggerFactory.getLogger(QueryTestTDB.class);
+    private static Logger log = LoggerFactory.getLogger(QueryTestTDB2.class);
     private Dataset dataset = null;
 
     boolean skipThisTest = false;
@@ -57,7 +56,7 @@
     private static List<String> currentNamedGraphs = null;
 
     // Old style (Junit3)
-    public QueryTestTDB(String testName, EarlReport report, TestItem item)
+    public QueryTestTDB2(String testName, EarlReport report, TestItem item)
     {
         this(testName, report, item.getURI(),
              item.getDefaultGraphURIs(), item.getNamedGraphURIs(),
@@ -65,7 +64,7 @@
              );
     }
 
-    public QueryTestTDB(String testName, EarlReport report,
+    public QueryTestTDB2(String testName, EarlReport report,
                         String uri,
                         List<String> dftGraphs,
                         List<String> namedGraphs,
@@ -113,11 +112,12 @@
 
         //graphLocation.clear();
 
+        // Allow "qt:data" to be quads in defaultGraphURIs.
         for ( String fn : defaultGraphURIs )
-            load(dataset.getDefaultModel(), fn);
-
+            RDFDataMgr.read(dataset, fn);
+        
         for ( String fn : namedGraphURIs )
-            load(dataset.getNamedModel(fn), fn);
+            RDFDataMgr.read(dataset.getNamedModel(fn), fn) ;
     }
 
 
@@ -131,28 +131,31 @@
         }
 
         Query query = QueryFactory.read(queryFile);
-        Dataset ds = DatasetFactory.create(defaultGraphURIs, namedGraphURIs);
+        
+        Dataset ds = DatasetFactory.create();
+        for ( String fn : defaultGraphURIs )
+            RDFDataMgr.read(ds, fn);    // Allow quads
+        for ( String fn : namedGraphURIs )
+            RDFDataMgr.read(ds.getNamedModel(fn), fn) ;
 
         // ---- First, get the expected results by executing in-memory or from a results file.
 
-        ResultSetRewindable rs1$ = null;
-        String expectedLabel$ = "";
+        ResultSetRewindable rs1;
+        String expectedLabel;
         if ( results != null )
         {
-            rs1$ = ResultSetFactory.makeRewindable(results.getResultSet());
-            expectedLabel$ = "Results file";
+            rs1 = ResultSetFactory.makeRewindable(results.getResultSet());
+            expectedLabel = "Results file";
         }
         else
         {
             QueryEngineFactory f = QueryEngineRef.getFactory();
             try(QueryExecution qExec1 = new QueryExecutionBase(query, ds, null, f)) {
-                rs1$ = ResultSetFactory.makeRewindable(qExec1.execSelect());
+                rs1 = ResultSetFactory.makeRewindable(qExec1.execSelect());
             }
-            expectedLabel$ = "Standard engine";
+            expectedLabel = "Standard engine";
         }
         // Effectively final.
-        ResultSetRewindable rs1 = rs1$;
-        String expectedLabel = expectedLabel$;
         // ---- Second, execute in persistent graph
 
         Dataset ds2 = dataset; //DatasetFactory.create(model) ;
@@ -179,11 +182,6 @@
         });
     }
 
-    private static void load(Model model, String fn)
-    {
-        FileManager.get().readModel(model, fn);
-    }
-
     private static boolean compareLists(List<String> list1, List<String> list2)
     {
         if ( list1 == null )
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB2.java
similarity index 73%
rename from jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB.java
rename to jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB2.java
index 67e1dc6..4a77800 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/junit/TestFactoryTDB2.java
@@ -28,7 +28,7 @@
 import org.apache.jena.sparql.vocabulary.TestManifestX;
 import org.apache.jena.util.junit.TestFactoryManifest;
 
-public class TestFactoryTDB extends TestFactoryManifest
+public class TestFactoryTDB2 extends TestFactoryManifest
 {
     public static EarlReport report = null;
 
@@ -41,7 +41,7 @@
 
     public static TestSuite makeSuite(String manifestFile, String testRootName)
     {
-        TestFactoryTDB f = new TestFactoryTDB(testRootName);
+        TestFactoryTDB2 f = new TestFactoryTDB2(testRootName);
         TestSuite ts = f.process(manifestFile);
         if ( testRootName != null )
             ts.setName(testRootName+ts.getName());
@@ -52,7 +52,7 @@
 
     public String testRootName;
 
-    public TestFactoryTDB(String testRootName)
+    public TestFactoryTDB2(String testRootName)
     {
         this.testRootName = testRootName;
     }
@@ -70,17 +70,32 @@
         if ( testItem.getTestType() != null )
         {
             if ( testItem.getTestType().equals(TestManifestX.TestQuery) )
-                test = new QueryTestTDB(testName, report, testItem);
+                test = new QueryTestTDB2(testName, report, testItem);
 
             if ( testItem.getTestType().equals(TestManifestX.TestSurpressed) )
                 test = new SurpressedTest(testName, report, testItem);
+            
+            // Ignore syntax tests
+            if ( testItem.getTestType().equals(TestManifestX.PositiveSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.NegativeSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.PositiveUpdateSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.NegativeUpdateSyntaxTestARQ) )
+                // Ignore
+                return null;
+
 
             if ( test == null )
                 System.err.println("Unrecognized test type: "+testItem.getTestType());
         }
         // Default
         if ( test == null )
-            test = new QueryTestTDB(testName, report, testItem);
+            test = new QueryTestTDB2(testName, report, testItem);
 
         return test;
     }
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TS_Store.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TS_Store.java
index c57ea61..9051864 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TS_Store.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TS_Store.java
@@ -41,9 +41,6 @@
     , TestGraphNamedTDB.class
     , TestDatasetTDB.class
     , TestDatasetTDBPersist.class
-    // The script suite
-    , TestSuiteGraphTDB.class
-
     , Test_SPARQL_TDB.class
     , TestDynamicDatasetTDB.class
     , TestStoreConnectionMem.class
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestQuadFilter.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestQuadFilter.java
index 87302bb..2046458 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestQuadFilter.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestQuadFilter.java
@@ -18,12 +18,14 @@
 
 package org.apache.jena.tdb2.store;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.function.Predicate;
 
-import static org.junit.Assert.*;
 import org.apache.jena.atlas.lib.tuple.Tuple;
 import org.apache.jena.graph.NodeFactory;
 import org.apache.jena.query.*;
+import org.apache.jena.sparql.core.DatasetGraph;
 import org.apache.jena.sparql.core.Quad;
 import org.apache.jena.sparql.sse.SSE;
 import org.apache.jena.system.Txn;
@@ -31,31 +33,19 @@
 import org.apache.jena.tdb2.TDB2Factory;
 import org.apache.jena.tdb2.store.nodetable.NodeTable;
 import org.apache.jena.tdb2.sys.SystemTDB;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
+import org.apache.jena.tdb2.sys.TDBInternal;
 import org.junit.Test;
 
-@Ignore("Quad filter tests not ready (transactions)")
 public class TestQuadFilter
 {
     private static String graphToHide = "http://example/g2";
     private static Dataset ds = setup();
 
-
-    @BeforeClass public static void beforeClass()
-    {
-
-    }
-
-    @AfterClass public static void afterClass() {}
-
     /** Example setup - in-memory dataset with two graphs, one triple in each */
-    private static Dataset setup()
-    {
+    private static Dataset setup() {
         Dataset ds = TDB2Factory.createDataset();
-        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph());
-        Txn.executeWrite(dsg,  ()->{
+        DatasetGraph dsg = ds.asDatasetGraph();
+        Txn.executeWrite(dsg, () -> {
             Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)");
             Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)");
             dsg.add(q1);
@@ -65,12 +55,11 @@
     }
 
     /** Create a filter to exclude the graph http://example/g2 */
-    private static Predicate<Tuple<NodeId>> createFilter(Dataset ds)
-    {
-        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph());
+    private static Predicate<Tuple<NodeId>> createFilter(Dataset ds) {
+        DatasetGraphTDB dsg = TDBInternal.getDatasetGraphTDB(ds);
         final NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable();
         final NodeId target = nodeTable.getNodeIdForNode(NodeFactory.createURI(graphToHide));
-        return item -> !( item.len() == 4 && item.get(0).equals(target) );
+        return item -> !(item.len() == 4 && item.get(0).equals(target));
     }
 
     @Test public void quad_filter_1()   { test("SELECT * { GRAPH ?g { ?s ?p ?o } }", 1, 2); }
@@ -80,32 +69,22 @@
     private void test(String qs, int withFilter, int withoutFilter)
     {
         Predicate<Tuple<NodeId>> filter = createFilter(ds);
-
-//    private static void example(Dataset ds, Filter<Tuple<NodeId>> filter)
-//    {
-//        String[] x = {
-//            "SELECT * { GRAPH ?g { ?s ?p ?o } }",
-//            "SELECT * { ?s ?p ?o }",
-//            // THis filter does not hide the graph itself, just the quads associated with the graph.
-//            "SELECT * { GRAPH ?g {} }"
-//            };
         Query query = QueryFactory.create(qs);
-
-        try(QueryExecution qExec = QueryExecutionFactory.create(query, ds)) {
-            // Install filter for this query only.
-            qExec.getContext().set(SystemTDB.symTupleFilter, filter);
-            qExec.getContext().setTrue(TDB2.symUnionDefaultGraph);
-            long x1 = ResultSetFormatter.consume(qExec.execSelect());
-            assertEquals(withFilter, x1);
-        }
-        // No filter.
-        try(QueryExecution qExec = QueryExecutionFactory.create(query, ds)) {
-            qExec.getContext().setTrue(TDB2.symUnionDefaultGraph);
-            long x2 = ResultSetFormatter.consume(qExec.execSelect());
-            assertEquals(withoutFilter, x2);
-        }
-
+        
+        Txn.executeRead(ds, ()->{
+            try(QueryExecution qExec = QueryExecutionFactory.create(query, ds)) {
+                // Install filter for this query only.
+                qExec.getContext().set(SystemTDB.symTupleFilter, filter);
+                qExec.getContext().setTrue(TDB2.symUnionDefaultGraph);
+                long x1 = ResultSetFormatter.consume(qExec.execSelect());
+                assertEquals(withFilter, x1);
+            }
+            // No filter.
+            try(QueryExecution qExec = QueryExecutionFactory.create(query, ds)) {
+                qExec.getContext().setTrue(TDB2.symUnionDefaultGraph);
+                long x2 = ResultSetFormatter.consume(qExec.execSelect());
+                assertEquals(withoutFilter, x2);
+            }
+        });
     }
-
-
 }
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestSuiteGraphTDB.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestSuiteGraphTDB.java
deleted file mode 100644
index ad639cf..0000000
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/store/TestSuiteGraphTDB.java
+++ /dev/null
@@ -1,40 +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 org.apache.jena.tdb2.store;
-
-import junit.framework.TestSuite;
-import org.apache.jena.tdb2.ConfigTest;
-import org.apache.jena.tdb2.junit.TestFactoryTDB;
-import org.junit.runner.RunWith;
-import org.junit.runners.AllTests;
-
-/** Scripted test generation */
-
-@RunWith(AllTests.class)
-public class TestSuiteGraphTDB extends TestSuite
-{
-    static public TestSuite suite() { return new TestSuiteGraphTDB(); }
-
-    private TestSuiteGraphTDB()
-    {
-        super("TDB-Scripts");
-        String manifestMain = ConfigTest.getTestingDataRoot()+"/manifest.ttl";
-        TestFactoryTDB.make(this, manifestMain, "TDB-");
-    }
-}
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/BuildElementVisitor.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/BuildElementVisitor.java
index 9a3b89a..7890740 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/BuildElementVisitor.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/BuildElementVisitor.java
@@ -20,24 +20,7 @@
 import java.util.List;
 
 import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
-import org.apache.jena.sparql.syntax.Element;
-import org.apache.jena.sparql.syntax.ElementAssign;
-import org.apache.jena.sparql.syntax.ElementBind;
-import org.apache.jena.sparql.syntax.ElementData;
-import org.apache.jena.sparql.syntax.ElementDataset;
-import org.apache.jena.sparql.syntax.ElementExists;
-import org.apache.jena.sparql.syntax.ElementFilter;
-import org.apache.jena.sparql.syntax.ElementGroup;
-import org.apache.jena.sparql.syntax.ElementMinus;
-import org.apache.jena.sparql.syntax.ElementNamedGraph;
-import org.apache.jena.sparql.syntax.ElementNotExists;
-import org.apache.jena.sparql.syntax.ElementOptional;
-import org.apache.jena.sparql.syntax.ElementPathBlock;
-import org.apache.jena.sparql.syntax.ElementService;
-import org.apache.jena.sparql.syntax.ElementSubQuery;
-import org.apache.jena.sparql.syntax.ElementTriplesBlock;
-import org.apache.jena.sparql.syntax.ElementUnion;
-import org.apache.jena.sparql.syntax.ElementVisitor;
+import org.apache.jena.sparql.syntax.*;
 
 /**
  * An element visitor that does an in-place modification of the elements to 
@@ -88,6 +71,11 @@
 		result=el;
 	}
 
+	@Override public void visit(ElementFind el) {
+        // no change
+        result=el;
+	}
+	
 	@Override
 	public void visit(ElementData el) {
 		// no change
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ElementRewriter.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ElementRewriter.java
index 6ec675e..7a99ff4 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ElementRewriter.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ElementRewriter.java
@@ -99,6 +99,20 @@
 			push(new ElementTriplesBlock());
 		}
 	}
+	
+    @Override
+    public void visit(ElementFind el) {
+        Node n = changeNode(el.getVar());
+        Triple triple = rewrite(el.getTriple());
+        
+        if (n.equals(el.getVar())) {
+            push(new ElementFind(Var.alloc(n), triple));
+        } else {
+            ElementTriplesBlock etb = new ElementTriplesBlock();
+            etb.addTriple(triple);
+            push(etb);
+        }
+    }
 
 	@Override
 	public void visit(ElementData el) {
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/OpRewriter.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/OpRewriter.java
index 28bc58c..71dd5e3 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/OpRewriter.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/OpRewriter.java
@@ -23,7 +23,9 @@
 import java.util.Map;
 
 import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple;
 import org.apache.jena.query.SortCondition ;
+import org.apache.jena.shared.JenaException;
 import org.apache.jena.sparql.algebra.Op ;
 import org.apache.jena.sparql.algebra.OpVisitor ;
 import org.apache.jena.sparql.algebra.Table ;
@@ -107,7 +109,21 @@
 		push(new OpPath(rewrite(opPath.getTriplePath())));
 	}
 
-	@Override
+    @Override
+    public void visit(OpFind opFind) {
+        Var var = opFind.getVar();
+        Triple triple = opFind.getTriple();
+        
+        Node n2 = changeNode(var);
+        if ( ! Var.isVar(n2) )
+            throw new JenaException("OpFind: Write if not a variable");
+        
+        Var var2 = Var.alloc(n2); 
+        Triple triple2 = rewrite(triple); 
+        push(new OpFind(triple2, var2));
+    }
+
+    @Override
 	public void visit(OpTable opTable) {
 		Table tbl = opTable.getTable();
 		boolean process = false;
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/QuadIteratorBuilder.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/QuadIteratorBuilder.java
index 16cd1a2..8331a80 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/QuadIteratorBuilder.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/QuadIteratorBuilder.java
@@ -26,24 +26,7 @@
 import org.apache.jena.query.QueryParseException;
 import org.apache.jena.sparql.core.Quad;
 import org.apache.jena.sparql.core.TriplePath;
-import org.apache.jena.sparql.syntax.Element;
-import org.apache.jena.sparql.syntax.ElementAssign;
-import org.apache.jena.sparql.syntax.ElementBind;
-import org.apache.jena.sparql.syntax.ElementData;
-import org.apache.jena.sparql.syntax.ElementDataset;
-import org.apache.jena.sparql.syntax.ElementExists;
-import org.apache.jena.sparql.syntax.ElementFilter;
-import org.apache.jena.sparql.syntax.ElementGroup;
-import org.apache.jena.sparql.syntax.ElementMinus;
-import org.apache.jena.sparql.syntax.ElementNamedGraph;
-import org.apache.jena.sparql.syntax.ElementNotExists;
-import org.apache.jena.sparql.syntax.ElementOptional;
-import org.apache.jena.sparql.syntax.ElementPathBlock;
-import org.apache.jena.sparql.syntax.ElementService;
-import org.apache.jena.sparql.syntax.ElementSubQuery;
-import org.apache.jena.sparql.syntax.ElementTriplesBlock;
-import org.apache.jena.sparql.syntax.ElementUnion;
-import org.apache.jena.sparql.syntax.ElementVisitor;
+import org.apache.jena.sparql.syntax.*;
 import org.apache.jena.util.iterator.ExtendedIterator;
 import org.apache.jena.util.iterator.WrappedIterator;
 
@@ -118,6 +101,11 @@
 	}
 
 	@Override
+	public void visit(ElementFind el) {
+	    throw new QueryParseException("FIND not permitted in data quad", -1, -1) ;   
+	}
+
+	@Override
 	public void visit(ElementData el) {
 		throw new QueryParseException("element data not permitted in data quad", -1, -1) ;   
 	}
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/WhereValidator.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/WhereValidator.java
index b04e68b..5165298 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/WhereValidator.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/WhereValidator.java
@@ -19,24 +19,7 @@
 
 import java.util.List;
 
-import org.apache.jena.sparql.syntax.Element;
-import org.apache.jena.sparql.syntax.ElementAssign;
-import org.apache.jena.sparql.syntax.ElementBind;
-import org.apache.jena.sparql.syntax.ElementData;
-import org.apache.jena.sparql.syntax.ElementDataset;
-import org.apache.jena.sparql.syntax.ElementExists;
-import org.apache.jena.sparql.syntax.ElementFilter;
-import org.apache.jena.sparql.syntax.ElementGroup;
-import org.apache.jena.sparql.syntax.ElementMinus;
-import org.apache.jena.sparql.syntax.ElementNamedGraph;
-import org.apache.jena.sparql.syntax.ElementNotExists;
-import org.apache.jena.sparql.syntax.ElementOptional;
-import org.apache.jena.sparql.syntax.ElementPathBlock;
-import org.apache.jena.sparql.syntax.ElementService;
-import org.apache.jena.sparql.syntax.ElementSubQuery;
-import org.apache.jena.sparql.syntax.ElementTriplesBlock;
-import org.apache.jena.sparql.syntax.ElementUnion;
-import org.apache.jena.sparql.syntax.ElementVisitor;
+import org.apache.jena.sparql.syntax.*;
 import org.apache.jena.sparql.util.NodeIsomorphismMap;
 
 /**
@@ -110,7 +93,13 @@
 		return;
 	}
 
-	@Override
+    @Override
+    public void visit(ElementFind el) {
+        checkMatching( el );
+        return;
+    }
+
+    @Override
 	public void visit(ElementData el) {
 		checkMatching( el );
 		return;
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/query/rewriter/OpRewriter.java b/jena-permissions/src/main/java/org/apache/jena/permissions/query/rewriter/OpRewriter.java
index 189bbe4..77a768f 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/query/rewriter/OpRewriter.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/query/rewriter/OpRewriter.java
@@ -324,16 +324,27 @@
 	}
 
 	/**
-	 * rewrites the subop of filter.
+	 * Returns the opFind
 	 */
 	@Override
-	public void visit(final OpFilter opFilter) {
+	public void visit(final OpFind opFind) {
 		if (LOG.isDebugEnabled()) {
-			LOG.debug("Starting visiting OpFilter");
+			LOG.debug("Starting visiting OpFind");
 		}
-		addOp(OpFilter.filterBy(opFilter.getExprs(), rewriteOp1(opFilter)));
+		addOp(opFind);
 	}
 
+    /**
+     * rewrites the subop of filter.
+     */
+    @Override
+    public void visit(final OpFilter opFilter) {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Starting visiting OpFilter");
+        }
+        addOp(OpFilter.filterBy(opFilter.getExprs(), rewriteOp1(opFilter)));
+    }
+
 	/**
 	 * rewrites the subop of graph.
 	 */
diff --git a/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java b/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
index 01814e1..437d85c 100644
--- a/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
+++ b/jena-shacl/src/main/java/org/apache/jena/shacl/engine/ShaclPaths.java
@@ -274,11 +274,12 @@
 
         @Override
         public void visit(P_Alt pathAlt) {
+            // [ sh:alternativePath ( elt1 elt2 ) ]
             Node n1 = pathToRDF$(pathAlt.getLeft());
             Node n2 = pathToRDF$(pathAlt.getRight());
             Node list = list(acc, n1, n2);
+            point = NodeFactory.createBlankNode();
             Triple t = Triple.create(point, SHACL.alternativePath, list);
-            point = list;
             acc.accept(t);
         }
 
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/base/objectfile/StringFile.java b/jena-tdb/src/main/java/org/apache/jena/tdb/base/objectfile/StringFile.java
index bdd3b28..f7a0373 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/base/objectfile/StringFile.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/base/objectfile/StringFile.java
@@ -103,7 +103,6 @@
         }
     } ;
     // ----
- 
     
     // URI compression can be effective but literals are more of a problem.  More variety. 
     public final static boolean compression = false ; 
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/lib/NodeLib.java b/jena-tdb/src/main/java/org/apache/jena/tdb/lib/NodeLib.java
index 284f286..90f2e33 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/lib/NodeLib.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/lib/NodeLib.java
@@ -27,12 +27,10 @@
 import java.util.Iterator ;
 
 import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.lib.Bytes ;
-import org.apache.jena.atlas.lib.Pool ;
-import org.apache.jena.atlas.lib.PoolBase ;
-import org.apache.jena.atlas.lib.PoolSync ;
+import org.apache.jena.atlas.lib.*;
 import org.apache.jena.atlas.logging.Log ;
 import org.apache.jena.graph.Node ;
+import org.apache.jena.riot.out.NodeFmtLib;
 import org.apache.jena.sparql.util.NodeUtils ;
 import org.apache.jena.tdb.TDBException ;
 import org.apache.jena.tdb.base.objectfile.ObjectFile ;
@@ -146,6 +144,11 @@
                 }
                 hash(h, n.getLiteralLexicalForm(), n.getLiteralLanguage(), dt, nt);
                 return;
+            case TRIPLETERM: {
+                String lex = NodeFmtLib.str(n);
+                hash(h, lex, null, null, nt);
+                return;
+            }
             case OTHER :
                 throw new TDBException("Attempt to hash something strange: " + n);
         }
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverLib.java b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverLib.java
index 120eb5e..0539c12 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverLib.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverLib.java
@@ -127,7 +127,10 @@
             else
                 // 4-tuples.
                 tuple = tuple(graphNode, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;
-            chain = solve(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;
+            // Plain RDF
+            //chain = solve(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;
+            // RDF*
+            chain = SolverRX.solveRX(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;
             chain = makeAbortable(chain, killList) ; 
         }
         
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverRX.java b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverRX.java
new file mode 100644
index 0000000..7b661f6
--- /dev/null
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/SolverRX.java
@@ -0,0 +1,315 @@
+/*
+ * 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 org.apache.jena.tdb.solver;
+
+import static org.apache.jena.graph.Node_Triple.triple;
+
+import java.util.Iterator;
+import java.util.function.Predicate;
+
+import org.apache.jena.atlas.iterator.Iter;
+import org.apache.jena.atlas.lib.Pair;
+import org.apache.jena.atlas.lib.tuple.Tuple;
+import org.apache.jena.atlas.lib.tuple.TupleFactory;
+import org.apache.jena.atlas.logging.FmtLog;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+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.engine.ExecutionContext;
+import org.apache.jena.sparql.engine.iterator.RX;
+import org.apache.jena.sparql.util.Context;
+import org.apache.jena.tdb.TDBException;
+import org.apache.jena.tdb.store.NodeId;
+import org.apache.jena.tdb.store.nodetable.NodeTable;
+import org.apache.jena.tdb.store.nodetupletable.NodeTupleTable;
+
+/**
+ * See {@link RX} which is the same algorithm for Triple/Node space.
+ */
+public class SolverRX {
+
+    // These argument get passed around a lot, making the argument lists long.
+    private static class Args {
+        final NodeTupleTable nodeTupleTable;
+        final boolean anyGraph;
+        final Predicate<Tuple<NodeId>> filter;
+        final ExecutionContext execCxt;
+        final VarAlloc varAlloc;
+        Args(NodeTupleTable nodeTupleTable, boolean anyGraph, Predicate<Tuple<NodeId>> filter, ExecutionContext execCxt) {
+            super();
+            this.nodeTupleTable = nodeTupleTable;
+            this.anyGraph = anyGraph;
+            this.filter = filter;
+            this.execCxt = execCxt;
+            this.varAlloc = varAlloc(execCxt);
+        }
+    }
+
+    private static VarAlloc varAlloc(ExecutionContext execCxt) {
+        Context context = execCxt.getContext();
+        VarAlloc varAlloc = VarAlloc.get(context, ARQConstants.sysVarAllocRDFStar);
+        if ( varAlloc == null ) {
+            varAlloc = new VarAlloc(ARQConstants.allocVarTripleTerm);
+            context.set(ARQConstants.sysVarAllocRDFStar, varAlloc);  
+        }
+        return varAlloc;
+    }
+
+    // Call point for SolverLib.execute
+    public static Iterator<BindingNodeId> solveRX(NodeTupleTable nodeTupleTable, Tuple<Node> pattern, boolean anyGraph,
+                                                  Iterator<BindingNodeId> chain, Predicate<Tuple<NodeId>> filter,
+                                                  ExecutionContext execCxt) {
+        if ( ! tripleHasNodeTriple(pattern) )
+            SolverLib.solve(nodeTupleTable, pattern, anyGraph, chain, filter, execCxt);
+        
+        Args args = new Args(nodeTupleTable, anyGraph, filter, execCxt);
+        return rdfStarTriple(chain, pattern, args);
+    }
+
+    /**
+     * Match a single triple pattern that may involve RDF* terms. This is the top
+     * level function for matching triples. The function {@link #matchTripleStar}
+     * matches a triple term and assigns the triple matched to a variable. It is used
+     * within {@link #rdfStarTriple} for nested triple term and a temporary allocated
+     * variable as well can for {@code FIND(<<...>> AS ?t)}.
+     *
+     * @implNote 
+     * Without RDF*, this would be a plain call of {@link #matchData} which
+     * is simply a call to {@link SolverLib#solve}.
+     */
+    private static Iterator<BindingNodeId> rdfStarTriple(Iterator<BindingNodeId> input, Tuple<Node> pattern, Args args) {
+        // Should all work without this trap for plain RDF.
+        if ( ! tripleHasNodeTriple(pattern) )
+            return matchData( input, pattern, args);
+        return rdfStarTripleSub(input, pattern, args);
+    }
+
+    /**
+     * Insert the stages necessary for a triple with triple pattern term inside it.
+     * If the triple pattern has a triple term, possibly with variables, introduce
+     * an iterator to solve for that, assign the matching triple term to a hidden
+     * variable, and put allocated variable in to main triple pattern. Do for subject
+     * and object positions, and also any nested triple pattern terms.
+     */
+    private static Iterator<BindingNodeId> rdfStarTripleSub(Iterator<BindingNodeId> input,
+                                                            Tuple<Node> pattern, Args args) {
+        Pair<Iterator<BindingNodeId>, Tuple<Node>> pair = preprocessForTripleTerms(input, pattern, args);
+        Iterator<BindingNodeId> chain2 = matchData(pair.getLeft(), pair.getRight(), args);
+        return chain2;
+    }
+
+    /**
+     * Match a triple pattern (which may have nested triple terms in it).
+     * Any matched triples are added as triple terms bound to the supplied variable.
+     */
+    private static Iterator<BindingNodeId> matchTripleStar(Iterator<BindingNodeId> chain, Var var, Tuple<Node> pattern, Args args) {
+        if ( tripleHasNodeTriple(pattern) ) {
+            Pair<Iterator<BindingNodeId>, Tuple<Node>> pair =
+                preprocessForTripleTerms(chain, pattern, args);
+            chain = pair.getLeft();
+            pattern = pair.getRight();
+        }
+        // Match to data and assign to var in each binding, based on the triple pattern grounded by the match.
+        Iterator<BindingNodeId> qIter = bindTripleTerm(chain, var, pattern, args);
+        return qIter;
+    }
+
+    /**
+     * Process a triple for triple terms.
+     * <p>
+     * This creates additional matchers for triple terms in the pattern triple recursively.
+     */
+    private static Pair<Iterator<BindingNodeId>, Tuple<Node>>
+            preprocessForTripleTerms(Iterator<BindingNodeId> chain, Tuple<Node> patternTuple, Args args) {
+        int sIdx = subjectIdx(patternTuple);
+        int oIdx = objectIdx(patternTuple);
+
+        Node subject = patternTuple.get(sIdx);
+        Node object = patternTuple.get(oIdx);
+        Node subject1 = null;
+        Node object1 = null;
+
+        if ( subject.isNodeTriple() && ! subject.isConcrete() ) {
+            Triple tripleTerm = triple(subject);
+            Var var = args.varAlloc.allocVar();
+            patternTuple = createTuple(patternTuple, var, sIdx);
+            Tuple<Node> patternTuple2 = tuple(patternTuple, tripleTerm);
+            chain = matchTripleStar(chain, var, patternTuple2, args);
+            subject1 = var;
+        }
+
+        if ( object.isNodeTriple() && ! object.isConcrete() ) {
+            Triple tripleTerm = triple(object);
+            Var var = args.varAlloc.allocVar();
+            patternTuple = createTuple(patternTuple, var, oIdx);
+            Tuple<Node> patternTuple2 = tuple(patternTuple, tripleTerm);
+            chain = matchTripleStar(chain, var, patternTuple2, args);
+            object1 = var;
+        }
+
+        if ( subject1 == null && object1 == null )
+            return Pair.create(chain, patternTuple);
+        return Pair.create(chain, patternTuple);
+    }
+
+    /**
+     * Add a binding to each row with triple grounded by the current row.
+     * If the triple isn't concrete, then just return the row as-is.
+     */
+    private static Iterator<BindingNodeId> bindTripleTerm(Iterator<BindingNodeId> chain, Var var, Tuple<Node> pattern, Args args) {
+        NodeTable nodeTable = args.nodeTupleTable.getNodeTable();
+        chain = matchData(chain, pattern, args);
+        // Add (var, triple term), filter no matches.
+        chain = Iter.iter(chain).map(b->bindVarTripleTerm(var, pattern, b, nodeTable)).removeNulls();
+        return chain;
+    }
+
+    // We need to reconstruct the reason the pattern matched
+    // to find the NodeId for the Node_Triple.
+    // This involves creating a Node_Triple and looking it up.
+    // This isn't ideal but without triple ids in the database,
+    // there isn't much we can do.
+    private static BindingNodeId bindVarTripleTerm(Var var, Tuple<Node> pattern, BindingNodeId binding, NodeTable nodeTable) {
+        // Get triple out of tuple of length 3 or 4.
+        int idx = (pattern.len()==4) ? 1 : 0;
+
+        // Access to Nodes.
+        Node s = pattern.get(idx);
+        Node s1 = substitute(s, binding, nodeTable);
+        if ( s1 == null || ! s1.isConcrete() )
+            return null;
+
+        Node p = pattern.get(idx+1);
+        Node p1 = substitute(p, binding, nodeTable);
+        if ( p1 == null || ! p1.isConcrete() )
+            return null;
+
+        Node o = pattern.get(idx+2);
+        Node o1 = substitute(o, binding, nodeTable);
+        if ( o1 == null || ! o1.isConcrete() )
+            return null;
+
+        // Does it exist?
+        Node t = NodeFactory.createTripleNode(s1,p1,o1);
+        NodeId tid = nodeTable.getNodeIdForNode(t);
+        // Should not happen.
+        if ( NodeId.isDoesNotExist(tid) )
+            return null;
+        // Already bound (FIND)?
+        if ( binding.containsKey(var) ) {
+            NodeId tid2 = binding.get(var);
+            if ( tid.equals(tid2) )
+                return binding;
+            return null;
+        }
+        
+        BindingNodeId b2 = new BindingNodeId(binding);
+        b2.put(var, tid);
+        return b2;
+    }
+
+    private static Node substitute(Node node, BindingNodeId binding, NodeTable nodeTable) {
+        if ( ! Var.isVar(node) )
+            return node;
+        Var var = Var.alloc(node);
+        try {
+            NodeId id = binding.get(var) ;
+            if ( id == null )
+                return null ;
+            if ( NodeId.isDoesNotExist(id) )
+                return null;
+            Node n = nodeTable.getNodeForNodeId(id) ;
+            if ( n == null )
+                // But there was to put it in the BindingNodeId.
+                throw new TDBException("No node in NodeTable for NodeId "+id);
+            return n ;
+        } catch (Exception ex)
+        {
+            FmtLog.error(SolverRX.class, ex, "SolverRX: substitute(%s) %s", node, binding) ;
+            return null ;
+        }
+    }
+
+    /**
+     * Match the NodeTupleTable with a tuple pattern.
+     * This is the accessor to the data.
+     * It assumes any triple terms have been dealt with.
+     */
+
+    private static Iterator<BindingNodeId> matchData(Iterator<BindingNodeId> chain, Tuple<Node> pattern, Args args) {
+        return SolverLib.solve(args.nodeTupleTable, pattern, args.anyGraph, chain, args.filter, args.execCxt);
+    }
+
+    private static Tuple<Node> createTuple(Tuple<Node> tuple, Var var, int idx) {
+        switch(idx) {
+            case 0: return TupleFactory.create3(var, tuple.get(1), tuple.get(2));
+            case 1: return TupleFactory.create4(tuple.get(0), var, tuple.get(2), tuple.get(3));
+            case 2: return TupleFactory.create3(tuple.get(0), tuple.get(1), var);
+            case 3: return TupleFactory.create4(tuple.get(0), tuple.get(1), tuple.get(2), var);
+            default:
+                throw new TDBException("Index is not recognized: "+idx);
+        }
+    }
+
+    private static int subjectIdx(Tuple<Node> pattern) {
+        switch(pattern.len()) {
+            case 3: return 0;
+            case 4: return 1;
+            default: throw new TDBException("Tuple not of length 3 or 4");
+        }
+    }
+
+    private static int objectIdx(Tuple<Node> pattern) {
+        switch(pattern.len()) {
+            case 3: return 2;
+            case 4: return 3;
+            default: throw new TDBException("Tuple not of length 3 or 4");
+        }
+    }
+
+    // Get NodeId for constants
+    private static NodeId idFor(NodeTable nodeTable, Node node) {
+        if ( Var.isVar(node) )
+            return null;
+        return nodeTable.getNodeIdForNode(node);
+    }
+
+    private static boolean tripleHasNodeTriple(Tuple<Node> pattern) {
+        int sIdx = subjectIdx(pattern);
+        if ( pattern.get(sIdx).isNodeTriple() )
+            return true;
+        int oIdx = subjectIdx(pattern);
+        if ( pattern.get(oIdx).isNodeTriple() )
+            return true;
+        return false;
+    }
+
+    private static Tuple<Node> tuple(Tuple<Node> base, Triple triple) {
+        switch(base.len()){
+            case 3: 
+                return TupleFactory.create3(triple.getSubject(), triple.getPredicate(), triple.getObject());   
+            case 4:
+                return TupleFactory.create4(base.get(0), triple.getSubject(), triple.getPredicate(), triple.getObject());
+            default:
+        }       throw new TDBException("Tuple not of length 3 or 4"); 
+    }
+}
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/solver/StageMatchTuple.java b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/StageMatchTuple.java
index 8054343..fad38df 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/solver/StageMatchTuple.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/solver/StageMatchTuple.java
@@ -46,9 +46,9 @@
     private Predicate<Tuple<NodeId>> filter ;
 
     public StageMatchTuple(NodeTupleTable nodeTupleTable, Iterator<BindingNodeId> input, 
-                            Tuple<Node> tuple, boolean anyGraphs, 
-                            Predicate<Tuple<NodeId>> filter, 
-                            ExecutionContext execCxt)
+                           Tuple<Node> tuple, boolean anyGraphs, 
+                           Predicate<Tuple<NodeId>> filter, 
+                           ExecutionContext execCxt)
     {
         super(input) ;
         this.filter = filter ;
@@ -63,7 +63,7 @@
      *  A variable that is not bound by the binding is placed in the var array.
      *  Return false if preparation detects the pattern can not match. 
      */
-    public static boolean prepare(NodeTable nodeTable, Tuple<Node> patternTuple, BindingNodeId input, NodeId ids[], Var[] var)
+    private static boolean prepare(NodeTable nodeTable, Tuple<Node> patternTuple, BindingNodeId input, NodeId ids[], Var[] var)
     {
         // Process the Node to NodeId conversion ourselves because
         // we wish to abort if an unknown node is seen.
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/NodeType.java b/jena-tdb/src/main/java/org/apache/jena/tdb/store/NodeType.java
index 40b99cd..9de3a64 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/NodeType.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/NodeType.java
@@ -24,6 +24,7 @@
 import org.apache.jena.tdb.TDBException ;
 
 // Currently unused.
+// Placeholder for inline encoding.
 public enum NodeType implements Named
 {
     // Do not allocate id 0
@@ -54,11 +55,17 @@
         @Override public int getTypeId()            { return 3 ; }
         @Override public String getName()           { return "Literal" ; }
     } ,
+    
+    TRIPLETERM {
+        @Override public XSDDatatype getDatatype()  { return null ; }
+        @Override public int getTypeId()            { return 4 ; }
+        @Override public String getName()           { return "TripleTerm" ; }
+    } ,
 
 //    STRING
 //    {
 //        @Override public XSDDatatype getDatatype()  { return null ; }
-//        @Override public int getTypeId()            { return 4 ; }
+//        @Override public int getTypeId()            { return 100 ; }
 //        @Override public String getName()           { return "String" ; }
 //    } ,
 //
@@ -160,8 +167,7 @@
     {
         if ( n.isURI() ) return URI ;
         if ( n.isBlank() ) return BNODE ;
-        if ( n.isLiteral() )
-        {
+        if ( n.isLiteral() ) {
             return LITERAL ; 
 //            if ( n.getLiteralDatatypeURI() == null )
 //                // String - plain literal
@@ -175,6 +181,7 @@
 //            if ( n.getLiteralDatatype() == XSDDatatype.XSDdateTime )
 //                return DATETIME ;
         }
+        if ( n.isNodeTriple() ) return TRIPLETERM;
         return OTHER ;
     }
 
@@ -184,6 +191,7 @@
         if ( type == BNODE.getTypeId() )      return BNODE ;
         if ( type == URI.getTypeId() )        return URI ;
         if ( type == LITERAL.getTypeId() )    return LITERAL ;
+        if ( type == TRIPLETERM.getTypeId() ) return TRIPLETERM;
 //        if ( type == STRING.getTypeId() )     return STRING ;
 //        if ( type == XSDSTRING.getTypeId() )  return XSDSTRING ;
 //        if ( type == INTEGER.getTypeId() )    return INTEGER ;
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodeTableInline.java b/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodeTableInline.java
index bc84919..4eaa31d 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodeTableInline.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodeTableInline.java
@@ -21,7 +21,6 @@
 
 import org.apache.jena.graph.Node ;
 import org.apache.jena.tdb.store.NodeId ;
-import org.apache.jena.tdb.store.nodetable.NodeTable ;
 
 /** NodeTable wrapper to handle inline node ids.
  * If a node can be made inline, then the underlying table never sees it.
diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodecSSE.java b/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodecSSE.java
index 3a3284e..7752a52 100644
--- a/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodecSSE.java
+++ b/jena-tdb/src/main/java/org/apache/jena/tdb/store/nodetable/NodecSSE.java
@@ -18,88 +18,98 @@
 
 package org.apache.jena.tdb.store.nodetable;
 
-import java.nio.ByteBuffer ;
+import java.nio.ByteBuffer;
 
-import org.apache.jena.atlas.io.BlockUTF8 ;
-import org.apache.jena.atlas.lib.StrUtils ;
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.NodeFactory ;
-import org.apache.jena.riot.RiotException ;
-import org.apache.jena.riot.out.NodeFmtLib ;
-import org.apache.jena.riot.system.PrefixMap ;
-import org.apache.jena.riot.system.PrefixMapNull ;
-import org.apache.jena.riot.tokens.Token ;
-import org.apache.jena.riot.tokens.Tokenizer ;
-import org.apache.jena.riot.tokens.TokenizerFactory ;
-import org.apache.jena.riot.web.LangTag ;
-import org.apache.jena.shared.PrefixMapping ;
-import org.apache.jena.sparql.util.NodeUtils ;
-import org.apache.jena.tdb.TDBException ;
-import org.apache.jena.tdb.lib.StringAbbrev ;
+import org.apache.jena.atlas.io.BlockUTF8;
+import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.atlas.logging.FmtLog;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Node_Triple;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.riot.RiotException;
+import org.apache.jena.riot.out.NodeFmtLib;
+import org.apache.jena.riot.system.PrefixMap;
+import org.apache.jena.riot.system.PrefixMapNull;
+import org.apache.jena.riot.tokens.Token;
+import org.apache.jena.riot.tokens.Tokenizer;
+import org.apache.jena.riot.tokens.TokenizerFactory;
+import org.apache.jena.riot.web.LangTag;
+import org.apache.jena.shared.PrefixMapping;
+import org.apache.jena.sparql.sse.SSE;
+import org.apache.jena.sparql.util.NodeUtils;
+import org.apache.jena.tdb.TDB;
+import org.apache.jena.tdb.TDBException;
 
 /** Simple encoder/decoder for nodes that uses Turtle term string encoding. */
 
 public class NodecSSE implements Nodec
 {
     // Characters in IRIs that are illegal and cause SSE problems, but we wish to keep.
-    private final static char MarkerChar = '_' ;
-    private final static char[] invalidIRIChars = { MarkerChar , ' ' } ; 
+    private final static char MarkerChar = '_';
+    private final static char[] invalidIRIChars = { MarkerChar , ' ' }; 
     
     public NodecSSE() {}
     
     @Override
     public int maxSize(Node node)
     {
-        return maxLength(node) ;
+        return maxLength(node);
     }
 
-    private static final PrefixMap pmap0 = PrefixMapNull.empty ;
-    private static final boolean onlySafeBNodeLabels = false ;
+    private static final PrefixMap pmap0 = PrefixMapNull.empty;
+    private static final boolean onlySafeBNodeLabels = false;
     @Override
     public int encode(Node node, ByteBuffer bb, PrefixMapping pmap)
     {
-        String str = null ;
+        if ( ! node.isConcrete() )
+            FmtLog.warn(TDB.logInfo,"Attempt to encode non-concrete node: "+node);
+            
+
+        
+        String str = null;
 
         if ( node.isURI() ) 
         {
             // Pesky spaces etc
-            String x = StrUtils.encodeHex(node.getURI(), MarkerChar, invalidIRIChars) ;
+            String x = StrUtils.encodeHex(node.getURI(), MarkerChar, invalidIRIChars);
             if ( x != node.getURI() )
-                node = NodeFactory.createURI(x) ; 
+                node = NodeFactory.createURI(x); 
         }
         
         if ( node.isLiteral() && NodeUtils.isLangString(node) )
         {
             // Check syntactically valid.
-            String lang = node.getLiteralLanguage() ;
+            String lang = node.getLiteralLanguage();
             if ( ! LangTag.check(lang) )
-                throw new TDBException("bad language tag: "+node) ;
+                throw new TDBException("bad language tag: "+node);
         }
         
         if ( node.isBlank() && ! onlySafeBNodeLabels ) {
             // Special case.
-            str = "_:"+node.getBlankNodeLabel() ;
+            str = "_:"+node.getBlankNodeLabel();
         }
         
-        // Node->String
+        if ( node.isNodeTriple() ) {
+            str = NodeFmtLib.str(node);
+        }
+        
+        // Catch-all: Node->String
         if ( str == null )
-            str = NodeFmtLib.str(node, (String)null, pmap0) ;
-        // String -> bytes ;
-        BlockUTF8.fromChars(str, bb) ;
-        bb.flip() ;
-        return bb.limit() ;
+            str = NodeFmtLib.str(node);
+        // String -> bytes;
+        BlockUTF8.fromChars(str, bb);
+        bb.flip();
+        return bb.limit();
     }
-
+    
     @Override
-    public Node decode(ByteBuffer bb, PrefixMapping pmap)
-    {
+    public Node decode(ByteBuffer bb, PrefixMapping pmap) {
         // Ideally, this would be straight from the byte buffer.
         // But currently we go bytes -> string -> node 
 
         // Byte -> String
-        String str = BlockUTF8.toString(bb) ;
-        //OLD  
-        //String str = Bytes.fromByteBuffer(bb) ;
+        String str = BlockUTF8.toString(bb);
         // String -> Node
         
         // Easy cases.
@@ -108,32 +118,37 @@
             // Must be done this way.
             // In particular, bnode labels can contain ":" from Jena
             // TokenizerText does not recognize these.
-            str = str.substring(2) ;
-            return NodeFactory.createBlankNode(str) ;
+            str = str.substring(2);
+            return NodeFactory.createBlankNode(str);
         }
 
-        if ( str.startsWith("<") )
+        if ( str.startsWith("<<") ) {
+            // Complex - not a single token so use full machinery.
+            return SSE.parseNode(str);
+        }
+
+        if ( str.startsWith("<") ) 
         {
             // Do directly.
             // (is it quicker?)
-            str = str.substring(1,str.length()-1) ;
-            str = StrUtils.unescapeString(str) ;
-            str = StrUtils.decodeHex(str, MarkerChar) ;
-            return NodeFactory.createURI(str) ;
+            str = str.substring(1,str.length()-1);
+            str = StrUtils.unescapeString(str);
+            str = StrUtils.decodeHex(str, MarkerChar);
+            return NodeFactory.createURI(str);
         }
 
-        Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(str) ;
+        Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(str);
         if ( ! tokenizer.hasNext() )
-            throw new TDBException("Failed to tokenise: "+str) ;
-        Token t = tokenizer.next() ;
+            throw new TDBException("Failed to tokenize: "+str);
+        Token t = tokenizer.next();
 
         try {
-            Node n = t.asNode() ;
-            if ( n == null ) throw new TDBException("Not a node: "+str) ;
-            return n ;
+            Node n = t.asNode();
+            if ( n == null ) throw new TDBException("Not a node: "+str);
+            return n;
         } catch (RiotException ex)
         {
-            throw new TDBException("Bad string for node: "+str) ;
+            throw new TDBException("Bad string for node: "+str);
         }
     }
 
@@ -142,25 +157,31 @@
     {
         if ( node.isBlank() )
             // "_:"
-            return 2+maxLength(node.getBlankNodeLabel()) ;    
+            return 2+maxLength(node.getBlankNodeLabel());    
         if ( node.isURI() )
             // "<>"
-            return 2+maxLength(node.getURI()) ;
+            return 2+maxLength(node.getURI());
         if ( node.isLiteral() )
         {
-            int len = 2+maxLength(node.getLiteralLexicalForm()) ;
+            int len = 2+maxLength(node.getLiteralLexicalForm());
             if ( NodeUtils.isLangString(node) )
                 // Space for @ (language tag is ASCII)
-                len = len + 3 + node.getLiteralLanguage().length() ;
+                len = len + 3 + node.getLiteralLanguage().length();
             else if ( ! NodeUtils.isSimpleString(node) )
                 // The quotes and also space for ^^<>
-                len = len + 4 + maxLength(node.getLiteralDatatypeURI()) ;
-            return len ;
+                len = len + 4 + maxLength(node.getLiteralDatatypeURI());
+            return len;
         }
         if ( node.isVariable() )
             // "?"
-            return 1+maxLength(node.getName()) ;
-        throw new TDBException("Unrecognized node type: "+node) ;
+            return 1+maxLength(node.getName());
+        if ( node.isNodeTriple() ) {
+            Triple t = Node_Triple.triple(node);
+            // Leading an trailing <<>>, 4 spaces
+            return (2+4+2)+maxLength(t.getSubject())+maxLength(t.getPredicate())+maxLength(t.getObject()); 
+        }
+        
+        throw new TDBException("Unrecognized node type: "+node);
     }
 
     private static int maxLength(String string)
@@ -168,40 +189,40 @@
         // Very worse case for UTF-8 - and then some.
         // Encoding every character as _XX or bad UTF-8 conversion (3 bytes)
         // Max 3 bytes UTF-8 for up to 10FFFF (NB Java treats above 16bites as surrogate pairs only). 
-        return string.length()*3 ;
+        return string.length()*3;
     }
     
-    // URI compression can be effective but literals are more of a problem.  More variety. 
-    public final static boolean compression = false ; 
-    private static StringAbbrev abbreviations = new StringAbbrev() ;
-    static {
-        abbreviations.add(  "rdf",      "<http://www.w3.org/1999/02/22-rdf-syntax-ns#") ;
-        abbreviations.add(  "rdfs",     "<http://www.w3.org/2000/01/rdf-schema#") ;
-        abbreviations.add(  "xsd",      "<http://www.w3.org/2001/XMLSchema#") ;
-
-        // MusicBrainz
-        abbreviations.add(  "mal",      "<http://musicbrainz.org/mm-2.1/album/") ;
-        abbreviations.add(  "mt",       "<http://musicbrainz.org/mm-2.1/track/") ;
-        abbreviations.add(  "mar",      "<http://musicbrainz.org/mm-2.1/artist/") ;
-        abbreviations.add(  "mtr",      "<http://musicbrainz.org/mm-2.1/trmid/") ;
-        abbreviations.add(  "mc",       "<http://musicbrainz.org/mm-2.1/cdindex/") ;
-
-        abbreviations.add(  "m21",      "<http://musicbrainz.org/mm/mm-2.1#") ;
-        abbreviations.add(  "dc",       "<http://purl.org/dc/elements/1.1/") ;
-        // DBPedia
-        abbreviations.add(  "r",        "<http://dbpedia/resource/") ;
-        abbreviations.add(  "p",        "<http://dbpedia/property/") ;
-    }
-    private String compress(String str)
-    {
-        if ( !compression || abbreviations == null ) return str ;
-        return abbreviations.abbreviate(str) ;
-    }
-
-    private String decompress(String x)
-    {
-        if ( !compression || abbreviations == null ) return x ;
-        return abbreviations.expand(x) ;
-    }
-
+    // See also StringFile.
+//    // URI compression can be effective but literals are more of a problem.  More variety. 
+//    public final static boolean compression = false; 
+//    private static StringAbbrev abbreviations = new StringAbbrev();
+//    static {
+//        abbreviations.add(  "rdf",      "<http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+//        abbreviations.add(  "rdfs",     "<http://www.w3.org/2000/01/rdf-schema#");
+//        abbreviations.add(  "xsd",      "<http://www.w3.org/2001/XMLSchema#");
+//
+//        // MusicBrainz
+//        abbreviations.add(  "mal",      "<http://musicbrainz.org/mm-2.1/album/");
+//        abbreviations.add(  "mt",       "<http://musicbrainz.org/mm-2.1/track/");
+//        abbreviations.add(  "mar",      "<http://musicbrainz.org/mm-2.1/artist/");
+//        abbreviations.add(  "mtr",      "<http://musicbrainz.org/mm-2.1/trmid/");
+//        abbreviations.add(  "mc",       "<http://musicbrainz.org/mm-2.1/cdindex/");
+//
+//        abbreviations.add(  "m21",      "<http://musicbrainz.org/mm/mm-2.1#");
+//        abbreviations.add(  "dc",       "<http://purl.org/dc/elements/1.1/");
+//        // DBPedia
+//        abbreviations.add(  "r",        "<http://dbpedia/resource/");
+//        abbreviations.add(  "p",        "<http://dbpedia/property/");
+//    }
+//    private String compress(String str)
+//    {
+//        if ( !compression || abbreviations == null ) return str;
+//        return abbreviations.abbreviate(str);
+//    }
+//
+//    private String decompress(String x)
+//    {
+//        if ( !compression || abbreviations == null ) return x;
+//        return abbreviations.expand(x);
+//    }
 }
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/TC_TDB.java b/jena-tdb/src/test/java/org/apache/jena/tdb/TC_TDB.java
index 2fe1429..e8c8821 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/TC_TDB.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/TC_TDB.java
@@ -61,6 +61,7 @@
     , TS_TDBAssembler.class
     , TS_TransactionTDB.class
     , TS_ObjectFile.class
+    , TS_ScriptsTDB1.class
 } )
 
 public class TC_TDB
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/TS_ScriptsTDB1.java b/jena-tdb/src/test/java/org/apache/jena/tdb/TS_ScriptsTDB1.java
new file mode 100644
index 0000000..92beb39
--- /dev/null
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/TS_ScriptsTDB1.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.jena.tdb;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {
+    TestScriptsTDB1.class
+})
+
+public class TS_ScriptsTDB1 {}
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java b/jena-tdb/src/test/java/org/apache/jena/tdb/TestScriptsTDB1.java
similarity index 65%
rename from jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java
rename to jena-tdb/src/test/java/org/apache/jena/tdb/TestScriptsTDB1.java
index 22cc7e7..f678d84 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TestSuiteGraphTDB.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/TestScriptsTDB1.java
@@ -16,10 +16,9 @@
  * limitations under the License.
  */
 
-package org.apache.jena.tdb.store;
+package org.apache.jena.tdb;
 
 import junit.framework.TestSuite ;
-import org.apache.jena.tdb.ConfigTest ;
 import org.apache.jena.tdb.junit.TestFactoryTDB ;
 import org.junit.runner.RunWith ;
 import org.junit.runners.AllTests ;
@@ -27,14 +26,20 @@
 /** Scripted test generation */
 
 @RunWith(AllTests.class)
-public class TestSuiteGraphTDB extends TestSuite
+public class TestScriptsTDB1 extends TestSuite
 {
-    static public TestSuite suite() { return new TestSuiteGraphTDB() ; }
+    static final String ARQ_DIR = "../jena-arq/testing/ARQ";
+
+    static public TestSuite suite() { return new TestScriptsTDB1() ; }
     
-    private TestSuiteGraphTDB()
+    private TestScriptsTDB1()
     {
         super("TDB-Scripts") ;
-        String manifestMain = ConfigTest.getTestingDataRoot()+"/manifest.ttl" ;
-        TestFactoryTDB.make(this, manifestMain, "TDB-") ;
+//        String manifestMain1 = ConfigTest.getTestingDataRoot()+"/manifest.ttl" ;
+//        TestFactoryTDB.make(this, manifestMain1, "TDB-") ;
+        
+        // From ARQ
+        String manifestMain2 = ARQ_DIR + "/RDF-Star/SPARQL-Star/manifest.ttl";
+        TestFactoryTDB.make(this, manifestMain2, "TDB-");
     }
 }
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB.java b/jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB1.java
similarity index 75%
rename from jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB.java
rename to jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB1.java
index d9ecc22..f1ab67c 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/junit/QueryTestTDB1.java
@@ -21,7 +21,7 @@
 import java.util.List ;
 
 import org.apache.jena.query.* ;
-import org.apache.jena.rdf.model.Model ;
+import org.apache.jena.riot.RDFDataMgr;
 import org.apache.jena.sparql.SystemARQ ;
 import org.apache.jena.sparql.engine.QueryEngineFactory ;
 import org.apache.jena.sparql.engine.QueryExecutionBase ;
@@ -31,17 +31,17 @@
 import org.apache.jena.sparql.junit.TestItem ;
 import org.apache.jena.sparql.resultset.ResultSetCompare ;
 import org.apache.jena.sparql.resultset.SPARQLResult ;
+import org.apache.jena.system.Txn;
 import org.apache.jena.tdb.TDBFactory ;
-import org.apache.jena.util.FileManager ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
 
-public class QueryTestTDB extends EarlTestCase
+public class QueryTestTDB1 extends EarlTestCase
 {
     // Changed to using in-memory graphs/datasets because this is testing the query
     // processing.  Physical graph/datsets is in package "store". 
     
-    private static Logger log = LoggerFactory.getLogger(QueryTestTDB.class) ;
+    private static Logger log = LoggerFactory.getLogger(QueryTestTDB1.class) ;
     private Dataset dataset = null ;
 
     boolean skipThisTest = false ;
@@ -56,7 +56,7 @@
     private static List<String> currentNamedGraphs = null ;
 
     // Old style (Junit3)
-    public QueryTestTDB(String testName, EarlReport report, TestItem item)
+    public QueryTestTDB1(String testName, EarlReport report, TestItem item)
     {
         this(testName, report, item.getURI(), 
              item.getDefaultGraphURIs(), item.getNamedGraphURIs(), 
@@ -64,7 +64,7 @@
              ) ;
     }
     
-    public QueryTestTDB(String testName, EarlReport report, 
+    public QueryTestTDB1(String testName, EarlReport report, 
                         String uri,
                         List<String> dftGraphs,
                         List<String> namedGraphs,
@@ -111,11 +111,12 @@
 
         //graphLocation.clear() ;
         
+        // Allow "qt:data" to be quads in defaultGraphURIs.
         for ( String fn : defaultGraphURIs )
-            load(dataset.getDefaultModel(), fn) ;
+            RDFDataMgr.read(dataset, fn);
         
         for ( String fn : namedGraphURIs )
-            load(dataset.getNamedModel(fn), fn) ;
+            RDFDataMgr.read(dataset.getNamedModel(fn), fn) ;
     }
     
     
@@ -129,12 +130,16 @@
         }
         
         Query query = QueryFactory.read(queryFile) ;
-        Dataset ds = DatasetFactory.create(defaultGraphURIs, namedGraphURIs) ;
+        Dataset ds = DatasetFactory.create();
+        for ( String fn : defaultGraphURIs )
+            RDFDataMgr.read(ds, fn);    // Allow quads
+        for ( String fn : namedGraphURIs )
+            RDFDataMgr.read(ds.getNamedModel(fn), fn) ;
         
         // ---- First, get the expected results by executing in-memory or from a results file.
         
-        ResultSetRewindable rs1 = null ;
-        String expectedLabel = "" ;
+        ResultSetRewindable rs1;
+        String expectedLabel;
         if ( results != null )
         {
             rs1 = ResultSetFactory.makeRewindable(results.getResultSet()) ;
@@ -151,32 +156,29 @@
         
         // ---- Second, execute in persistent graph
 
-        Dataset ds2 = dataset ; //DatasetFactory.create(model) ;
-        QueryExecution qExec2 = QueryExecutionFactory.create(query, ds2) ;
-        ResultSet rs = qExec2.execSelect() ;
-        ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(rs) ;
+        Dataset ds2 = dataset ;
+        Txn.executeRead(ds2, ()->{
+            QueryExecution qExec2 = QueryExecutionFactory.create(query, ds2) ;
+            ResultSet rs = qExec2.execSelect() ;
+            ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(rs) ;
+
+            // See if the same.
+            boolean b = ResultSetCompare.equalsByValue(rs1, rs2) ;
+            if ( !b )
+            {
+                rs1.reset() ;
+                rs2.reset() ;
+                System.out.println("------------------- "+this.getName());
+                System.out.printf("**** Expected (%s)", expectedLabel) ;
+                ResultSetFormatter.out(System.out, rs1) ; 
+                System.out.println("**** Got (TDB)") ;
+                ResultSetFormatter.out(System.out, rs2) ;
+            }
+            assertTrue("Results sets not the same", b) ; 
+        });
         
-        // See if the same.
-        boolean b = ResultSetCompare.equalsByValue(rs1, rs2) ;
-        if ( !b )
-        {
-            rs1.reset() ;
-            rs2.reset() ;
-            System.out.println("------------------- "+this.getName());
-            System.out.printf("**** Expected (%s)", expectedLabel) ;
-            ResultSetFormatter.out(System.out, rs1) ; 
-            System.out.println("**** Got (TDB)") ;
-            ResultSetFormatter.out(System.out, rs2) ;
-        }
-        
-        assertTrue("Results sets not the same", b) ; 
     }
 
-    private static void load(Model model, String fn)
-    {
-        FileManager.get().readModel(model, fn) ;
-    }
-    
     private static boolean compareLists(List<String> list1, List<String> list2)
     {
         if ( list1 == null )
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/junit/TestFactoryTDB.java b/jena-tdb/src/test/java/org/apache/jena/tdb/junit/TestFactoryTDB.java
index 792d429..a8baa0a 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/junit/TestFactoryTDB.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/junit/TestFactoryTDB.java
@@ -18,71 +18,82 @@
 
 package org.apache.jena.tdb.junit;
 
-import junit.framework.Test ;
-import junit.framework.TestCase ;
-import junit.framework.TestSuite ;
-import org.apache.jena.rdf.model.Resource ;
-import org.apache.jena.sparql.junit.EarlReport ;
-import org.apache.jena.sparql.junit.SurpressedTest ;
-import org.apache.jena.sparql.junit.TestItem ;
-import org.apache.jena.sparql.vocabulary.TestManifestX ;
-import org.apache.jena.util.junit.TestFactoryManifest ;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.sparql.junit.EarlReport;
+import org.apache.jena.sparql.junit.SurpressedTest;
+import org.apache.jena.sparql.junit.TestItem;
+import org.apache.jena.sparql.vocabulary.TestManifestX;
+import org.apache.jena.util.junit.TestFactoryManifest;
 
 public class TestFactoryTDB extends TestFactoryManifest
 {
-    public static EarlReport report = null ;
+    public static EarlReport report = null;
     
-    public static void make(TestSuite ts, String manifestFile, String testRootName)
-    {
+    public static void make(TestSuite ts, String manifestFile, String testRootName) {
         // for each graph type do
-        TestSuite ts2 = makeSuite(manifestFile, testRootName) ;
-        ts.addTest(ts2) ;
+        TestSuite ts2 = makeSuite(manifestFile, testRootName);
+        ts.addTest(ts2);
     }
-    
-    public static TestSuite makeSuite(String manifestFile, String testRootName)
-    {
-        TestFactoryTDB f = new TestFactoryTDB(testRootName) ;
-        TestSuite ts = f.process(manifestFile) ;
-        if ( testRootName != null )
-            ts.setName(testRootName+ts.getName()) ;
-        return ts ;
-    }
-    
-    // Factory
-    
-    public String testRootName ;
 
-    public TestFactoryTDB(String testRootName)
-    {
-        this.testRootName = testRootName ;
+    public static TestSuite makeSuite(String manifestFile, String testRootName) {
+        TestFactoryTDB f = new TestFactoryTDB(testRootName);
+        TestSuite ts = f.process(manifestFile);
+        if ( testRootName != null )
+            ts.setName(testRootName + ts.getName());
+        return ts;
+    }
+
+    // Factory
+
+    public String testRootName;
+
+    public TestFactoryTDB(String testRootName) {
+        this.testRootName = testRootName;
     }
     
     @Override
     protected Test makeTest(Resource manifest, Resource entry, String testName, Resource action, Resource result)
     {
         if ( testRootName != null )
-            testName = testRootName+testName ;
+            testName = testRootName+testName;
         
-        TestItem testItem = TestItem.create(entry, null) ;
+        TestItem testItem = TestItem.create(entry, null);
         
-        TestCase test = null ;
+        TestCase test = null;
         
         if ( testItem.getTestType() != null )
         {
             if ( testItem.getTestType().equals(TestManifestX.TestQuery) )
-                test = new QueryTestTDB(testName, report, testItem) ;
+                test = new QueryTestTDB1(testName, report, testItem);
             
             if ( testItem.getTestType().equals(TestManifestX.TestSurpressed) )
-                test = new SurpressedTest(testName, report, testItem) ;
+                test = new SurpressedTest(testName, report, testItem);
+            
+            // Ignore syntax tests
+            if ( testItem.getTestType().equals(TestManifestX.PositiveSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.NegativeSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.PositiveUpdateSyntaxTestARQ) )
+                // Ignore
+                return null;
+            if ( testItem.getTestType().equals(TestManifestX.NegativeUpdateSyntaxTestARQ) )
+                // Ignore
+                return null;
             
             if ( test == null )
-                System.err.println("Unrecognized test type: "+testItem.getTestType()) ;
+                System.err.println("Unrecognized test type: "+testItem.getTestType());
         }
         // Default 
         if ( test == null )
-            test = new QueryTestTDB(testName, report, testItem) ;
+            test = new QueryTestTDB1(testName, report, testItem);
 
-        return test ;
+        return test;
     }
 
 }
diff --git a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TS_Store.java b/jena-tdb/src/test/java/org/apache/jena/tdb/store/TS_Store.java
index f85c73b..5d8f355 100644
--- a/jena-tdb/src/test/java/org/apache/jena/tdb/store/TS_Store.java
+++ b/jena-tdb/src/test/java/org/apache/jena/tdb/store/TS_Store.java
@@ -37,8 +37,6 @@
     , TestDatasetGraphTDBFind.class
     , TestDatasetGraphTDBFindPattern.class
     , TestLoader.class
-    // The script suite
-    , TestSuiteGraphTDB.class
     , Test_SPARQL_TDB.class
     , TestConcurrentAccess.class
     , TestDynamicDatasetTDB.class
diff --git a/jena-tdb/testing/manifest.ttl b/jena-tdb/testing/manifest.ttl
index aeaf80e..3a0d0e9 100644
--- a/jena-tdb/testing/manifest.ttl
+++ b/jena-tdb/testing/manifest.ttl
@@ -27,5 +27,3 @@
         <Values/manifest.ttl>
         <UnionGraph/manifest.ttl>
     ) .
-
-