Merge pull request #998 from afs/jena2102-cmd-init

JENA-2102: Explicitly initialize map for injected commands
diff --git a/jena-arq/Grammar/arq.jj b/jena-arq/Grammar/arq.jj
index f3fa3fd..b61188b 100644
--- a/jena-arq/Grammar/arq.jj
+++ b/jena-arq/Grammar/arq.jj
@@ -1361,9 +1361,28 @@
   | n = NumericLiteral() { return asExpr(n) ; }
   | n = BooleanLiteral() { return asExpr(n) ; }
   | n = Var() { return asExpr(n) ; }
-  | n = TripleTerm() { return asExpr(n) ; }
+  | n = ExprTripleTerm() { return asExpr(n) ; }
   )
 }
+Node ExprVarOrTerm() : { Node n; String s;}
+{
+  ( s = iri() { n = createNode(s); }
+  | n = RDFLiteral()
+  | n = NumericLiteral()
+  | n = BooleanLiteral()
+  | n = Var()
+  )
+  { return n; }
+}
+Node ExprTripleTerm() : { Token t ; Node s,p,o,n; }
+{ t = <LT2>
+  s = ExprVarOrTerm()
+  p = Verb()
+  o = ExprVarOrTerm()
+  { n = createTripleTerm(s, p, o, t.beginLine, t.beginColumn); }
+  <GT2>
+  { return n; }
+}
 Expr BrackettedExpression() : { Expr expr ; }
 {
     <LPAREN> expr = Expression() <RPAREN> { return expr ; }
diff --git a/jena-arq/Grammar/main.jj b/jena-arq/Grammar/main.jj
index ab39cd9..5281fb5 100644
--- a/jena-arq/Grammar/main.jj
+++ b/jena-arq/Grammar/main.jj
@@ -1855,6 +1855,7 @@
   | expr = PrimaryExpression() { return expr ; }
 }
 
+#ifndef ARQ
 Expr PrimaryExpression() : { Expr expr ; Node n ; }
 {
   ( expr = BrackettedExpression() { return expr ; }
@@ -1866,19 +1867,53 @@
   | n = NumericLiteral()  { return asExpr(n) ; }
   | n = BooleanLiteral()  { return asExpr(n) ; }
   | n = Var()             { return asExpr(n) ; }
-#ifdef ARQ
-// Not necessary. In expressions, use "TRIPLE(?s,?p,?o)"
-  | n = TripleTerm()      { return asExpr(n) ; }
+  )
+}
 #endif
 #ifdef ARQ
+Expr PrimaryExpression() : { Expr expr ; Node n ; }
+{
+  ( expr = BrackettedExpression() { return expr ; }
+  | expr = BuiltInCall()   { return expr ; }  
+  | expr = iriOrFunction() { return expr ; }
+// NOT  | n = VarOrTerm()    { return asExpr(n) ; }
+// Because of iriOrFunction
+// Can't use iri() here
+  | n = RDFLiteral()      { return asExpr(n) ; }
+  | n = NumericLiteral()  { return asExpr(n) ; }
+  | n = BooleanLiteral()  { return asExpr(n) ; }
+  | n = Var()             { return asExpr(n) ; }
+  | n = ExprTripleTerm()  { return asExpr(n) ; }
 // and not SPARQL 11
 // needs checking.
 // Use this for ?var(args)
 //  |  expr = VarOrFunction()  { return expr ; }
-#endif
   )
 }
 
+Node ExprVarOrTerm() : { Node n; String s;}
+{
+  ( s = iri() { n = createNode(s); }
+  | n = RDFLiteral()
+  | n = NumericLiteral()
+  | n = BooleanLiteral()
+  | n = Var()
+  )
+  { return n; }
+}
+
+// Embedded triple in expressions
+Node ExprTripleTerm() : { Token t ; Node s,p,o,n; }
+{ t = <LT2>
+  s = ExprVarOrTerm()
+  p = Verb()
+  o = ExprVarOrTerm()
+  { n = createTripleTerm(s, p, o, t.beginLine, t.beginColumn); }
+  <GT2>
+  { return n; }
+}
+#endif
+
 Expr BrackettedExpression() : { Expr expr ; }
 {
     <LPAREN> expr = Expression() <RPAREN>  { return expr ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/rdfs/assembler/VocabRDFS.java b/jena-arq/src/main/java/org/apache/jena/rdfs/assembler/VocabRDFS.java
index 2745a9b..5ba42bd 100644
--- a/jena-arq/src/main/java/org/apache/jena/rdfs/assembler/VocabRDFS.java
+++ b/jena-arq/src/main/java/org/apache/jena/rdfs/assembler/VocabRDFS.java
@@ -20,12 +20,9 @@
 
 import org.apache.jena.assembler.Assembler;
 import org.apache.jena.assembler.JA;
-import org.apache.jena.irix.IRIException;
-import org.apache.jena.irix.IRIx;
 import org.apache.jena.rdf.model.Property;
 import org.apache.jena.rdf.model.Resource;
 import org.apache.jena.rdf.model.ResourceFactory;
-import org.apache.jena.shared.JenaException;
 import org.apache.jena.sparql.core.assembler.AssemblerUtils;
 import org.apache.jena.sparql.core.assembler.DatasetAssemblerVocab;
 import org.apache.jena.sys.JenaSystem;
@@ -64,13 +61,6 @@
 
     private static String iri(String localname) {
         String uri = NS + localname;
-        try {
-            IRIx iri = IRIx.create(uri);
-            if ( ! iri.isReference() )
-                throw new JenaException("Bad IRI (relative): "+uri);
-            return uri;
-        } catch (IRIException ex) {
-            throw new JenaException("Bad IRI: "+uri);
-        }
+        return uri;
     }
 }
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
index 4e75027..eaa926b 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
@@ -36,6 +36,7 @@
 import org.apache.jena.atlas.web.ContentType;
 import org.apache.jena.atlas.web.TypedInputStream;
 import org.apache.jena.graph.Graph;
+import org.apache.jena.irix.IRIs;
 import org.apache.jena.irix.IRIxResolver;
 import org.apache.jena.query.Dataset;
 import org.apache.jena.rdf.model.Model;
@@ -446,12 +447,17 @@
         } else {
             if ( ! strict )
                 checking$ = checking.orElseGet(()->true);
+            // Languages, like Turtle, where the base defaults to the system base.
+            // Setting the resolver directly overrides this.
+            if ( baseStr == null && resolve )
+                baseStr = IRIs.getBaseStr();
         }
         if ( sameLang(RDFJSON, lang) )
             // The JSON-LD subsystem handles this.
             resolve = false;
 
-        IRIxResolver parserResolver = (resolver != null) ? resolver
+        IRIxResolver parserResolver = (resolver != null)
+                ? resolver
                 : IRIxResolver.create().base(baseStr).resolve(resolve).allowRelative(allowRelative).build();
         PrefixMap prefixMap = PrefixMapFactory.create();
         ParserProfileStd parserFactory = new ParserProfileStd(factory, errorHandler,
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/lang/CollectorStreamRDF.java b/jena-arq/src/main/java/org/apache/jena/riot/lang/CollectorStreamRDF.java
index 2964be6..f25e66b 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/lang/CollectorStreamRDF.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/lang/CollectorStreamRDF.java
@@ -28,7 +28,7 @@
 import org.apache.jena.sparql.core.Quad ;
 
 /**
- * StreamRDF implementations which store received triples and quads
+ * StreamRDF implementations which stores received triples and quads
  * in a {@link java.util.Collection}.
  *
  * The resulting collection can be retrieved via the
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/Checker.java b/jena-arq/src/main/java/org/apache/jena/riot/system/Checker.java
index a7cb727..9fe0512 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/Checker.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/Checker.java
@@ -29,8 +29,10 @@
 import org.apache.jena.iri.IRI;
 import org.apache.jena.iri.IRIComponents;
 import org.apache.jena.iri.Violation;
+import org.apache.jena.irix.IRIProviderJenaIRI;
 import org.apache.jena.irix.IRIs;
 import org.apache.jena.irix.SetupJenaIRI;
+import org.apache.jena.irix.SystemIRIx;
 import org.apache.jena.sparql.core.Quad;
 import org.apache.jena.sparql.graph.NodeConst;
 import org.apache.jena.util.SplitIRI;
@@ -121,8 +123,10 @@
     public static boolean iriViolations(IRI iri, ErrorHandler errorHandler,
                                         boolean allowRelativeIRIs, boolean includeIRIwarnings,
                                         long line, long col) {
+
         if ( !allowRelativeIRIs && iri.isRelative() )
-            errorHandler(errorHandler).error("Relative IRI: " + iri, line, col);
+            // Relative IRIs.
+            iriViolationMessage(iri.toString(), true, "Relative IRI: " + iri, line, col, errorHandler);
 
         boolean isOK = true;
 
@@ -134,26 +138,47 @@
                 int code = v.getViolationCode();
                 boolean isError = v.isError();
 
-                // Anything we want to reprioritise?
+                // --- Tune warnings.
+                // IRIProviderJena filters ERRORs and throws an exception on error.
+                // It can't add warnings or remove them at that point.
+                // Do WARN filtering here.
                 if ( code == Violation.LOWERCASE_PREFERRED && v.getComponent() != IRIComponents.SCHEME ) {
-                    // Issue warning about the scheme part. Not e.g. DNS names.
+                    // Issue warning about the scheme part only. Not e.g. DNS names.
                     continue;
                 }
+
+                // Convert selected violations from ERROR to WARN for output/
+                // There are cases where jena-iri always makes a violation an ERROR regardless of SetupJenaIRI
+                // PROHIBITED_COMPONENT_PRESENT
+//                if ( code == Violation.PROHIBITED_COMPONENT_PRESENT )
+//                    isError = false;
+
+                isOK = false;
                 String msg = v.getShortMessage();
                 String iriStr = iri.toString();
-
-                errorHandler(errorHandler).warning("Bad IRI: " + msg, line, col);
-
-//                if ( isError )
-//                    errorHandler(errorHandler).warning("Bad IRI: " + msg, line, col);
-//                else
-//                    errorHandler(errorHandler).warning("Not advised IRI: " + msg, line, col);
-                isOK = true;
+                iriViolationMessage(iriStr, isError, msg, line, col, errorHandler);
             }
         }
         return isOK;
     }
 
+    /**
+     * Common handling messages about IRIs during parsing whether a violation or an
+     * IRIException. Prints a warning, with different messages for IRI error or warning.
+     */
+    public static void iriViolationMessage(String iriStr, boolean isError, String msg, long line, long col, ErrorHandler errorHandler) {
+        try {
+            if ( ! ( SystemIRIx.getProvider() instanceof IRIProviderJenaIRI ) )
+                msg = "<" + iriStr + "> : " + msg;
+
+            if ( isError ) {
+                // ?? Treat as error, catch exceptions?
+                errorHandler(errorHandler).warning("Bad IRI: " + msg, line, col);
+            } else
+                errorHandler(errorHandler).warning("Not advised IRI: " + msg, line, col);
+        } catch (org.apache.jena.iri.IRIException | org.apache.jena.irix.IRIException ex) {}
+    }
+
     // ==== Literals
 
     final static private Pattern langPattern = Pattern.compile("[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*");
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/ErrorHandlerFactory.java b/jena-arq/src/main/java/org/apache/jena/riot/system/ErrorHandlerFactory.java
index 197acc8..28eafbe 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/ErrorHandlerFactory.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/ErrorHandlerFactory.java
@@ -66,7 +66,8 @@
     public static ErrorHandler errorHandlerSimple()                 { return new ErrorHandlerSimple() ; }
 
     /** Logs warnings and errors while tracking the counts of each and optionally throwing exceptions when errors and/or warnings are encounted */
-    public static ErrorHandlerTracking errorHandlerTracking(Logger log, boolean failOnError, boolean failOnWarning) { return new ErrorHandlerTracking(log, failOnError, failOnWarning); }
+    public static ErrorHandlerTracking errorHandlerTracking(Logger log, boolean failOnError, boolean failOnWarning)
+    { return new ErrorHandlerTracking(log, failOnError, failOnWarning); }
 
     /**
      * An error handler that throws a {@link RiotParseException}, hence it
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
index 165ea1f..a3f3d3a 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
@@ -34,26 +34,24 @@
 import org.apache.jena.sparql.util.FmtUtils;
 
 /**
- * {@link ParserProfileStd} uses a {@link FactoryRDF} to
- * create items in the parsing process.
+ * {@link ParserProfileStd} uses a {@link FactoryRDF} to create items in the parsing
+ * process.
  */
-public class ParserProfileStd implements ParserProfile
-{
-    private final FactoryRDF   factory;
+public class ParserProfileStd implements ParserProfile {
+    private final FactoryRDF factory;
     private final ErrorHandler errorHandler;
-    private final Context      context;
-    private       IRIxResolver resolver;
-    private final PrefixMap    prefixMap;
-    private final boolean      strictMode;
-    private final boolean      checking;
+    private final Context context;
+    private IRIxResolver resolver;
+    private final PrefixMap prefixMap;
+    private final boolean strictMode;
+    private final boolean checking;
     private static int DftCacheSize = 500;
     private final Cache<String, IRI> iriCache;
 
     private boolean allowNodeExtentions;
 
-    public ParserProfileStd(FactoryRDF factory, ErrorHandler errorHandler,
-                            IRIxResolver resolver, PrefixMap prefixMap,
-                            Context context, boolean checking, boolean strictMode) {
+    public ParserProfileStd(FactoryRDF factory, ErrorHandler errorHandler, IRIxResolver resolver, PrefixMap prefixMap, Context context,
+                            boolean checking, boolean strictMode) {
         this.factory = factory;
         this.errorHandler = errorHandler;
         this.resolver = resolver;
@@ -62,7 +60,7 @@
         this.checking = checking;
         this.iriCache = checking ? CacheFactory.createCache(DftCacheSize) : null;
         this.strictMode = strictMode;
-        this.allowNodeExtentions = true; //(context.isTrue(RIOT.ALLOW_NODE_EXT)) ;
+        this.allowNodeExtentions = true; // (context.isTrue(RIOT.ALLOW_NODE_EXT)) ;
     }
 
     @Override
@@ -98,21 +96,20 @@
             return IRIx.createAny(uriStr);
         }
 
+        // Relative IRIs.
+        // jena-iri : these are errors on the
         try {
             IRIx iri = resolver.resolve(uriStr);
             if ( checking )
                 doChecking(iri, iri.str(), line, col);
             return iri;
+        } catch (RelativeIRIException ex ) {
+            errorHandler.error("Relative IRI: " + uriStr, line, col);
+            return IRIx.createAny(uriStr);
         } catch (IRIException ex) {
-            // This should only be errors and the errorHandler may be set to "don't continue".
-            // if it does continue, assume it prints something.
-            if ( SystemIRIx.getProvider() instanceof IRIProviderJenaIRI )
-                // Checking using JenaIRI puts the URI string in the message.
-                // Puts the IRI in the message.
-                errorHandler.error("Bad IRI: "+ex.getMessage(), line, col);
-            else
-                // Does not put the IRI in the message.
-                errorHandler.error("Bad IRI: <" + uriStr + "> : "+ex.getMessage(), line, col);
+            // Same code as Checker.iriViolations
+            String msg = ex.getMessage();
+            Checker.iriViolationMessage(uriStr, true, msg, line, col, errorHandler);
             return IRIx.createAny(uriStr);
         }
     }
@@ -122,11 +119,14 @@
         if ( irix instanceof IRIProviderJenaIRI.IRIxJena )
             iri = (IRI)irix.getImpl();
         else
-            iri = iriCache.getOrFill(uriStr, ()->SetupJenaIRI.iriCheckerFactory().create(uriStr));
+            iri = iriCache.getOrFill(uriStr, () -> SetupJenaIRI.iriCheckerFactory().create(uriStr));
         Checker.iriViolations(iri, errorHandler, false, true, line, col);
     }
 
-    /** Create a triple - this operation call {@link #checkTriple} if checking is enabled. */
+    /**
+     * Create a triple - this operation call {@link #checkTriple} if checking is
+     * enabled.
+     */
     @Override
     public Triple createTriple(Node subject, Node predicate, Node object, long line, long col) {
         if ( checking )
@@ -140,7 +140,7 @@
 
     protected void checkTriple(Node subject, Node predicate, Node object, long line, long col) {
         if ( subject == null || (!subject.isURI() && !subject.isBlank()) ) {
-            if ( ! allowSpecialNode(subject) ) {
+            if ( !allowSpecialNode(subject) ) {
                 errorHandler.error("Subject is not a URI or blank node", line, col);
                 throw new RiotException("Bad subject: " + subject);
             }
@@ -150,14 +150,17 @@
             throw new RiotException("Bad predicate: " + predicate);
         }
         if ( object == null || (!object.isURI() && !object.isBlank() && !object.isLiteral()) ) {
-            if ( ! allowSpecialNode(object) ) {
+            if ( !allowSpecialNode(object) ) {
                 errorHandler.error("Object is not a URI, blank node or literal", line, col);
                 throw new RiotException("Bad object: " + object);
             }
         }
     }
 
-    /** Create a quad - this operation call {@link #checkTriple} if checking is enabled. */
+    /**
+     * Create a quad - this operation call {@link #checkTriple} if checking is
+     * enabled.
+     */
     @Override
     public Quad createQuad(Node graph, Node subject, Node predicate, Node object, long line, long col) {
         if ( checking )
@@ -177,8 +180,8 @@
     @Override
     public Node createURI(String x, long line, long col) {
         // Special cases that don't resolve.
-        //   <_:....> is a blank node.
-        //   <::...> is "don't touch" used for a fixed-up prefix name
+        // <_:....> is a blank node.
+        // <::...> is "don't touch" used for a fixed-up prefix name
         if ( !RiotLib.isBNodeIRI(x) && !RiotLib.isPrefixIRI(x) )
             // Really is an URI!
             x = resolveIRI(x, line, col);
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 36c3fa3..c3d6eb6 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
@@ -4968,7 +4968,7 @@
       break;
       }
     case LT2:{
-      n = TripleTerm();
+      n = ExprTripleTerm();
 {if ("" != null) return asExpr(n) ;}
       break;
       }
@@ -4980,6 +4980,64 @@
     throw new Error("Missing return statement in function");
   }
 
+  final public Node ExprVarOrTerm() throws ParseException {Node n; String s;
+    switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+    case IRIref:
+    case PNAME_NS:
+    case PNAME_LN:{
+      s = iri();
+n = createNode(s);
+      break;
+      }
+    case STRING_LITERAL1:
+    case STRING_LITERAL2:
+    case STRING_LITERAL_LONG1:
+    case STRING_LITERAL_LONG2:{
+      n = RDFLiteral();
+      break;
+      }
+    case INTEGER:
+    case DECIMAL:
+    case DOUBLE:
+    case INTEGER_POSITIVE:
+    case DECIMAL_POSITIVE:
+    case DOUBLE_POSITIVE:
+    case INTEGER_NEGATIVE:
+    case DECIMAL_NEGATIVE:
+    case DOUBLE_NEGATIVE:{
+      n = NumericLiteral();
+      break;
+      }
+    case TRUE:
+    case FALSE:{
+      n = BooleanLiteral();
+      break;
+      }
+    case VAR1:
+    case VAR2:{
+      n = Var();
+      break;
+      }
+    default:
+      jj_la1[153] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+{if ("" != null) return n;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Node ExprTripleTerm() throws ParseException {Token t ; Node s,p,o,n;
+    t = jj_consume_token(LT2);
+    s = ExprVarOrTerm();
+    p = Verb();
+    o = ExprVarOrTerm();
+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 Expr BrackettedExpression() throws ParseException {Expr expr ;
     jj_consume_token(LPAREN);
     expr = Expression();
@@ -5086,7 +5144,7 @@
         break;
         }
       default:
-        jj_la1[153] = jj_gen;
+        jj_la1[154] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -5376,7 +5434,7 @@
           break;
           }
         default:
-          jj_la1[154] = jj_gen;
+          jj_la1[155] = jj_gen;
           break label_42;
         }
         jj_consume_token(COMMA);
@@ -5529,7 +5587,7 @@
       break;
       }
     default:
-      jj_la1[155] = jj_gen;
+      jj_la1[156] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -5549,7 +5607,7 @@
       break;
       }
     default:
-      jj_la1[156] = jj_gen;
+      jj_la1[157] = jj_gen;
       ;
     }
     jj_consume_token(RPAREN);
@@ -5570,7 +5628,7 @@
       break;
       }
     default:
-      jj_la1[157] = jj_gen;
+      jj_la1[158] = jj_gen;
       ;
     }
     jj_consume_token(RPAREN);
@@ -5593,7 +5651,7 @@
       break;
       }
     default:
-      jj_la1[158] = jj_gen;
+      jj_la1[159] = jj_gen;
       ;
     }
     jj_consume_token(RPAREN);
@@ -5633,7 +5691,7 @@
         break;
         }
       default:
-        jj_la1[159] = jj_gen;
+        jj_la1[160] = jj_gen;
         ;
       }
       switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -5747,7 +5805,7 @@
         break;
         }
       default:
-        jj_la1[160] = jj_gen;
+        jj_la1[161] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -5766,7 +5824,7 @@
         break;
         }
       default:
-        jj_la1[161] = jj_gen;
+        jj_la1[162] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5784,7 +5842,7 @@
         break;
         }
       default:
-        jj_la1[162] = jj_gen;
+        jj_la1[163] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5802,7 +5860,7 @@
         break;
         }
       default:
-        jj_la1[163] = jj_gen;
+        jj_la1[164] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5820,7 +5878,7 @@
         break;
         }
       default:
-        jj_la1[164] = jj_gen;
+        jj_la1[165] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5838,7 +5896,7 @@
         break;
         }
       default:
-        jj_la1[165] = jj_gen;
+        jj_la1[166] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5856,7 +5914,7 @@
         break;
         }
       default:
-        jj_la1[166] = jj_gen;
+        jj_la1[167] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5874,7 +5932,7 @@
         break;
         }
       default:
-        jj_la1[167] = jj_gen;
+        jj_la1[168] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5892,7 +5950,7 @@
         break;
         }
       default:
-        jj_la1[168] = jj_gen;
+        jj_la1[169] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5913,7 +5971,7 @@
             break;
             }
           default:
-            jj_la1[169] = jj_gen;
+            jj_la1[170] = jj_gen;
             ;
           }
         } else {
@@ -5927,7 +5985,7 @@
             break;
             }
           default:
-            jj_la1[170] = jj_gen;
+            jj_la1[171] = jj_gen;
             jj_consume_token(-1);
             throw new ParseException();
           }
@@ -5935,7 +5993,7 @@
         break;
         }
       default:
-        jj_la1[171] = jj_gen;
+        jj_la1[172] = jj_gen;
         ;
       }
       jj_consume_token(RPAREN);
@@ -5952,7 +6010,7 @@
         break;
         }
       default:
-        jj_la1[172] = jj_gen;
+        jj_la1[173] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5970,7 +6028,7 @@
         break;
         }
       default:
-        jj_la1[173] = jj_gen;
+        jj_la1[174] = jj_gen;
         ;
       }
       expr = Expression();
@@ -5988,7 +6046,7 @@
         break;
         }
       default:
-        jj_la1[174] = jj_gen;
+        jj_la1[175] = jj_gen;
         ;
       }
       expr = Expression();
@@ -6006,7 +6064,7 @@
         break;
         }
       default:
-        jj_la1[175] = jj_gen;
+        jj_la1[176] = jj_gen;
         ;
       }
       expr = Expression();
@@ -6024,7 +6082,7 @@
         break;
         }
       default:
-        jj_la1[176] = jj_gen;
+        jj_la1[177] = jj_gen;
         ;
       }
       expr = Expression();
@@ -6042,7 +6100,7 @@
         break;
         }
       default:
-        jj_la1[177] = jj_gen;
+        jj_la1[178] = jj_gen;
         ;
       }
       expr = Expression();
@@ -6060,7 +6118,7 @@
       break;
       }
     default:
-      jj_la1[178] = jj_gen;
+      jj_la1[179] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6083,7 +6141,7 @@
       break;
       }
     default:
-      jj_la1[179] = jj_gen;
+      jj_la1[180] = jj_gen;
       ;
     }
 if ( a == null )
@@ -6117,14 +6175,14 @@
         break;
         }
       default:
-        jj_la1[180] = jj_gen;
+        jj_la1[181] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
       break;
       }
     default:
-      jj_la1[181] = jj_gen;
+      jj_la1[182] = jj_gen;
       ;
     }
 {if ("" != null) return createLiteral(lex, lang, uri) ;}
@@ -6152,7 +6210,7 @@
       break;
       }
     default:
-      jj_la1[182] = jj_gen;
+      jj_la1[183] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6178,7 +6236,7 @@
       break;
       }
     default:
-      jj_la1[183] = jj_gen;
+      jj_la1[184] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6203,7 +6261,7 @@
       break;
       }
     default:
-      jj_la1[184] = jj_gen;
+      jj_la1[185] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6228,7 +6286,7 @@
       break;
       }
     default:
-      jj_la1[185] = jj_gen;
+      jj_la1[186] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6248,7 +6306,7 @@
       break;
       }
     default:
-      jj_la1[186] = jj_gen;
+      jj_la1[187] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6278,7 +6336,7 @@
       break;
       }
     default:
-      jj_la1[187] = jj_gen;
+      jj_la1[188] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6302,7 +6360,7 @@
       break;
       }
     default:
-      jj_la1[188] = jj_gen;
+      jj_la1[189] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6322,7 +6380,7 @@
       break;
       }
     default:
-      jj_la1[189] = jj_gen;
+      jj_la1[190] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6342,7 +6400,7 @@
       break;
       }
     default:
-      jj_la1[190] = jj_gen;
+      jj_la1[191] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -6395,20 +6453,6 @@
     finally { jj_save(4, xla); }
   }
 
-  private boolean jj_3R_119()
- {
-    if (jj_scan_token(NOT)) return true;
-    if (jj_scan_token(EXISTS)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_118()
- {
-    if (jj_scan_token(EXISTS)) return true;
-    if (jj_3R_141()) return true;
-    return false;
-  }
-
   private boolean jj_3R_116()
  {
     if (jj_scan_token(REPLACE)) return true;
@@ -6416,6 +6460,27 @@
     return false;
   }
 
+  private boolean jj_3R_115()
+ {
+    if (jj_scan_token(SUBSTR)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_117()
+ {
+    if (jj_scan_token(REGEX)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_107()
+ {
+    if (jj_scan_token(OBJECT)) return true;
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
   private boolean jj_3_2()
  {
     if (jj_scan_token(SEMICOLON)) return true;
@@ -6465,33 +6530,6 @@
     return false;
   }
 
-  private boolean jj_3R_115()
- {
-    if (jj_scan_token(SUBSTR)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_154()
- {
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_117()
- {
-    if (jj_scan_token(REGEX)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_107()
- {
-    if (jj_scan_token(OBJECT)) return true;
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
   private boolean jj_3R_106()
  {
     if (jj_scan_token(PREDICATE)) return true;
@@ -6513,6 +6551,12 @@
     return false;
   }
 
+  private boolean jj_3R_154()
+ {
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
   private boolean jj_3R_103()
  {
     if (jj_scan_token(IS_TRIPLE)) return true;
@@ -6538,12 +6582,6 @@
     return false;
   }
 
-  private boolean jj_3R_155()
- {
-    if (jj_scan_token(LBRACKET)) return true;
-    return false;
-  }
-
   private boolean jj_3R_99()
  {
     if (jj_scan_token(IS_NUMERIC)) return true;
@@ -6551,12 +6589,6 @@
     return false;
   }
 
-  private boolean jj_3R_148()
- {
-    if (jj_3R_155()) return true;
-    return false;
-  }
-
   private boolean jj_3R_98()
  {
     if (jj_scan_token(IS_LITERAL)) return true;
@@ -6564,23 +6596,6 @@
     return false;
   }
 
-  private boolean jj_3R_123()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_147()) {
-    jj_scanpos = xsp;
-    if (jj_3R_148()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_147()
- {
-    if (jj_3R_154()) return true;
-    return false;
-  }
-
   private boolean jj_3R_97()
  {
     if (jj_scan_token(IS_BLANK)) return true;
@@ -6623,6 +6638,12 @@
     return false;
   }
 
+  private boolean jj_3R_155()
+ {
+    if (jj_scan_token(LBRACKET)) return true;
+    return false;
+  }
+
   private boolean jj_3R_91()
  {
     if (jj_scan_token(IF)) return true;
@@ -6630,6 +6651,29 @@
     return false;
   }
 
+  private boolean jj_3R_148()
+ {
+    if (jj_3R_155()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_123()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_147()) {
+    jj_scanpos = xsp;
+    if (jj_3R_148()) return true;
+    }
+    return false;
+  }
+
+  private boolean jj_3R_147()
+ {
+    if (jj_3R_154()) return true;
+    return false;
+  }
+
   private boolean jj_3R_90()
  {
     if (jj_scan_token(CALL)) return true;
@@ -7150,12 +7194,24 @@
     return false;
   }
 
+  private boolean jj_3R_150()
+ {
+    if (jj_scan_token(IRIref)) return true;
+    return false;
+  }
+
   private boolean jj_3R_141()
  {
     if (jj_scan_token(LBRACE)) return true;
     return false;
   }
 
+  private boolean jj_3R_178()
+ {
+    if (jj_scan_token(ANON)) return true;
+    return false;
+  }
+
   private boolean jj_3_3()
  {
     if (jj_scan_token(DOT)) return true;
@@ -7163,18 +7219,6 @@
     return false;
   }
 
-  private boolean jj_3R_150()
- {
-    if (jj_scan_token(IRIref)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_178()
- {
-    if (jj_scan_token(ANON)) return true;
-    return false;
-  }
-
   private boolean jj_3R_168()
  {
     Token xsp;
@@ -7334,12 +7378,6 @@
     return false;
   }
 
-  private boolean jj_3_1()
- {
-    if (jj_3R_43()) return true;
-    return false;
-  }
-
   private boolean jj_3R_191()
  {
     if (jj_scan_token(DOUBLE_POSITIVE)) return true;
@@ -7422,9 +7460,9 @@
     return false;
   }
 
-  private boolean jj_3R_163()
+  private boolean jj_3_1()
  {
-    if (jj_scan_token(NIL)) return true;
+    if (jj_3R_43()) return true;
     return false;
   }
 
@@ -7442,6 +7480,18 @@
     return false;
   }
 
+  private boolean jj_3R_165()
+ {
+    if (jj_3R_171()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_163()
+ {
+    if (jj_scan_token(NIL)) return true;
+    return false;
+  }
+
   private boolean jj_3R_162()
  {
     if (jj_3R_168()) return true;
@@ -7542,12 +7592,6 @@
     return false;
   }
 
-  private boolean jj_3R_165()
- {
-    if (jj_3R_171()) return true;
-    return false;
-  }
-
   private boolean jj_3R_143()
  {
     if (jj_scan_token(PREFIX)) return true;
@@ -7580,6 +7624,13 @@
     return false;
   }
 
+  private boolean jj_3R_139()
+ {
+    if (jj_scan_token(AGG)) return true;
+    if (jj_3R_149()) return true;
+    return false;
+  }
+
   private boolean jj_3R_44()
  {
     Token xsp;
@@ -7590,30 +7641,6 @@
     return false;
   }
 
-  private boolean jj_3R_140()
- {
-    if (jj_scan_token(LPAREN)) return true;
-    return false;
-  }
-
-  private boolean jj_3R_114()
- {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(181)) {
-    jj_scanpos = xsp;
-    if (jj_3R_140()) return true;
-    }
-    return false;
-  }
-
-  private boolean jj_3R_139()
- {
-    if (jj_scan_token(AGG)) return true;
-    if (jj_3R_149()) return true;
-    return false;
-  }
-
   private boolean jj_3R_138()
  {
     if (jj_scan_token(VAR_POP)) return true;
@@ -7621,12 +7648,6 @@
     return false;
   }
 
-  private boolean jj_3R_151()
- {
-    if (jj_scan_token(LT2)) return true;
-    return false;
-  }
-
   private boolean jj_3R_137()
  {
     if (jj_scan_token(VAR_SAMP)) return true;
@@ -7634,6 +7655,12 @@
     return false;
   }
 
+  private boolean jj_3R_140()
+ {
+    if (jj_scan_token(LPAREN)) return true;
+    return false;
+  }
+
   private boolean jj_3R_136()
  {
     if (jj_scan_token(VARIANCE)) return true;
@@ -7641,12 +7668,6 @@
     return false;
   }
 
-  private boolean jj_3R_146()
- {
-    if (jj_3R_153()) return true;
-    return false;
-  }
-
   private boolean jj_3R_135()
  {
     if (jj_scan_token(STDEV_POP)) return true;
@@ -7654,18 +7675,6 @@
     return false;
   }
 
-  private boolean jj_3R_145()
- {
-    if (jj_3R_152()) return true;
-    return false;
-  }
-
-  private boolean jj_3R_144()
- {
-    if (jj_3R_151()) return true;
-    return false;
-  }
-
   private boolean jj_3R_134()
  {
     if (jj_scan_token(STDEV_SAMP)) return true;
@@ -7673,16 +7682,13 @@
     return false;
   }
 
-  private boolean jj_3R_122()
+  private boolean jj_3R_114()
  {
     Token xsp;
     xsp = jj_scanpos;
-    if (jj_3R_144()) {
+    if (jj_scan_token(181)) {
     jj_scanpos = xsp;
-    if (jj_3R_145()) {
-    jj_scanpos = xsp;
-    if (jj_3R_146()) return true;
-    }
+    if (jj_3R_140()) return true;
     }
     return false;
   }
@@ -7701,6 +7707,12 @@
     return false;
   }
 
+  private boolean jj_3R_151()
+ {
+    if (jj_scan_token(LT2)) return true;
+    return false;
+  }
+
   private boolean jj_3R_132()
  {
     if (jj_scan_token(GROUP_CONCAT)) return true;
@@ -7708,6 +7720,12 @@
     return false;
   }
 
+  private boolean jj_3R_146()
+ {
+    if (jj_3R_153()) return true;
+    return false;
+  }
+
   private boolean jj_3R_131()
  {
     if (jj_scan_token(SAMPLE)) return true;
@@ -7715,6 +7733,18 @@
     return false;
   }
 
+  private boolean jj_3R_145()
+ {
+    if (jj_3R_152()) return true;
+    return false;
+  }
+
+  private boolean jj_3R_144()
+ {
+    if (jj_3R_151()) return true;
+    return false;
+  }
+
   private boolean jj_3R_130()
  {
     if (jj_scan_token(MODE)) return true;
@@ -7722,6 +7752,20 @@
     return false;
   }
 
+  private boolean jj_3R_122()
+ {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_144()) {
+    jj_scanpos = xsp;
+    if (jj_3R_145()) {
+    jj_scanpos = xsp;
+    if (jj_3R_146()) return true;
+    }
+    }
+    return false;
+  }
+
   private boolean jj_3R_129()
  {
     if (jj_scan_token(MEDIAN)) return true;
@@ -7817,6 +7861,20 @@
     return false;
   }
 
+  private boolean jj_3R_119()
+ {
+    if (jj_scan_token(NOT)) return true;
+    if (jj_scan_token(EXISTS)) return true;
+    return false;
+  }
+
+  private boolean jj_3R_118()
+ {
+    if (jj_scan_token(EXISTS)) return true;
+    if (jj_3R_141()) return true;
+    return false;
+  }
+
   /** Generated Token Manager. */
   public ARQParserTokenManager token_source;
   SimpleCharStream jj_input_stream;
@@ -7828,7 +7886,7 @@
   private Token jj_scanpos, jj_lastpos;
   private int jj_la;
   private int jj_gen;
-  final private int[] jj_la1 = new int[191];
+  final private int[] jj_la1 = new int[192];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static private int[] jj_la1_2;
@@ -7848,28 +7906,28 @@
       jj_la1_init_7();
    }
    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,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,0x0,0x0,0xfc00,0xfc00,0xfc00,0x81c00,0x1c00,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,0x0,0x0,0xfc00,0xfc00,0xfc00,0x81c00,0x1c00,0xdc00,0xfc00,0xc000,0x3c00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xdc00,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,0x800000,0xf87f0000,0xf87f0000,0xf87f0000,0x40,0x40,0xc0,0x0,0x0,0x40,0x80,0x40,0x40,0x0,0x0,0x20,0x80,0x1000000,0x2000000,0x0,0x0,0xf87f0000,0x800000,0xf87f0000,0xf87f0000,0xf87f0018,0x18,0xf87f0000,0xf87f0018,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,0x60f602,0x0,0x0,0x0,0x0,0x60f602,0x0,0x0,0x4,0x0,0x0,0x0,0x4,0x0,0x4,0x800,0xf87f0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf87f0000,0xf87f0000,0x0,0x0,0xf87f0000,0x0,0x0,0x0,0x0,0xf87f0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000000,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,0x800000,0xf87f0000,0xf87f0000,0xf87f0000,0x40,0x40,0xc0,0x0,0x0,0x40,0x80,0x40,0x40,0x0,0x0,0x20,0x80,0x1000000,0x2000000,0x0,0x0,0xf87f0000,0x800000,0xf87f0000,0xf87f0000,0xf87f0018,0x18,0xf87f0000,0xf87f0018,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,0x60f602,0x0,0x0,0x0,0x0,0x60f602,0x0,0x0,0x4,0x0,0x0,0x0,0x4,0x0,0x4,0x800,0xf87f0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf87f0000,0xf87f0000,0x0,0x0,0x0,0xf87f0000,0x0,0x0,0x0,0x0,0xf87f0000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8000000,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,0xff97b7ff,0xff97b7ff,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0xff97b7ff,0xff97b7ff,0xff97b7ff,0x0,0xff97b7ff,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,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,0x0,0x0,0x0,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x600000,0x600000,0x0,0x600000,0x600000,0x0,0x0,0x0,0x0,0x0,0x600000,0x0,0x0,0x0,0x0,0x600000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000,0x4000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0xff97b7ff,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7ff,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,0xff97b7ff,0xff97b7ff,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0xff97b7ff,0xff97b7ff,0xff97b7ff,0x0,0xff97b7ff,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,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,0x0,0x0,0x0,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x600000,0x600000,0x0,0x600000,0x600000,0x0,0x0,0x0,0x0,0x0,0x600000,0x0,0x0,0x0,0x0,0x600000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000,0x4000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff97b7ff,0xff97b7ff,0x0,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0xff97b7ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7ff,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,0xffffffff,0xffffffff,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0x0,0xffffffff,0xffffffff,0xffffffff,0x0,0xffffffff,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0xffffffff,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,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,0xffffffff,0xffffffff,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0x0,0xffffffff,0xffffffff,0xffffffff,0x0,0xffffffff,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0xffffffff,0x0,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,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,0x80000180,0x0,0x800001f7,0x800001f7,0x800001f7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x77,0x0,0x77,0x77,0x77,0x0,0x77,0x77,0x0,0x0,0x0,0x0,0x0,0x109ffc00,0x109ffc00,0x400000,0x1000000,0x400000,0x400000,0x400000,0x400000,0x400000,0x400000,0x10000000,0x400,0xc00,0x20000000,0x0,0x0,0x4000000,0xc000000,0x80000180,0x0,0x0,0x80000180,0x80000180,0x80000180,0x0,0x0,0x80000180,0x0,0x80000180,0x0,0x0,0x80000180,0x0,0x0,0x80000180,0x80000180,0x0,0x0,0x400000,0x0,0x80000180,0x0,0x0,0x0,0x80000180,0x0,0x80000180,0x0,0x77,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x80000180,0x0,0x0,0x80000180,0x80000180,0x80000180,0x0,0x80000180,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x800001f7,0x800001f7,0x0,0x0,0x77,0x0,0x0,0x0,0x0,0x800001f7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x180,0x0,0x0,0x0,0x0,};
+      jj_la1_4 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x800001f7,0x800001f7,0x800001f7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x77,0x0,0x77,0x77,0x77,0x0,0x77,0x77,0x0,0x0,0x0,0x0,0x0,0x109ffc00,0x109ffc00,0x400000,0x1000000,0x400000,0x400000,0x400000,0x400000,0x400000,0x400000,0x10000000,0x400,0xc00,0x20000000,0x0,0x0,0x4000000,0xc000000,0x80000180,0x0,0x0,0x80000180,0x80000180,0x80000180,0x0,0x0,0x80000180,0x0,0x80000180,0x0,0x0,0x80000180,0x0,0x0,0x80000180,0x80000180,0x0,0x0,0x400000,0x0,0x80000180,0x0,0x0,0x0,0x80000180,0x0,0x80000180,0x0,0x77,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000180,0x80000180,0x0,0x0,0x80000180,0x80000180,0x80000180,0x0,0x80000180,0x0,0x0,0x0,0x80000180,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x800001f7,0x800001f7,0x80000180,0x0,0x0,0x77,0x0,0x0,0x0,0x0,0x800001f7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x180,0x0,0x0,0x0,0x0,};
    }
    private static void jj_la1_init_5() {
-      jj_la1_5 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x780ff,0x0,0xf80ff,0xf80ff,0xf80ff,0x0,0x0,0x400000,0x0,0x0,0x0,0x400000,0x0,0x0,0x10000000,0x780ff,0x0,0x0,0x0,0x0,0x0,0x0,0x80000,0x0,0x80000,0x80000,0x80000,0x0,0x80000,0x80000,0x0,0x0,0x0,0x0,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x52f80ff,0x0,0x20000000,0x52f80ff,0x52f80ff,0x52f80ff,0x400000,0x20000000,0x52f80ff,0x0,0x52f80ff,0x20000000,0x0,0x52f80ff,0x400000,0x20000000,0x52f80ff,0x52f80ff,0x20000000,0x400000,0x0,0x280000,0x780ff,0x0,0x280000,0x280000,0x780ff,0x280000,0x780ff,0x0,0x80000,0x0,0x10000000,0x280000,0x10000000,0x280000,0x20000000,0x52f80ff,0x0,0x8000000,0x0,0x0,0x10000000,0x52f80ff,0x80000,0x80000,0x8000000,0x80000,0x80000,0x10000000,0x0,0x0,0x0,0x400000,0x80000,0x800000,0x10800000,0x10000000,0x400000,0x80000,0x0,0x0,0x80000,0x0,0x0,0x1080000,0x1080000,0x52f80ff,0x52f80ff,0x0,0x0,0x52f80ff,0x52f80ff,0x42780ff,0x0,0x780ff,0x0,0x4000000,0x0,0x42780ff,0x0,0x0,0xc0000000,0xc0000000,0xfc,0xfc,0x0,0x0,0xfc,0x0,0x0,0xf80ff,0xf80ff,0x280000,0x10000000,0x0,0x10000000,0x10000000,0x10000000,0x0,0xf80ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x8000000,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x280000,0x0,0x0,0xff,0x3,0x1c,0xe0,0x0,0x78000,0x0,0x0,0x4000000,};
+      jj_la1_5 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x780ff,0x0,0xf80ff,0xf80ff,0xf80ff,0x0,0x0,0x400000,0x0,0x0,0x0,0x400000,0x0,0x0,0x10000000,0x780ff,0x0,0x0,0x0,0x0,0x0,0x0,0x80000,0x0,0x80000,0x80000,0x80000,0x0,0x80000,0x80000,0x0,0x0,0x0,0x0,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x52f80ff,0x0,0x20000000,0x52f80ff,0x52f80ff,0x52f80ff,0x400000,0x20000000,0x52f80ff,0x0,0x52f80ff,0x20000000,0x0,0x52f80ff,0x400000,0x20000000,0x52f80ff,0x52f80ff,0x20000000,0x400000,0x0,0x280000,0x780ff,0x0,0x280000,0x280000,0x780ff,0x280000,0x780ff,0x0,0x80000,0x0,0x10000000,0x280000,0x10000000,0x280000,0x20000000,0x52f80ff,0x0,0x8000000,0x0,0x0,0x10000000,0x52f80ff,0x80000,0x80000,0x8000000,0x80000,0x80000,0x10000000,0x0,0x0,0x0,0x400000,0x80000,0x800000,0x10800000,0x10000000,0x400000,0x80000,0x0,0x0,0x80000,0x0,0x0,0x1080000,0x1080000,0x52f80ff,0x52f80ff,0x0,0x0,0x52f80ff,0x52f80ff,0x42780ff,0x0,0x780ff,0x0,0x4000000,0x0,0x42780ff,0x0,0x0,0xc0000000,0xc0000000,0xfc,0xfc,0x0,0x0,0xfc,0x0,0x0,0xf80ff,0xf80ff,0x780ff,0x280000,0x10000000,0x0,0x10000000,0x10000000,0x10000000,0x0,0xf80ff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x8000000,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x280000,0x0,0x0,0xff,0x3,0x1c,0xe0,0x0,0x78000,0x0,0x0,0x4000000,};
    }
    private static void jj_la1_init_6() {
-      jj_la1_6 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000,0x0,0x0,0x0,0x0,0x8000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x20,0x20,0x20,0x0,0x0,0x20,0x0,0x20,0x0,0x0,0x20,0x0,0x0,0x20,0x20,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x20,0x200100,0x200100,0x0,0x200100,0x200100,0x0,0x100000,0x210000,0x210000,0x100a000,0x200100,0x0,0x0,0xa000,0x100a000,0x100,0x100000,0x200000,0x200000,0x0,0x200000,0x0,0x0,0x20,0x20,0x40,0x40,0x20,0x20,0x20,0x0,0x20,0x0,0x0,0x0,0x0,0x800,0x1000,0xf,0xf,0x6000,0x0,0x18000,0x18000,0x6000,0x18000,0x18000,0x6120,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe120,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,0x0,0x0,};
+      jj_la1_6 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000,0x0,0x0,0x0,0x0,0x8000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x20,0x20,0x20,0x0,0x0,0x20,0x0,0x20,0x0,0x0,0x20,0x0,0x0,0x20,0x20,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x20,0x200100,0x200100,0x0,0x200100,0x200100,0x0,0x100000,0x210000,0x210000,0x100a000,0x200100,0x0,0x0,0xa000,0x100a000,0x100,0x100000,0x200000,0x200000,0x0,0x200000,0x0,0x0,0x20,0x20,0x40,0x40,0x20,0x20,0x20,0x0,0x20,0x0,0x0,0x0,0x0,0x800,0x1000,0xf,0xf,0x6000,0x0,0x18000,0x18000,0x6000,0x18000,0x18000,0x6120,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe120,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,0x0,0x0,};
    }
    private static void jj_la1_init_7() {
-      jj_la1_7 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,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_7 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[5];
   private boolean jj_rescan = false;
@@ -7886,7 +7944,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -7901,7 +7959,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -7912,7 +7970,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -7923,7 +7981,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -7933,7 +7991,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -7943,7 +8001,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 191; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 192; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
   }
 
@@ -8061,7 +8119,7 @@
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 191; i++) {
+    for (int i = 0; i < 192; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {
diff --git a/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java b/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java
index 095f4e3..c1458b4 100644
--- a/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java
+++ b/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java
@@ -65,7 +65,6 @@
         }
     }
 
-
     private Manifest(String fn) {
         filename = IRILib.filenameToIRI(fn) ;
         manifest = RDFDataMgr.loadModel(filename) ;
diff --git a/jena-arq/src/test/java/org/apache/jena/arq/junit/riot/RiotSyntaxTest.java b/jena-arq/src/test/java/org/apache/jena/arq/junit/riot/RiotSyntaxTest.java
index 24b5ebb..35042ba 100644
--- a/jena-arq/src/test/java/org/apache/jena/arq/junit/riot/RiotSyntaxTest.java
+++ b/jena-arq/src/test/java/org/apache/jena/arq/junit/riot/RiotSyntaxTest.java
@@ -21,6 +21,7 @@
 import static org.junit.Assert.fail;
 
 import org.apache.jena.arq.junit.manifest.ManifestEntry;
+import org.apache.jena.atlas.io.IO;
 import org.apache.jena.atlas.lib.FileOps;
 import org.apache.jena.atlas.lib.IRILib;
 import org.apache.jena.riot.Lang ;
@@ -56,8 +57,13 @@
         }
         try {
             ParseForTest.parse(stream, filename, lang);
-            if (! expectLegalSyntax )
+            if (! expectLegalSyntax ) {
+                String s = IO.readWholeFileAsUTF8(fn);
+                System.err.println();
+                System.err.println("== "+filename);
+                System.err.print(s);
                 fail("Parsing succeeded in a bad syntax test");
+            }
         } catch(RiotNotFoundException ex) {
             throw ex;
         } catch(RiotException ex) {
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangNTriples.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangNTriples.java
index 3d378cf..940f9c9 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangNTriples.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangNTriples.java
@@ -35,7 +35,7 @@
 import org.apache.jena.sparql.sse.SSE ;
 import org.junit.Test ;
 
-/** Test of syntax by a triples parser (does not include node validitiy checking) */
+/** Test of syntax by a triples parser (does not include node validity checking) */
 
 public class TestLangNTriples extends AbstractTestLangNTuples
 {
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangTurtle.java b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangTurtle.java
index 47b2eb5..3a13aea 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangTurtle.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/lang/TestLangTurtle.java
@@ -160,10 +160,10 @@
     @Test(expected=ExError.class)
     public void errorBadURI_1()         { parse("<http://example/a b> <http://example/p> 123 .") ; }
 
-    @Test(expected=ExError.class)
+    @Test(expected=ExWarning.class)
     public void errorBadURI_2()         { parse("<http://example/a%XAb> <http://example/p> 123 .") ; }
 
-    @Test //(expected=ExWarning.class)
+    @Test
     public void errorBadURI_3()         { parse("<http://example/a%Aab> <http://example/p> 123 .") ; }
 
     // Bad URIs
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/lang/CatchParserOutput.java b/jena-arq/src/test/java/org/apache/jena/riot/system/CatchParserOutput.java
similarity index 77%
rename from jena-arq/src/test/java/org/apache/jena/riot/lang/CatchParserOutput.java
rename to jena-arq/src/test/java/org/apache/jena/riot/system/CatchParserOutput.java
index ed1cb95..d70b543 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/lang/CatchParserOutput.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/system/CatchParserOutput.java
@@ -16,26 +16,25 @@
  * limitations under the License.
  */
 
-package org.apache.jena.riot.lang;
+package org.apache.jena.riot.system;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.jena.atlas.lib.Pair;
 import org.apache.jena.graph.Triple;
-import org.apache.jena.riot.system.StreamRDF;
 import org.apache.jena.sparql.core.Quad;
 
-class CatchParserOutput implements StreamRDF
+public class CatchParserOutput implements StreamRDF
 {
-    List<Triple>      triples     = new ArrayList<>() ;
-    List<Quad>        quads       = new ArrayList<>() ;
-    List<Pair<String,String>>     prefixes     = new ArrayList<>() ;
-    List<String>     bases       = new ArrayList<>() ;
+    public List<Triple>      triples     = new ArrayList<>() ;
+    public List<Quad>        quads       = new ArrayList<>() ;
+    public List<Pair<String,String>>     prefixes     = new ArrayList<>() ;
+    public List<String>     bases       = new ArrayList<>() ;
 
-    int startCalled = 0 ;
+    public int startCalled = 0 ;
 
-    int finishCalled = 0 ;
+    public int finishCalled = 0 ;
 
     @Override public void start()   { startCalled++ ; }
 
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java b/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
index 4f77e8b..c49b175 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
@@ -44,6 +44,7 @@
     , TestFormatRegistration.class
     , TestJsonLDReadWrite.class         // Some simple testing of the jsonld-java engine.
     , TestSerializable.class
+    , TestIRIxRIOT.class
 })
 
 public class TS_RiotSystem
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/system/TestChecker.java b/jena-arq/src/test/java/org/apache/jena/riot/system/TestChecker.java
index 63d7549..caeb426 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/system/TestChecker.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/system/TestChecker.java
@@ -20,7 +20,6 @@
 
 import org.apache.jena.graph.Node ;
 import org.apache.jena.riot.ErrorHandlerTestLib ;
-import org.apache.jena.riot.ErrorHandlerTestLib.ExError ;
 import org.apache.jena.riot.ErrorHandlerTestLib.ExWarning ;
 import org.apache.jena.shared.impl.JenaParameters ;
 import org.apache.jena.sparql.util.NodeFactoryExtra ;
@@ -49,7 +48,7 @@
     @Test
     public void checker_uri_01()    { check("<http://example/x>") ; }
 
-    @Test(expected=ExError.class)
+    @Test(expected=ExWarning.class)
     public void checker_uri_02()    { check("<x>") ; }
 
     @Test (expected=ExWarning.class)
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/system/TestIRIxRIOT.java b/jena-arq/src/test/java/org/apache/jena/riot/system/TestIRIxRIOT.java
new file mode 100644
index 0000000..dd1d50a
--- /dev/null
+++ b/jena-arq/src/test/java/org/apache/jena/riot/system/TestIRIxRIOT.java
@@ -0,0 +1,260 @@
+/*
+ * 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.riot.system;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.jena.atlas.lib.Bytes;
+import org.apache.jena.irix.IRIs;
+import org.apache.jena.irix.IRIxResolver;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFParser;
+import org.apache.jena.riot.RDFParserBuilder;
+import org.apache.jena.riot.RiotException;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+/** Test IRIx in parser usage. */
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestIRIxRIOT {
+
+    // The cases:
+    // _nt        ::  N-triples, default configuration.
+    // _nt_check  ::  N-triples, with checking.
+    // _ttl       :: Turtle, default configuration (which is checking).
+
+    @Test public void irix_http_1_nt()          { testDft("<http://example/>", Lang.NT, 0, 0); }
+    @Test public void irix_http_1_nt_check()    { testNT("<http://example/>", TRUE, UNSET, 0, 0); }
+    @Test public void irix_http_1_ttl()         { testDft("<http://example/>", Lang.TTL, 0, 0); }
+
+    @Test public void irix_http_2_nt()          { testDft("<HTTP://example/>", Lang.NT, 0, 0); }
+    @Test public void irix_http_2_nt_check()    { testLang("<HTTP://example/>", Lang.NT, UNSET, TRUE, 0, 1); }
+    @Test public void irix_http_2_ttl()         { testDft("<HTTP://example/>", Lang.TTL, 0, 1); }
+
+    @Test public void irix_http_3_nt()          { testDft("<http://EXAMPLE/>", Lang.NT, 0, 0); }
+    @Test public void irix_http_3_nt_check()    { testLang("<http://EXAMPLE/>", Lang.NT, UNSET, TRUE, 0, 0); }
+    @Test public void irix_http_3_ttl()         { testDft("<http://EXAMPLE/>", Lang.TTL, 0, 0); }
+
+    @Test public void irix_http_4_nt()          { testDft("<http://user:pw@host/>", Lang.NT, 0, 0); }
+    @Test public void irix_http_4_nt_check()    { testLang("<http://user:pw@host/>", Lang.NT, UNSET, TRUE, 0, 2); }
+    @Test public void irix_http_4_ttl()         { testDft("<http://user:pw@host/>", Lang.TTL, 0, 2); }
+
+    @Test public void irix_uuid_1_nt()          { testDft("<urn:uuid:6cd401dc-a8d2-11eb-9192-1f162b53dc79>", Lang.NT, 0, 0); }
+    @Test public void irix_uuid_1_nt_check()    { testLang("<urn:uuid:6cd401dc-a8d2-11eb-9192-1f162b53dc79>", Lang.NT, UNSET, TRUE, 0, 0); }
+    @Test public void irix_uuid_1_ttl()         { testDft("<urn:uuid:6cd401dc-a8d2-11eb-9192-1f162b53dc79>", Lang.TTL, 0, 0); }
+
+    @Test public void irix_uuid_2_nt()          { testDft("<urn:uuid:bad>", Lang.NT, 0, 1); }
+    @Test public void irix_uuid_2_nt_check()    { testLang("<urn:uuid:bad>", Lang.NT, UNSET, TRUE, 0, 1); }
+    @Test public void irix_uuid_2_ttl()         { testDft("<urn:uuid:bad>", Lang.TTL, 0, 1); }
+
+    @Test public void irix_uuid_3_nt()          { testDft("<urn:uuid:bad>", Lang.NT, 0, 1); }
+    @Test public void irix_uuid_3_nt_check()    { testLang("<urn:uuid:bad>", Lang.NT, UNSET, TRUE, 0, 1); }
+    @Test public void irix_uuid_3_ttl()         { testDft("<urn:uuid:bad>", Lang.TTL, 0, 1); }
+
+    @Test public void irix_uuid_4_nt()          { testDft("<uuid:bad>", Lang.NT, 0, 1); }
+    @Test public void irix_uuid_4_nt_check()    { testLang("<uuid:bad>", Lang.NT, UNSET, TRUE, 0, 1); }
+    @Test public void irix_uuid_4_ttl()         { testDft("<uuid:bad>", Lang.TTL, 0, 1); }
+
+    @Test public void irix_urn_1_nt()           { testDft("<urn:ab:c>", Lang.NT, 0, 0); }
+    @Test public void irix_urn_1_nt_check()     { testLang("<urn:ab:c>", Lang.NT, UNSET, TRUE, 0, 0); }
+    @Test public void irix_urn_1_ttl()          { testDft("<urn:ab:c>", Lang.TTL, 0, 0); }
+
+    // URNs are required to have 2+ character NID : RFC 8141
+    @Test public void irix_urn_2_nt()           { testDft("<urn:x:c>", Lang.NT, 0, 0); }
+    @Test public void irix_urn_2_nt_check()     { testLang("<urn:x:c>", Lang.NT, UNSET, TRUE, 0, 1); }
+    @Test public void irix_urn_2_ttl()          { testDft("<urn:x:c>", Lang.TTL, 0, 1); }
+
+    @Test public void irix_urn_3_nt()           { testDft("<urn:00:c>", Lang.NT, 0, 0); }
+    @Test public void irix_urn_3_nt_check()     { testLang("<urn:00:c>", Lang.NT, UNSET, TRUE, 0, 0); }
+    @Test public void irix_urn_3_ttl()          { testDft("<urn:00:c>", Lang.TTL, 0, 0); }
+
+    // URIs
+    @Test public void irix_err_1_nt()           { testDft("<http://host/bad path/>", Lang.NT, 1, 1); }
+    @Test public void irix_err_1_nt_check()     { testLang("<http://host/bad path/>", Lang.NT, UNSET, TRUE, 1, 1); }
+    @Test public void irix_err_1_ttl()          { testDft("<http://host/bad path/>", Lang.TTL, 1, 1); }
+
+    // NT: Relative URI
+    @Test public void irix_relative_nt()           { testNT("<relative>", UNSET, UNSET, 0, 0); }
+    @Test public void irix_relative_nt_check()     { testNT("<relative>", UNSET, TRUE, 0, 1); }
+    @Test public void irix_relative_nt_strict()    { testNT("<relative>", TRUE, UNSET, 1, 0); }
+    @Test public void irix_relative_nt_strict_check()    { testNT("<relative>", TRUE, TRUE, 1, 0); }
+    @Test public void irix_relative_nt_strict_nocheck()   { testNT("<relative>", TRUE, FALSE, 1, 0); }
+
+    // -------- Special cases for Turtle.
+    // Turtle - base defaults to system base in normal use.
+
+    @Test
+    public void irix_relative_3_ttl() {
+        assumeTrue(IRIs.getBaseStr() != null);
+        testTTL("<relative>", UNSET, UNSET, 0, 0);
+    }
+
+    // Turtle with directly set resolver, non-standard setup. no base, resolve, no relative IRIs
+    @Test public void irix_ttl_resolver_0() {
+        // Resolver:: default is allowRelative(true)
+        IRIxResolver resolver = IRIxResolver.create().noBase().build();
+        testTTL("<relative>", resolver, 0, 1);
+    }
+
+    @Test public void irix_ttl_resolver_1() {
+        // Resolver:: no base, no relative IRIs -> error.
+        IRIxResolver resolver = IRIxResolver.create().noBase().allowRelative(false).build();
+        testTTL("<relative>", resolver, 1, 0);
+    }
+
+    // Turtle with directly set resolver, non-standard setup. No base, no resolve, no relative IRIs.
+    @Test public void irix_ttl_resolver_2() {
+        // Resolver:: no base, no relative IRIs, no resolving -> error.
+        IRIxResolver resolver = IRIxResolver.create().noBase().resolve(false).allowRelative(false).build();
+        testTTL("<relative>", resolver, 1, 0);
+    }
+
+    @Test public void irix_ttl_resolver_3() {
+        // Resolver:: no base, allow relative IRIs -> warning.
+        IRIxResolver resolver = IRIxResolver.create().noBase().resolve(true).allowRelative(true).build();
+        testTTL("<relative>", resolver, 0, 1);
+    }
+
+    @Test public void irix_ttl_resolver_4() {
+        // Resolver:: no base, allow relative IRIs, no resolving -> warning.
+        IRIxResolver resolver = IRIxResolver.create().noBase().resolve(false).allowRelative(true).build();
+        testTTL("<relative>", resolver, 0, 1);
+    }
+
+    @Test public void irix_ttl_resolver_5() {
+        // Resolver:: no base, allow relative IRIs, no resolving -> warning.
+        IRIxResolver resolver = IRIxResolver.create().noBase().resolve(false).allowRelative(true).build();
+        testTTL("<relative>", resolver, 0, 1);
+    }
+
+    // --------
+
+    private static final Optional<Boolean> TRUE  = Optional.of(true);
+    private static final Optional<Boolean> FALSE = Optional.of(false);
+    private static final Optional<Boolean> UNSET = Optional.empty();
+
+    // Default behaviour of Lang.
+    private static void testDft(String iri, Lang lang, int numErrors, int numWarnings) {
+        testLang(iri, lang, /*base*/null, UNSET, UNSET, numErrors, numWarnings);
+    }
+
+    // Behaviour of Lang, toegther with settable strict and checking.
+    private static void testLang(String iri, Lang lang, Optional<Boolean> strict, Optional<Boolean> checking, int numErrors, int numWarnings) {
+        testLang(iri, lang, /*base*/null, strict, checking, numErrors, numWarnings);
+    }
+
+    // N-triples
+    private static void testNT(String iri, Optional<Boolean> strict, Optional<Boolean> checking, int numErrors, int numWarnings) {
+        testLang(iri, Lang.NT, /*base*/null, strict, checking, numErrors, numWarnings);
+    }
+
+    // Turtle, with base.
+    private static void testTTL(String iri, Optional<Boolean> strict, Optional<Boolean> checking, int numErrors, int numWarnings) {
+        testLang(iri, Lang.TTL, "http://base/", strict, checking, numErrors, numWarnings);
+    }
+
+    // Turtle, with resolver
+    private static void testTTL(String iri, IRIxResolver resolver, int numErrors, int numWarnings) {
+        InputStream in = generateSource(iri);
+        RDFParserBuilder builder = RDFParser.source(in).forceLang(Lang.TTL).resolver(resolver);
+        runTest(builder, iri, numErrors, numWarnings);
+    }
+
+    private static void testLang(String iri, Lang lang, String base, Optional<Boolean> strict, Optional<Boolean> checking, int numErrors, int numWarnings) {
+        InputStream in = generateSource(iri);
+        RDFParserBuilder builder = RDFParser.source(in).forceLang(lang);
+        builder.base(base);
+        if ( strict.isPresent() )
+            builder.strict(strict.get());
+        if ( checking.isPresent() )
+            builder.checking(checking.get());
+        runTest(builder, iri, numErrors, numWarnings);
+    }
+
+    private static void runTest(RDFParserBuilder builder, String iri, int numErrors, int numWarnings) {
+        StreamRDF dest = new CatchParserOutput();
+        ErrorHandlerCollector eh = new ErrorHandlerCollector();
+        builder.errorHandler(eh);
+
+        // Do it!
+        builder.build().parse(dest);
+
+        int numErrorsActual = eh.errors.size();
+        int numWarningsActual = eh.warnings.size();
+
+        String msg = "Errors=("+numErrors+",got="+numErrorsActual+") Warnings=("+numWarnings+",got="+numWarningsActual+")";
+
+        if ( numErrors != numErrorsActual || numWarnings != numWarningsActual ) {
+            System.err.println("== "+iri);
+            System.err.println("-- "+msg);
+            if ( numErrorsActual == 0 )
+                System.err.println("Errors: None");
+            else
+                eh.errors.forEach(m->System.err.println("Error: "+m));
+            if ( numWarningsActual == 0 && numWarnings >= 0 )
+                System.err.println("Warnings: None");
+            else
+                eh.warnings.forEach(m->System.err.println("Warnings: "+m));
+        }
+
+        assertEquals("Errors ("+msg+")", numErrors, numErrorsActual);
+        // Only tested if errors passes.
+        // -1 => ignore
+        if ( numWarnings >= 0 )
+            assertEquals("Warnings ("+msg+")", numWarnings, numWarningsActual);
+    }
+
+    private static InputStream generateSource(String iri) {
+        // N-Triples line with test subject
+        String TEXT = iri+" <x:p> <x:o> .";
+        InputStream inText = new ByteArrayInputStream(Bytes.string2bytes(TEXT));
+        return inText;
+    }
+
+    static class ErrorHandlerCollector implements ErrorHandler {
+        List<String> warnings = new ArrayList<>();
+        List<String> errors = new ArrayList<>();
+        List<String> fatals = new ArrayList<>();
+
+        @Override
+        public void warning(String message, long line, long col) {
+            warnings.add(message);
+        }
+
+        @Override
+        public void error(String message, long line, long col) {
+            errors.add(message);
+            //throw new RiotException(message);
+        }
+
+        @Override
+        public void fatal(String message, long line, long col) {
+            fatals.add(message);
+            throw new RiotException(message);
+        }
+    }
+}
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java
index 7d780e5..a6c3455 100644
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java
+++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/EscapeStr.java
@@ -145,7 +145,7 @@
 
     /** Unicode escapes  \-u and \-U only */
     public static String unescapeUnicode(String s) {
-        return  unescape(s, '\\', true) ;
+        return unescape(s, '\\', true) ;
     }
 
     // Main worker function for unescaping strings.
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/StrUtils.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/StrUtils.java
index c771acf..5ad6a9d 100644
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/StrUtils.java
+++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/StrUtils.java
@@ -35,7 +35,7 @@
 public class StrUtils //extends StringUtils
 {
     private StrUtils() {}
-    
+
     /** strjoin with a newline as the separator */
     public static String strjoinNL(String... args) {
         return String.join("\n", args);
@@ -56,10 +56,10 @@
     public static final int CMP_GREATER  = +1 ;
     public static final int CMP_EQUAL    =  0 ;
     public static final int CMP_LESS     = -1 ;
-    
+
     public static final int CMP_UNEQUAL  = -9 ;
     public static final int CMP_INDETERMINATE  = 2 ;
-    
+
     public static int strCompare(String s1, String s2) {
         // Value is the difference of the first differing chars
         int x = s1.compareTo(s2) ;
@@ -68,7 +68,7 @@
         if ( x == 0 ) return CMP_EQUAL ;
         throw new InternalErrorException("String comparison failure") ;
     }
-    
+
     public static int strCompareIgnoreCase(String s1, String s2) {
         // x is the difference of the first differing chars
         int x = s1.compareToIgnoreCase(s2) ;
@@ -78,14 +78,22 @@
         throw new InternalErrorException("String comparison failure") ;
     }
 
+    public static boolean strStartsWithIgnoreCase(String str, String prefix) {
+        return str.regionMatches(true, 0, prefix, 0, prefix.length());
+    }
+
+    public static boolean strEndsWithIgnoreCase(String str, String suffix) {
+        return str.regionMatches(true, str.length()-suffix.length(), suffix, 0, suffix.length());
+    }
+
     public static byte[] asUTF8bytes(String s) {
-        return s.getBytes(UTF_8) ; 
+        return s.getBytes(UTF_8) ;
     }
 
     public static String fromUTF8bytes(byte[] bytes) {
-        return new String(bytes, UTF_8) ; 
+        return new String(bytes, UTF_8) ;
     }
-    
+
     /**
      * @param x
      * @return &lt;null&gt; if x == null, otherwise, x.toString()
@@ -98,10 +106,10 @@
     public static String[] split(String s, String splitStr) {
         return stream(s.split(splitStr)).map(String::trim).toArray(String[]::new) ;
     }
-    
+
     /**
      * Does one string contain another string?
-     * 
+     *
      * @param str1
      * @param str2
      * @return true if str1 contains str2
@@ -109,7 +117,7 @@
     public final static boolean contains(String str1, String str2) {
         return str1.contains(str2) ;
     }
-    
+
     public final static String replace(String string, String target, String replacement) {
         return string.replace(target, replacement) ;
     }
@@ -117,12 +125,12 @@
     public static String substitute(String str, Map<String, String> subs) {
         for ( Map.Entry<String, String> e : subs.entrySet() ) {
             String param = e.getKey() ;
-            if ( str.contains(param) ) 
+            if ( str.contains(param) )
                 str = str.replace(param, e.getValue()) ;
         }
         return str ;
     }
-    
+
     public static String strform(Map<String, String> subs, String... args) {
         return substitute(strjoinNL(args), subs) ;
     }
@@ -136,20 +144,20 @@
             x = StrUtils.chop(x) ;
         return x ;
     }
-    
+
     public static List<Character> toCharList(String str) {
         return str.codePoints().mapToObj(i -> (char) i).map(Character::valueOf).collect(toList());
     }
-    
+
     // ==== Encoding and decoding strings based on a marker character (e.g. %)
-    // and then the hexadecimal representation of the character.  
+    // and then the hexadecimal representation of the character.
     // Only characters 0-255 can be encoded.
     // Decoding is more general.
-    
+
     /**
      * Encode a string using hex values e.g. %20.
-     * Encoding only deals with single byte codepoints.  
-     * 
+     * Encoding only deals with single byte codepoints.
+     *
      * @param str String to encode
      * @param marker Marker character
      * @param escapees Characters to encode (must include the marker)
@@ -189,7 +197,7 @@
     /**
      * Decode a string using marked hex values e.g. %20.
      * Multi-byte UTF-8 codepoints are handled.
-     * 
+     *
      * @param str String to decode.
      * @param marker The marker character
      * @return Decoded string (returns input object if no change)
@@ -198,7 +206,7 @@
         if ( str.indexOf(marker) < 0 )
             // No marker, no work.
             return str;
-        // By working in bytes, we deal with mult-byte codepoints. 
+        // By working in bytes, we deal with mult-byte codepoints.
         byte[] strBytes = StrUtils.asUTF8bytes(str);
         final int N = strBytes.length;
         // Max length
@@ -224,13 +232,13 @@
         String s = new String(bytes, 0, i, StandardCharsets.UTF_8);
         return s;
     }
-    
+
     // Same but working on the string.  This is the pair of the encoder.
     // Encode/decode is normally use is for characters that illegal in a position
     // (e.g. URI components, spaces in URIs).
-    
-    // This string version is brittle - reverses the encoding of encodeHex() 
-    // but not general use as a decoder of a string. 
+
+    // This string version is brittle - reverses the encoding of encodeHex()
+    // but not general use as a decoder of a string.
     // Multi-byte codepoints do not get recombined if operating on strings/characters.
     private /*public*/ static String _forInfo_decodeHex(String str, char marker) {
         int idx = str.indexOf(marker);
@@ -267,7 +275,7 @@
             return ch - 'A' + 10;
         if ( ch >= 'a' && ch <= 'f' )
             return ch - 'a' + 10;
-        throw new AtlasException(format("Decoding error: bad character for hex digit (0x%02X) '%c' ",ch, ch)); 
+        throw new AtlasException(format("Decoding error: bad character for hex digit (0x%02X) '%c' ",ch, ch));
     }
 
     public static String escapeString(String x) {
diff --git a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestStrUtils.java b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestStrUtils.java
index 1628866..41dd980 100644
--- a/jena-base/src/test/java/org/apache/jena/atlas/lib/TestStrUtils.java
+++ b/jena-base/src/test/java/org/apache/jena/atlas/lib/TestStrUtils.java
@@ -19,6 +19,8 @@
 package org.apache.jena.atlas.lib;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.jena.atlas.AtlasException;
 import org.junit.Test ;
@@ -26,8 +28,8 @@
 public class TestStrUtils
 {
     static char marker = '_' ;
-    static char esc[] = { ' ' , '_' } ; 
-    
+    static char esc[] = { ' ' , '_' } ;
+
     static void test(String x) {
         test(x, null);
     }
@@ -45,43 +47,72 @@
         String x2 = StrUtils.decodeHex(input, marker);
         assertEquals(expected, x2);
     }
-    
-    @Test public void enc01() { test("abc") ; } 
 
-    @Test public void enc02() { test("") ; } 
+    @Test public void enc01() { test("abc") ; }
 
-    @Test public void enc03() { test("_", "_5F" ) ; } 
-    
-    @Test public void enc04() { test(" ", "_20" ) ; } 
-    
-    @Test public void enc05() { test("_ _", "_5F_20_5F" ) ; } 
-    
-    @Test public void enc06() { test("_5F", "_5F5F" ) ; } 
-    
+    @Test public void enc02() { test("") ; }
+
+    @Test public void enc03() { test("_", "_5F" ) ; }
+
+    @Test public void enc04() { test(" ", "_20" ) ; }
+
+    @Test public void enc05() { test("_ _", "_5F_20_5F" ) ; }
+
+    @Test public void enc06() { test("_5F", "_5F5F" ) ; }
+
     @Test public void enc07() { test("_2") ; }
-    
-    @Test public void enc08() { test("AB_CD", "AB_5FCD") ; } 
-    
-    // JENA-1890: Multibyte characters before the "_"  
+
+    @Test public void enc08() { test("AB_CD", "AB_5FCD") ; }
+
+    // JENA-1890: Multibyte characters before the "_"
     // 사용_설명서 (Korean: "User's Guide")
-    
+
     @Test public void enc09() { test("\uC0AC\uC6A9_\uC124\uBA85\uC11C"); }
-    // Same string, but using the glyphs for the codepoints, not the \ u value. Same string after Java parsing. 
+    // Same string, but using the glyphs for the codepoints, not the \ u value. Same string after Java parsing.
     @Test public void enc09a() { test("사용_설명서"); }
-    
+
     // The decode code works more generally than the encoder.
     // This tests the decode of the UTF=-8 byte encoding of 사용_설명서
-    // Note "_5F" which is "_" encoded.  
+    // Note "_5F" which is "_" encoded.
     @Test public void enc10() { testDecode("_EC_82_AC_EC_9A_A9_5F_EC_84_A4_EB_AA_85_EC_84_9C", "사용_설명서"); }
-    
+
     @Test public void enc11() { testDecode("_41", "A"); }
-    
+
     @Test(expected=AtlasException.class) public void enc20() { testDecode("_4", null); }
 
     @Test(expected=AtlasException.class) public void enc21() { testDecode("_", null); }
-    
+
     @Test(expected=AtlasException.class) public void enc22() { testDecode("_X1", null); }
-    
+
     @Test(expected=AtlasException.class) public void enc23() { testDecode("_1X", null); }
 
+    @Test public void prefix_ignorecase_1() {
+        boolean b = StrUtils.strStartsWithIgnoreCase("foobar", "FOO");
+        assertTrue(b);
+    }
+
+    @Test public void prefix_ignorecase_2() {
+        boolean b = StrUtils.strStartsWithIgnoreCase("foobar", "bar");
+        assertFalse(b);
+    }
+    @Test public void prefix_ignorecase_3() {
+        boolean b = StrUtils.strStartsWithIgnoreCase("foo", "foobar");
+        assertFalse(b);
+    }
+
+    @Test public void suffix_ignorecase_1() {
+        boolean b = StrUtils.strEndsWithIgnoreCase("foobar", "BAR");
+        assertTrue(b);
+    }
+
+    @Test public void suffix_ignorecase_2() {
+        boolean b = StrUtils.strEndsWithIgnoreCase("foobar", "oo");
+        assertFalse(b);
+    }
+    @Test public void suffix_ignorecase_3() {
+        boolean b = StrUtils.strEndsWithIgnoreCase("bar", "foobar");
+        assertFalse(b);
+    }
+
+
 }
diff --git a/jena-cmds/src/main/java/tdb2/tdbcompact.java b/jena-cmds/src/main/java/tdb2/tdbcompact.java
index a762381..d2bca64 100644
--- a/jena-cmds/src/main/java/tdb2/tdbcompact.java
+++ b/jena-cmds/src/main/java/tdb2/tdbcompact.java
@@ -18,18 +18,33 @@
 
 package tdb2;
 
+import org.apache.jena.cmd.ArgDecl;
 import org.apache.jena.tdb2.store.DatasetGraphSwitchable;
 import org.apache.jena.tdb2.sys.DatabaseOps;
 import tdb2.cmdline.CmdTDB;
 
 public class tdbcompact extends CmdTDB {
+    private static final ArgDecl argDeleteOld = new ArgDecl(ArgDecl.NoValue, "deleteOld");
+
+    private boolean shouldDeleteOld = false;
+
+
     static public void main(String... argv) {
         CmdTDB.init() ;
         new tdbcompact(argv).mainRun() ;
     }
 
     protected tdbcompact(String[] argv) {
-        super(argv) ;
+        super(argv);
+
+        super.add(argDeleteOld, "--deleteOld", "Delete old database after compaction");
+    }
+
+    @Override
+    protected void processModulesAndArgs() {
+        super.processModulesAndArgs();
+
+        shouldDeleteOld = contains(argDeleteOld);
     }
 
     @Override
@@ -41,7 +56,7 @@
     protected void exec() {
         DatasetGraphSwitchable dsg = getDatabaseContainer() ;
         long start = System.currentTimeMillis();
-        DatabaseOps.compact(dsg) ;
+        DatabaseOps.compact(dsg, shouldDeleteOld) ;
         long finish = System.currentTimeMillis();
         System.out.printf("Compacted in %.3fs\n", (finish-start)/1000.0);
     }
diff --git a/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java b/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
index bf2fcf9..4b96884 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/IRIProviderJenaIRI.java
@@ -76,16 +76,14 @@
         @Override
         public IRIx resolve(String other) {
             IRI iri2 = jenaIRI.resolve(other);
-            IRIProviderJenaIRI.exceptions(iri2);
-            return new IRIxJena(iri2.toString(), iri2);
+            return newIRIxJena(iri2);
         }
 
         @Override
         public IRIx resolve(IRIx other) {
             IRIxJena iriOther = (IRIxJena)other;
             IRI iri2 = jenaIRI.resolve(iriOther.jenaIRI);
-            IRIProviderJenaIRI.exceptions(iri2);
-            return new IRIxJena(iri2.toString(), iri2);
+            return newIRIxJena(iri2);
         }
 
         @Override
@@ -104,8 +102,7 @@
             IRI iri2 = jenaIRI.relativize(iriOther.jenaIRI, relFlags);
             if ( iri2.equals(iriOther.jenaIRI))
                 return null;
-            IRIProviderJenaIRI.exceptions(iri2);
-            return new IRIxJena(iri2.toString(), iri2);
+            return newIRIxJena(iri2);
         }
 
         @Override
@@ -131,25 +128,27 @@
         }
     }
 
+    private static IRIxJena newIRIxJena(IRI iri2) {
+        String iriStr2 = iri2.toString();
+        return newIRIxJena(iri2, iriStr2);
+    }
+
+    private static IRIxJena newIRIxJena(IRI iri2, String iriStr2) {
+        IRIProviderJenaIRI.exceptions(iri2, iriStr2);
+        return new IRIxJena(iriStr2, iri2);
+    }
+
     @Override
     public IRIx create(String iriStr) throws IRIException {
         // "create" - does not throw exceptions
         IRI iriObj = iriFactory().create(iriStr);
-        // errors and warnings.
-        if ( STRICT_FILE && isFILE(iriObj) ) {
-            if ( iriStr.startsWith("file://" ) && ! iriStr.startsWith("file:///") )
-                throw new IRIException("file: URLs should start file:///");
-        }
-        if ( isUUID(iriObj) )
-            checkUUID(iriObj, iriStr);
-        exceptions(iriObj);
-        return new IRIProviderJenaIRI.IRIxJena(iriStr, iriObj);
+        return newIRIxJena(iriObj, iriStr);
     }
 
     @Override
     public void check(String iriStr) throws IRIException {
         IRI iri = iriFactory().create(iriStr);
-        exceptions(iri);
+        exceptions(iri, iriStr);
     }
 
     @Override
@@ -205,7 +204,21 @@
     // Should be "false" in a release - this is an assist for development checking.
     private static final boolean includeWarnings = false;
 
-    private static IRI exceptions(IRI iri) {
+    private static IRI exceptions(IRI iri, String iriStr) {
+        if ( iriStr == null )
+            iriStr = iri.toString();
+
+        // Additional checks
+
+        // errors and warnings.
+        if ( STRICT_FILE && isFILE(iri) ) {
+            if ( iriStr.startsWith("file://" ) && ! iriStr.startsWith("file:///") )
+                throw new IRIException("file: URLs should start file:///: <"+iriStr+">");
+        }
+
+        if ( isUUID(iri, iriStr) ) {
+            checkUUID(iri, iriStr);
+        }
         if (!showExceptions)
             return iri;
         if (!iri.hasViolation(includeWarnings))
@@ -218,6 +231,7 @@
             int code = v.getViolationCode() ;
             // Filter codes.
             // Global settings below; this section is for conditional filtering.
+            // See also Checker.iriViolations for WARN filtering.
             switch(code) {
                 case Violation.PROHIBITED_COMPONENT_PRESENT:
                     // Allow "u:p@" when non-strict.
@@ -237,7 +251,7 @@
                     if ( isFILE(iri) )
                         continue;
             }
-            // First error.
+            // Signal first error.
             String msg = v.getShortMessage();
             throw new IRIException(msg);
         }
@@ -246,23 +260,22 @@
 
     // HTTP and HTTPS
     private static boolean isHTTP(IRI iri) {
-        return "http".equalsIgnoreCase(iri.getScheme()) || "https".equalsIgnoreCase(iri.getScheme());
+        return "http".equalsIgnoreCase(iri.getScheme())
+            || "https".equalsIgnoreCase(iri.getScheme());
     }
 
     private static boolean isURN(IRI iri)  { return "urn".equalsIgnoreCase(iri.getScheme()); }
     private static boolean isFILE(IRI iri) { return "file".equalsIgnoreCase(iri.getScheme()); }
 
-    // Checks trailing part of URI.
-    // Works on "urn:" and "urn:uuid:".
-    private static Pattern UUID_PATTERN = Pattern.compile(":[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
+    private static String UUID_REGEXP = "^(?:urn:uuid|uuid):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
+    private static Pattern UUID_PATTERN = Pattern.compile(UUID_REGEXP, Pattern.CASE_INSENSITIVE);
 
-    private boolean isUUID(IRI iri) {
-        if ( "uuid".equalsIgnoreCase(iri.getScheme()) )
-                return true;
-        return iri.getRawPath().startsWith("uuid:");
+    private static boolean isUUID(IRI iri, String iriStr) {
+        return iriStr.regionMatches(true, 0, "urn:uuid:", 0, "urn:uuid:".length())
+            || iriStr.regionMatches(true, 0, "uuid:", 0, "uuid:".length());
     }
 
-    private void checkUUID(IRI iriObj, String original) {
+    private static void checkUUID(IRI iriObj, String original) {
         if ( iriObj.getRawFragment() != null )
             throw new IRIException("Fragment used with UUID");
         if ( iriObj.getRawQuery() != null )
diff --git a/jena-core/src/main/java/org/apache/jena/irix/IRIs.java b/jena-core/src/main/java/org/apache/jena/irix/IRIs.java
index 1efba86..c537056 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/IRIs.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/IRIs.java
@@ -39,7 +39,7 @@
         Objects.requireNonNull(iriStr);
         IRIx iri = IRIx.create(iriStr);
         if ( ! iri.isReference() )
-            throw new IRIException("Not an RDF IRI: "+iriStr);
+            throw new IRIException("Not an RDF IRI: <"+iriStr+">");
         return iri;
     }
 
diff --git a/jena-core/src/main/java/org/apache/jena/irix/IRIxResolver.java b/jena-core/src/main/java/org/apache/jena/irix/IRIxResolver.java
index 1132e0c..e557df4 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/IRIxResolver.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/IRIxResolver.java
@@ -19,6 +19,7 @@
 package org.apache.jena.irix;
 
 import java.util.Objects;
+import java.util.Optional;
 
 import org.apache.jena.atlas.lib.Cache;
 import org.apache.jena.atlas.lib.CacheFactory;
@@ -85,10 +86,8 @@
         IRIx x = (base != null && resolve)
                 ? base.resolve(str)
                 : IRIx.create(str);
-        if ( ! allowRelative ) {
-            if ( ! x.isReference() )
-                throw new IRIException("Not an RDF IRI: "+str);
-        }
+        if ( ! allowRelative && x.isRelative() )
+            throw new RelativeIRIException("Relative IRI: <"+str+">");
         return x;
     }
 
@@ -104,15 +103,13 @@
 
    public static Builder create() { return new Builder(); }
 
-
    /**
     * Create a {@link IRIxResolver} with the base URI which is resolved against the
     * current system default base.
     */
    public static Builder create(IRIxResolver original) {
        Builder builder = new Builder();
-       builder.base = original.base;
-       builder.baseSet = true;
+       builder.base = Optional.ofNullable(original.base);
        builder.resolve = original.resolve;
        builder.allowRelative = original.allowRelative;
        return builder;
@@ -136,29 +133,26 @@
    }
 
    public static class Builder {
-
-       private boolean baseSet = false;
-       private IRIx base = null;
-       private boolean resolve = true;
+       // null is "unset".
+       private Optional<IRIx> base   = null;
+       private boolean resolve       = true;
        private boolean allowRelative = true;
 
        private Builder() {}
 
        public Builder base(IRIx baseURI) {
-           this.base = baseURI;
-           this.baseSet = true;
+           this.base = Optional.ofNullable(baseURI);
            return this;
        }
 
        public Builder base(String baseStr) {
-           base = (baseStr == null) ? null : IRIs.resolveIRI(baseStr);
-           this.baseSet = true;
+           IRIx baseIRI = (baseStr == null) ? null : IRIs.resolveIRI(baseStr);
+           this.base = Optional.ofNullable(baseIRI);
            return this;
        }
 
        public Builder noBase() {
-           base = null;
-           this.baseSet = true;
+           this.base = Optional.empty();
            return this;
        }
 
@@ -173,9 +167,10 @@
        }
 
        public IRIxResolver build() {
-           if ( ! baseSet )
+           if ( base == null )
                throw new IRIException("Base has not been set");
-           return new IRIxResolver(base, resolve, allowRelative);
+           IRIx baseIRI = base.orElse(null);
+           return new IRIxResolver(baseIRI, resolve, allowRelative);
        }
    }
 }
diff --git a/jena-core/src/main/java/org/apache/jena/irix/RelativeIRIException.java b/jena-core/src/main/java/org/apache/jena/irix/RelativeIRIException.java
new file mode 100644
index 0000000..ea08fd4
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/irix/RelativeIRIException.java
@@ -0,0 +1,28 @@
+/*
+ * 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.irix;
+
+/**
+ * Exception thrown due to relative IRIs when no permitted.
+ * See {@link IRIxResolver#resolve}.
+ */
+public class RelativeIRIException extends IRIException {
+    public RelativeIRIException(String msg) { super(msg); }
+    @Override public Throwable fillInStackTrace() { return this ; }
+}
diff --git a/jena-core/src/main/java/org/apache/jena/irix/SetupJenaIRI.java b/jena-core/src/main/java/org/apache/jena/irix/SetupJenaIRI.java
index 3497e51..301bd4e 100644
--- a/jena-core/src/main/java/org/apache/jena/irix/SetupJenaIRI.java
+++ b/jena-core/src/main/java/org/apache/jena/irix/SetupJenaIRI.java
@@ -65,6 +65,9 @@
 
     /** IRI Factory with "checker" settings. */
     /*package*/ static final IRIFactory setupCheckerIRIFactory() {
+        // See IRIProviderJenaIRI.exceptions for context specific tuning.
+        // See Checker.iriViolations for filtering and output from parsers.
+
         IRIFactory iriCheckerFactory = new IRIFactory();
 
         //iriCheckerInst.shouldViolation(false,true);
@@ -81,6 +84,9 @@
 
         // -- Scheme specific rules.
         setErrorWarning(iriCheckerFactory, ViolationCodes.SCHEME_PATTERN_MATCH_FAILED, false, true);
+        // jena-iri produces an error for PROHIBITED_COMPONENT_PRESENT regardless.
+        // See Checker.iriViolations for handling this
+        //setErrorWarning(iriCheckerFactory, ViolationCodes.PROHIBITED_COMPONENT_PRESENT, false, true);
 
         // == Scheme
         setErrorWarning(iriCheckerFactory, ViolationCodes.UNREGISTERED_IANA_SCHEME, false, false);
diff --git a/jena-core/src/test/java/org/apache/jena/irix/TestIRIx.java b/jena-core/src/test/java/org/apache/jena/irix/TestIRIx.java
index fae9c44..49f7b5c 100644
--- a/jena-core/src/test/java/org/apache/jena/irix/TestIRIx.java
+++ b/jena-core/src/test/java/org/apache/jena/irix/TestIRIx.java
@@ -21,6 +21,8 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.util.Locale;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -84,6 +86,23 @@
 
     @Test public void urn_05()  { notStrict("urn", ()->parse("urn:ex:")); }
 
+    private static String testUUID = "aa045fc2-a781-11eb-9041-afa3877612ee";
+
+    @Test public void uuid_01() { parse("uuid:"+testUUID); }
+
+    @Test public void uuid_02() { parse("uuid:"+(testUUID.toUpperCase(Locale.ROOT))); }
+
+    @Test public void uuid_03() { parse("UUID:"+testUUID); }
+
+    @Test public void uuid_04() { parse("urn:uuid:"+testUUID); }
+
+    @Test public void uuid_05() { parse("urn:uuid:"+(testUUID.toUpperCase(Locale.ROOT))); }
+
+    @Test public void uuid_06() { parse("URN:UUID:"+testUUID); }
+
+    @Test(expected=IRIException.class)
+    public void uuid_07() { parse("urn:uuid:06e775ac-ZZZZ-11b2-801c-8086f2cc00c9"); }
+
     // -- Compliance with file scheme: https://tools.ietf.org/html/rfc8089
 
     @Test public void file_01() { parse("file:///path/name"); }
diff --git a/jena-core/src/test/java/org/apache/jena/irix/TestResolve.java b/jena-core/src/test/java/org/apache/jena/irix/TestResolve.java
index 63625d6..cdf670a 100644
--- a/jena-core/src/test/java/org/apache/jena/irix/TestResolve.java
+++ b/jena-core/src/test/java/org/apache/jena/irix/TestResolve.java
@@ -196,6 +196,12 @@
         testResolve("http://example/dir1/dir2/", "//EX/OtherPath", "http://EX/OtherPath");
     }
 
+    @Test
+    public void resolve_34() {
+        String uuid = "urn:uuid:e79b5752-a82e-11eb-8c4e-cba73c34870a";
+        testResolve("http://example/base#", uuid, uuid);
+    }
+
     private void testResolve(String base, String rel, String expected) {
         IRIx baseIRI = IRIx.create(base);
         IRIx relIRI = IRIx.create(rel);
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/DatabaseMgr.java b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/DatabaseMgr.java
index 54351a1..479895f 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/DatabaseMgr.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/DatabaseMgr.java
@@ -33,7 +33,7 @@
  * @see TDB2Factory
  */
 public class DatabaseMgr {
-    
+
     private DatabaseMgr() {}
 
     // All creation of DatasetGraph for TDB2 goes through this method.
@@ -55,11 +55,29 @@
      * Compact a datasets which must be a switchable TDB database.
      * This is the normal dataset type for on-disk TDB2 databases.
      *
+     * Deletes old database after successful compaction if `shouldDeleteOld` is `true`.
+     *
      * @param container
+     *
+     * @deprecated Use `compact(container, false)` instead.
      */
+    @Deprecated
     public static void compact(DatasetGraph container) {
+        compact(container, false);
+    }
+
+    /**
+     * Compact a datasets which must be a switchable TDB database.
+     * This is the normal dataset type for on-disk TDB2 databases.
+     *
+     * Deletes old database after successful compaction if `shouldDeleteOld` is `true`.
+     *
+     * @param container
+     * @param shouldDeleteOld
+     */
+    public static void compact(DatasetGraph container, boolean shouldDeleteOld) {
         DatasetGraphSwitchable dsg = requireSwitchable(container);
-        DatabaseOps.compact(dsg);
+        DatabaseOps.compact(dsg, shouldDeleteOld);
     }
 
     /**
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/sys/DatabaseOps.java b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/sys/DatabaseOps.java
index 4745d10..ad01070 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/sys/DatabaseOps.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/sys/DatabaseOps.java
@@ -20,7 +20,9 @@
 
 import java.io.*;
 import java.nio.file.*;
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Stream;
 import java.util.zip.GZIPOutputStream;
 
 import org.apache.jena.atlas.RuntimeIOException;
@@ -83,19 +85,19 @@
             return new DatasetGraphSwitchable(null, location, dsg);
         }
         // Exists?
-       if ( ! location.exists() )
-           throw new TDBException("No such location: "+location);
-       Path path = IOX.asPath(location);
-       // Scan for DBs
-       Path db = findLocation(path, dbPrefix);
-       if ( db == null ) {
-           db = path.resolve(dbPrefix+SEP+startCount);
-           IOX.createDirectory(db);
-       }
-       Location loc2 = IOX.asLocation(db);
-       DatasetGraphTDB dsg = StoreConnection.connectCreate(loc2, params).getDatasetGraphTDB();
-       DatasetGraphSwitchable appDSG = new DatasetGraphSwitchable(path, location, dsg);
-       return appDSG;
+        if ( ! location.exists() )
+            throw new TDBException("No such location: "+location);
+        Path path = IOX.asPath(location);
+        // Scan for DBs
+        Path db = findLocation(path, dbPrefix);
+        if ( db == null ) {
+            db = path.resolve(dbPrefix+SEP+startCount);
+            IOX.createDirectory(db);
+        }
+        Location loc2 = IOX.asLocation(db);
+        DatasetGraphTDB dsg = StoreConnection.connectCreate(loc2, params).getDatasetGraphTDB();
+        DatasetGraphSwitchable appDSG = new DatasetGraphSwitchable(path, location, dsg);
+        return appDSG;
     }
 
     public static String backup(DatasetGraphSwitchable container) {
@@ -107,13 +109,13 @@
 
         DatasetGraph dsg = container;
 
-//  // Per backup source lock.
-//  synchronized(activeBackups) {
-//      // Atomically check-and-set
-//      if ( activeBackups.contains(dsg) )
-//          Log.warn(Fuseki.serverLog, "Backup already in progress");
-//      activeBackups.add(dsg);
-//  }
+        //  // Per backup source lock.
+        //  synchronized(activeBackups) {
+        //      // Atomically check-and-set
+        //      if ( activeBackups.contains(dsg) )
+        //          Log.warn(Fuseki.serverLog, "Backup already in progress");
+        //      activeBackups.add(dsg);
+        //  }
 
         Pair<OutputStream, Path> x = openUniqueFileForWriting(backupDir, BACKUPS_FN, "nq.gz");
         try (OutputStream out2 = x.getLeft();
@@ -165,7 +167,16 @@
     // JVM-wide :-(
     private static Object compactionLock = new Object();
 
+
+    /**
+     * @deprecated Use `compact(container, false)` instead.
+     */
+    @Deprecated
     public static void compact(DatasetGraphSwitchable container) {
+        compact(container, false);
+    }
+
+    public static void compact(DatasetGraphSwitchable container, boolean shouldDeleteOld) {
         checkSupportsAdmin(container);
         synchronized(compactionLock) {
             Path base = container.getContainerPath();
@@ -182,7 +193,7 @@
 
             // Is this the same database location?
             if ( ! loc1.equals(loc1a) )
-                throw new TDBException("Inconsistent (not latested?) : "+loc1a+" : "+loc1);
+                throw new TDBException("Inconsistent (not latest?) : "+loc1a+" : "+loc1);
             // -- Checks
 
             // Version
@@ -195,6 +206,19 @@
             LOG.debug(String.format("Compact %s -> %s\n", db1.getFileName(), db2.getFileName()));
 
             compact(container, loc1, loc2);
+
+            if ( shouldDeleteOld ) {
+                Path loc1Path = IOX.asPath(loc1);
+                LOG.debug("Deleting old database after successful compaction (old db path='" + loc1Path + "')...");
+
+                try (Stream<Path> walk = Files.walk(loc1Path)){
+                    walk.sorted(Comparator.reverseOrder())
+                        .map(Path::toFile)
+                        .forEach(File::delete);
+                } catch (IOException ex) {
+                    throw IOX.exception(ex);
+                }
+            }
         }
     }
 
diff --git a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
index 7584d0f..72987d0 100644
--- a/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
+++ b/jena-db/jena-tdb2/src/test/java/org/apache/jena/tdb2/sys/TestDatabaseOps.java
@@ -72,7 +72,7 @@
             dsg.add(quad2);
             dsg.add(quad1);
         });
-        DatabaseMgr.compact(dsg);
+        DatabaseMgr.compact(dsg, false);
 
         assertFalse(StoreConnection.isSetup(loc1));
 
@@ -108,7 +108,7 @@
             dsg.add(quad2);
             dsg.add(quad1);
         });
-        DatabaseMgr.compact(dsg);
+        DatabaseMgr.compact(dsg, false);
         Txn.executeRead(dsg, ()-> {
             assertEquals(2, g.size());
             assertTrue(g.contains(triple2));
@@ -143,9 +143,9 @@
             compact_prefixes_3_test();
         } catch (NullPointerException ex) {
             ex.printStackTrace();
-//            StackTraceElement[] x = ex.getStackTrace();
-//            if ( x.length >= 0 && "java.nio.file.Files".equals(x[0].getClassName()) )
-//               return ;
+            //            StackTraceElement[] x = ex.getStackTrace();
+            //            if ( x.length >= 0 && "java.nio.file.Files".equals(x[0].getClassName()) )
+            //               return ;
             throw ex;
         }
     }
@@ -162,6 +162,7 @@
         });
 
         DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
+        assertNotNull("DatasetGraphSwitchable created", dsgs.getLocation());
         DatasetGraph dsg1 = dsgs.get();
         Location loc1 = ((DatasetGraphTDB)dsg1).getLocation();
 
@@ -169,7 +170,7 @@
         int x1 = Txn.calculateRead(dsg, ()->dsg.prefixes().size());
         assertTrue("Prefxies count", x1 > 0);
 
-        DatabaseMgr.compact(dsgs); // HERE
+        DatabaseMgr.compact(dsgs, false); // HERE
 
         // After
         int x2 = Txn.calculateRead(dsg, ()->dsg.prefixes().size());
@@ -193,6 +194,35 @@
         Txn.executeRead(dsgOld,  ()->assertNull(dsgOld.getDefaultGraph().getPrefixMapping().getNsPrefixURI("ex")));
     }
 
+    @Test public void compact_delete() {
+        DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(dir);
+        DatasetGraphSwitchable dsgs = (DatasetGraphSwitchable)dsg;
+        DatasetGraph dsg1 = dsgs.get();
+        Location loc1 = ((DatasetGraphTDB)dsg1).getLocation();
+
+        Txn.executeWrite(dsg, ()-> {
+            dsg.add(quad2);
+            dsg.add(quad1);
+        });
+        DatabaseMgr.compact(dsg, true);
+
+        assertFalse(IOX.asFile(loc1).exists());
+
+        DatasetGraph dsg2 = dsgs.get();
+        Location loc2 = ((DatasetGraphTDB)dsg2).getLocation();
+
+        assertNotEquals(dsg1, dsg2);
+        assertNotEquals(loc1, loc2);
+
+        Txn.executeRead(dsg, ()-> {
+            assertTrue(dsg.contains(quad2));
+            assertTrue(dsg.contains(quad1));
+        });
+
+        Txn.executeRead(dsg,  ()->assertTrue(dsg.contains(quad2)) );
+        Txn.executeRead(dsg2, ()->assertTrue(dsg2.contains(quad2)) );
+    }
+
     @Test public void backup_1() {
         DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(dir);
         Txn.executeWrite(dsg, ()-> {
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/ctl/ActionCompact.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/ctl/ActionCompact.java
index c84b91e..a7234ca 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/ctl/ActionCompact.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/ctl/ActionCompact.java
@@ -88,10 +88,17 @@
     }
 
     static class CompactTask extends TaskBase {
-        static private Logger log = Fuseki.compactLog;
+        static private final Logger log = Fuseki.compactLog;
+
+        private final boolean shouldDeleteOld;
 
         public CompactTask(HttpAction action) {
             super(action);
+
+            String deleteOldParam = action.request.getParameter("deleteOld");
+
+            this.shouldDeleteOld = ( deleteOldParam != null
+                                     && ( deleteOldParam.isEmpty() || deleteOldParam.equalsIgnoreCase("true") ) );
         }
 
         @Override
@@ -99,7 +106,7 @@
             try {
                 DatasetGraph dsg = getTDB2(dataset);
                 log.info(format("[%d] >>>> Start compact %s", actionId, datasetName));
-                DatabaseMgr.compact(dsg);
+                DatabaseMgr.compact(dsg, this.shouldDeleteOld);
                 log.info(format("[%d] <<<< Finish compact %s", actionId, datasetName));
             } catch (Throwable ex) {
                 log.warn(format("[%d] **** Exception in compact", actionId), ex);
diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java
index c2e7446..2932eac 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java
@@ -32,6 +32,7 @@
 import org.apache.jena.atlas.lib.StrUtils;
 import org.apache.jena.atlas.web.TypedInputStream;
 import org.apache.jena.atlas.web.WebLib;
+import org.apache.jena.base.Sys;
 import org.apache.jena.graph.Graph;
 import org.apache.jena.query.QueryExecution;
 import org.apache.jena.rdfconnection.RDFConnection;
@@ -246,16 +247,51 @@
             assertNotNull(x2);
             String x3 = HttpOp.execHttpGetString("http://localhost:"+port+"/$/metrics");
             assertNotNull(x3);
-            String x4 = HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks");
-            assertNotNull(x4);
-            try(TypedInputStream x5 = HttpOp.execHttpPostStream("http://localhost:"+port+"/$/compact/ds", null, "application/json")) {
-                assertNotNull(x5);
-                assertNotEquals(0, x5.readAllBytes().length);
+        } finally {
+            server.stop();
+        }
+    }
+
+    @Test public void serverTDB2_compact0() {
+        int port = WebLib.choosePort();
+        FusekiServer server = server(port, "server-tdb2_compact0.ttl");
+        server.start();
+        try {
+            String x1= HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks");
+            assertNotNull(x1);
+            try(TypedInputStream x2 = HttpOp.execHttpPostStream("http://localhost:"+port+"/$/compact/ds", null, "application/json")) {
+                assertNotNull(x2);
+                assertNotEquals(0, x2.readAllBytes().length);
             } catch (IOException ex) {
                 IO.exception(ex);
             }
-            String x6 = HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks/1");
-            assertNotNull(x6);
+            String x3 = HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks/1");
+            assertNotNull(x3);
+        } finally {
+            server.stop();
+        }
+    }
+
+    @Test public void serverTDB2_compact1() {
+        if ( Sys.isWindows ) {
+            // NOTE: Skipping deletion test for windows
+            return;
+        }
+
+        int port = WebLib.choosePort();
+        FusekiServer server = server(port, "server-tdb2_compact1.ttl");
+        server.start();
+        try {
+            String x1= HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks");
+            assertNotNull(x1);
+            try(TypedInputStream x2 = HttpOp.execHttpPostStream("http://localhost:"+port+"/$/compact/ds?deleteOld", null, "application/json")) {
+                assertNotNull(x2);
+                assertNotEquals(0, x2.readAllBytes().length);
+            } catch (IOException ex) {
+                IO.exception(ex);
+            }
+            String x3 = HttpOp.execHttpGetString("http://localhost:"+port+"/$/tasks/1");
+            assertNotNull(x3);
         } finally {
             server.stop();
         }
diff --git a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiMainCmd.java b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiMainCmd.java
index 1ced4fa..f292a6e 100644
--- a/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiMainCmd.java
+++ b/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiMainCmd.java
@@ -96,10 +96,10 @@
     }
 
     @Test public void compact_01() throws IOException {
-        String DB_DIR = DATABASES+"/DB-compact";
+        String DB_DIR = DATABASES+"/DB-compact1";
         FileOps.ensureDir(DB_DIR);
         FileOps.clearAll(DB_DIR);
-        server("--loc="+DATABASES+"/DB-compact", "--tdb2", "--compact", "/ds");
+        server("--loc="+DATABASES+"/DB-compact1", "--tdb2", "--compact", "/ds");
         try(TypedInputStream x0 = HttpOp.execHttpPostStream(serverURL+"/$/compact/ds", null, "application/json")) {
             assertNotNull(x0);
             assertNotEquals(0, x0.readAllBytes().length);
@@ -110,4 +110,18 @@
         JSON.parseAny(x1);
         // Leaves "DB-compact" behind.
     }
+
+    @Test public void compact_02() throws IOException {
+        String DB_DIR = DATABASES+"/DB-compact2";
+        FileOps.ensureDir(DB_DIR);
+        FileOps.clearAll(DB_DIR);
+        server("--loc="+DATABASES+"/DB-compact2", "--tdb2", "--compact", "/ds");
+        try(TypedInputStream x0 = HttpOp.execHttpPostStream(serverURL+"/$/compact/ds?deleteOld", null, "application/json")) {
+            assertNotNull(x0);
+            assertNotEquals(0, x0.readAllBytes().length);
+        }
+        String x1 = HttpOp.execHttpGetString(serverURL+"/$/tasks");
+        assertNotNull(x1);
+        // Leaves "DB-compact" behind.
+    }
 }
diff --git a/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2.ttl b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2.ttl
index 18a873a..20afd12 100644
--- a/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2.ttl
+++ b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2.ttl
@@ -13,7 +13,6 @@
    fuseki:pingEP     true ;
    fuseki:statsEP    true ;
    fuseki:metricsEP  true ;
-   fuseki:compactEP  true ;
 .
 
 <#service1> rdf:type fuseki:Service ;
diff --git a/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact0.ttl b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact0.ttl
new file mode 100644
index 0000000..1de24ac
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact0.ttl
@@ -0,0 +1,27 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX :        <#>
+PREFIX fuseki:  <http://jena.apache.org/fuseki#>
+PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
+PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
+
+[] rdf:type fuseki:Server ;
+   fuseki:services   ( <#service1> ) ;
+   fuseki:compactEP  true ;
+.
+
+<#service1> rdf:type fuseki:Service ;
+    fuseki:name         "ds" ;
+    fuseki:endpoint     [
+       fuseki:operation  fuseki:query;
+       fuseki:name       "" ;
+    ] ;
+    fuseki:dataset      <#emptyDataset> ;
+.
+
+<#emptyDataset> rdf:type tdb2:DatasetTDB ;
+    tdb2:location "target/Databases/DB-serverTDB2_compact0" ;
+.
diff --git a/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact1.ttl b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact1.ttl
new file mode 100644
index 0000000..9e8a40b
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-main/testing/Config/server-tdb2_compact1.ttl
@@ -0,0 +1,27 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+PREFIX :        <#>
+PREFIX fuseki:  <http://jena.apache.org/fuseki#>
+PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+
+PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
+PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
+
+[] rdf:type fuseki:Server ;
+   fuseki:services   ( <#service1> ) ;
+   fuseki:compactEP  true ;
+.
+
+<#service1> rdf:type fuseki:Service ;
+    fuseki:name         "ds" ;
+    fuseki:endpoint     [
+       fuseki:operation  fuseki:query;
+       fuseki:name       "" ;
+    ] ;
+    fuseki:dataset      <#emptyDataset> ;
+.
+
+<#emptyDataset> rdf:type tdb2:DatasetTDB ;
+    tdb2:location "target/Databases/DB-serverTDB2_compact1" ;
+.
diff --git a/jena-fuseki2/jena-fuseki-webapp/src/test/resources/log4j2.properties b/jena-fuseki2/jena-fuseki-webapp/src/test/resources/log4j2.properties
index 41cfb2d..7538a8c 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/test/resources/log4j2.properties
+++ b/jena-fuseki2/jena-fuseki-webapp/src/test/resources/log4j2.properties
@@ -41,6 +41,9 @@
 logger.fuseki-admin.name  = org.apache.jena.fuseki.Admin
 logger.fuseki-admin.level = WARN
 
+logger.fuseki-config.name  = org.apache.jena.fuseki.Config
+logger.fuseki-config.level = WARN
+
 logger.jetty.name  = org.eclipse.jetty
 logger.jetty.level = WARN