jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [36/50] [abbrv] jena git commit: JENA-1396: Merge //github/afs/mantis as subdirectory jena-db/
Date Thu, 28 Sep 2017 11:08:52 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/pom.xml
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/pom.xml
index 0000000,0000000..d55b4c8
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/pom.xml
@@@ -1,0 -1,0 +1,122 @@@
++<?xml version="1.0" encoding="utf-8"?>
++<!--
++   Licensed 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.
++ 
++   See the NOTICE file distributed with this work for additional
++   information regarding copyright ownership.
++-->
++
++<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
++
++  <modelVersion>4.0.0</modelVersion>
++
++  <artifactId>tdb2-cmds</artifactId>
++  <packaging>jar</packaging>
++  <name>Mantis (${project.artifactId})</name>
++
++  <parent>
++    <groupId>org.seaborne.mantis</groupId>
++    <artifactId>mantis</artifactId>
++    <version>0.3.1-SNAPSHOT</version>
++  </parent> 
++
++  <dependencies>
++
++    <dependency>
++      <groupId>org.seaborne.mantis</groupId>
++      <artifactId>tdb2</artifactId>
++      <version>0.3.1-SNAPSHOT</version>
++    </dependency>
++
++    <dependency>
++      <groupId>org.apache.jena</groupId>
++      <artifactId>jena-cmds</artifactId>
++      <exclusions>
++        <exclusion>
++           <groupId>org.apache.jena</groupId>
++           <artifactId>jena-tdb</artifactId>
++        </exclusion>
++      </exclusions>
++    </dependency>
++
++    <!-- Require a logging implementation -->
++    <dependency>
++      <groupId>org.slf4j</groupId>
++      <artifactId>slf4j-log4j12</artifactId>
++    </dependency>
++    
++   <dependency>
++     <groupId>log4j</groupId>
++     <artifactId>log4j</artifactId>
++   </dependency> 
++
++  </dependencies>
++
++  <build>
++    <plugins>
++      <plugin>
++        <groupId>org.apache.maven.plugins</groupId>
++        <artifactId>maven-source-plugin</artifactId>
++        <executions>
++          <execution>
++            <id>attach-sources</id>
++            <!-- <phase>package</phase> package is the default -->
++            <goals>
++              <goal>jar-no-fork</goal>
++            </goals>
++          </execution>
++        </executions>
++      </plugin>
++
++      <plugin>
++        <groupId>org.apache.maven.plugins</groupId>
++        <artifactId>maven-shade-plugin</artifactId>
++        <version>2.4.3</version>
++        <configuration>
++          <shadedArtifactAttached>false</shadedArtifactAttached>
++          <transformers>
++            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
++              <mainClass>tdb2.Intro</mainClass>
++            </transformer>
++            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
++            <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
++            <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
++              <addHeader>false</addHeader>
++            </transformer>
++          </transformers>
++          <filters>
++            <filter>
++              <artifact>*:*</artifact>
++              <excludes>
++                <exclude>META-INF/*.SF</exclude>
++                <exclude>META-INF/*.DSA</exclude>
++                <exclude>META-INF/*.RSA</exclude>
++              </excludes>
++            </filter>
++          </filters>
++        </configuration>
++        <executions>
++          <execution>
++            <phase>package</phase>
++            <!--<phase /><!- - Switch off -->
++            <goals>
++              <goal>shade</goal>
++            </goals>
++          </execution>
++        </executions>
++      </plugin>
++
++    </plugins>
++  </build>
++  
++</project>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/Intro.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/Intro.java
index 0000000,0000000..f8fd6e0
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/Intro.java
@@@ -1,0 -1,0 +1,31 @@@
++/*
++ * 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 tdb2;
++
++public class Intro {
++    public static void main(String...a) {
++        System.err.println("Commands available:");
++        System.err.println("  tdb2.tdbloader");
++        System.err.println("  tdb2.tdbquery");
++        System.err.println("  tdb2.tdbupdate");
++        System.err.println("  tdb2.tdbdump");
++        System.err.println("  tdb2.tdbstats");
++        
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdSub.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdSub.java
index 0000000,0000000..bda20c5
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdSub.java
@@@ -1,0 -1,0 +1,71 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import java.util.Collection;
++import java.util.HashMap;
++import java.util.Map;
++
++import jena.cmd.CmdException;
++
++public class CmdSub {
++    public interface Exec {
++        public void exec(String[] argv) ;
++    }
++    private Map<String, Exec> dispatch = new HashMap<>() ;
++
++    private String    subCmd ;
++    private String    args[] ;
++
++    public CmdSub(String... argv) {
++        subCmd = subCommand(argv) ;
++        args = cmdline(argv) ;
++    }
++
++    protected void exec() {
++        Exec exec = dispatch.get(subCmd) ;
++        if ( exec == null )
++            throw new CmdException("No subcommand: " + subCmd) ;
++        exec.exec(args) ;
++    }
++
++    protected static String[] cmdline(String... argv) {
++        String[] a = new String[argv.length - 1] ;
++        System.arraycopy(argv, 1, a, 0, argv.length - 1) ;
++        return a ;
++    }
++
++    protected static String subCommand(String... argv) {
++        if ( argv.length == 0 )
++            throw new CmdException("Missing subcommand") ;
++
++        String subCmd = argv[0] ;
++        if ( subCmd.startsWith("-") )
++            throw new CmdException("Argument found where subcommand expected") ;
++        return subCmd ;
++    }
++
++    protected void addSubCommand(String subCmdName, Exec exec) {
++        dispatch.put(subCmdName, exec) ;
++    }
++
++    protected Collection<String> subCommandNames() {
++        return dispatch.keySet() ;
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDB.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDB.java
index 0000000,0000000..da799fd
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDB.java
@@@ -1,0 -1,0 +1,84 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import arq.cmdline.CmdARQ ;
++import org.apache.jena.Jena ;
++import org.apache.jena.atlas.lib.Lib ;
++import org.apache.jena.atlas.logging.LogCtl ;
++import org.apache.jena.query.ARQ ;
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.sparql.core.DatasetGraph ;
++import org.apache.jena.system.JenaSystem ;
++import org.seaborne.dboe.base.file.Location;
++import org.seaborne.tdb2.TDB2;
++import org.seaborne.tdb2.store.DatasetGraphSwitchable ;
++import org.seaborne.tdb2.sys.TDBInternal ;
++
++public abstract class CmdTDB extends CmdARQ
++{
++    protected final ModTDBDataset tdbDatasetAssembler   = new ModTDBDataset() ;
++
++    private static boolean initialized = false ;
++    
++    protected CmdTDB(String[] argv) {
++        super(argv) ;
++        init() ;
++        super.addModule(tdbDatasetAssembler) ;
++        super.modVersion.addClass(Jena.class) ;
++        super.modVersion.addClass(ARQ.class) ;
++        super.modVersion.addClass(TDB2.class) ;
++    }
++
++    public static synchronized void init() {
++        // In case called from elsewhere.
++        JenaSystem.init() ;
++        if (initialized)
++            return ;
++        // attempt once.
++        initialized = true ;
++        LogCtl.setCmdLogging() ;
++    }
++
++    @Override
++    protected void processModulesAndArgs() {
++        super.processModulesAndArgs() ;
++    }
++
++    protected Location getLocation() {
++        return tdbDatasetAssembler.getLocation() ;
++    }
++
++    protected DatasetGraph getDatasetGraph() {
++        return getDataset().asDatasetGraph() ;
++    }
++
++    protected DatasetGraphSwitchable getDatabaseContainer() {
++        return TDBInternal.getDatabaseContainer(getDatasetGraph());
++    }
++
++    protected Dataset getDataset() {
++        return tdbDatasetAssembler.getDataset() ;
++    }
++
++    @Override
++    protected String getCommandName() {
++        return Lib.className(this) ;
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDBGraph.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDBGraph.java
index 0000000,0000000..60b7982
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/CmdTDBGraph.java
@@@ -1,0 -1,0 +1,81 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++package tdb2.cmdline;
++
++import jena.cmd.ArgDecl;
++import jena.cmd.CmdException;
++import org.apache.jena.atlas.lib.Lib ;
++import org.apache.jena.graph.Node ;
++import org.apache.jena.graph.NodeFactory ;
++import org.apache.jena.query.Dataset ;
++import org.apache.jena.rdf.model.Model ;
++import org.seaborne.tdb2.store.GraphTDB;
++import tdb2.cmdline.CmdTDB;
++
++public abstract class CmdTDBGraph extends CmdTDB
++{
++    private static final ArgDecl argNamedGraph          = new ArgDecl(ArgDecl.HasValue, "graph") ;
++    protected String graphName = null ;
++    
++    protected CmdTDBGraph(String[] argv)
++    {
++        super(argv) ;
++        super.add(argNamedGraph, "--graph=IRI", "Act on a named graph") ;
++    }
++    
++    @Override
++    protected void processModulesAndArgs()
++    {
++        super.processModulesAndArgs() ;
++        if ( contains(argNamedGraph) )
++            graphName = getValue(argNamedGraph) ; 
++    }
++    
++    protected Model getModel()
++    {
++        Dataset ds = tdbDatasetAssembler.getDataset() ;
++        
++        if ( graphName != null )
++        {
++            Model m = ds.getNamedModel(graphName) ;
++            if ( m == null )
++                throw new CmdException("No such named graph (is this a TDB dataset?)") ;
++            return m ;
++        }
++        else
++            return ds.getDefaultModel() ;
++    }
++    
++    public Node getGraphName()  { return graphName == null ? null : NodeFactory.createURI(graphName) ; } 
++    
++    protected GraphTDB getGraph()
++    {
++        if ( graphName != null )
++            return (GraphTDB)tdbDatasetAssembler.getDataset().getNamedModel(graphName).getGraph() ;
++        else
++            return (GraphTDB)tdbDatasetAssembler.getDataset().getDefaultModel().getGraph() ;
++    }
++    
++    @Override
++    protected String getCommandName()
++    {
++        return Lib.className(this) ;
++    }
++    
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModLocation.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModLocation.java
index 0000000,0000000..1d6b37a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModLocation.java
@@@ -1,0 -1,0 +1,55 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import jena.cmd.ArgDecl;
++import jena.cmd.CmdArgModule;
++import jena.cmd.CmdGeneral;
++import jena.cmd.ModBase;
++import org.seaborne.dboe.base.file.Location;
++
++public class ModLocation extends ModBase
++{
++    public ModLocation() {}
++    
++    protected final ArgDecl locationDecl = new ArgDecl(ArgDecl.HasValue, "location", "loc") ;
++    protected Location location = null ;
++    
++    @Override
++    public void registerWith(CmdGeneral cmdLine)
++    {
++        cmdLine.getUsage().startCategory("Location") ;
++        cmdLine.add(locationDecl, "--loc=DIR", "Location (a directory)") ;
++    }
++    
++    public void checkCommandLine(CmdArgModule cmdLine)
++    {}
++
++    @Override
++    public void processArgs(CmdArgModule cmdLine)
++    {
++        if ( cmdLine.contains(locationDecl) )
++        {
++            String dir = cmdLine.getValue(locationDecl) ;
++            location = Location.create(dir) ;
++        }
++    }
++    
++    public Location getLocation() { return location ; }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModModel.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModModel.java
index 0000000,0000000..eca9612
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModModel.java
@@@ -1,0 -1,0 +1,66 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import jena.cmd.ArgDecl;
++import jena.cmd.CmdArgModule;
++import jena.cmd.CmdGeneral;
++import jena.cmd.ModBase;
++
++import org.apache.jena.rdf.model.Model ;
++import org.apache.jena.util.FileManager ;
++
++/** Name a model */
++public class ModModel extends ModBase
++{
++    protected ArgDecl modelArgDecl = null ;
++    private Model model = null ;
++    
++    //public ModModel() { this("model") ; }
++    public ModModel(String argName, String ... altNames)
++    {
++        modelArgDecl = new ArgDecl(ArgDecl.HasValue, argName) ;
++        for ( String x : altNames )
++            modelArgDecl.addName(x) ;
++    }
++
++    public ArgDecl getArg() 
++    {
++        return modelArgDecl ;
++    }
++    
++    @Override
++    public void registerWith(CmdGeneral cmdLine)
++    {
++        cmdLine.add(modelArgDecl, "--"+modelArgDecl.getKeyName()+"=filename", "Filename for a model") ;
++    }
++
++    @Override
++    public void processArgs(CmdArgModule cmdLine)
++    {
++        if ( cmdLine.contains(modelArgDecl) )
++        {
++            String filename = cmdLine.getValue(modelArgDecl) ;
++            model = FileManager.get().loadModel(filename) ;
++        }
++    }
++    
++    public Model getModel() { return model ; }
++    
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBAssembler.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBAssembler.java
index 0000000,0000000..6fbb345
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBAssembler.java
@@@ -1,0 -1,0 +1,89 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import java.io.File;
++
++import jena.cmd.CmdArgModule;
++import jena.cmd.CmdException;
++import jena.cmd.CmdGeneral;
++import org.seaborne.dboe.base.file.Location;
++import tdb2.cmdline.ModLocation;
++import arq.cmdline.ModAssembler;
++
++/**  Extends ModAssembler to include --tdb.
++ *   Defaulting to "tdb.ttl" is done in ModTDBDataset because it interacts
++ *   with --location
++ */  
++public class ModTDBAssembler extends ModAssembler
++{
++    private ModLocation modLocation     =  new ModLocation() ;
++
++    public static final String defaultAssemblerFile = "tdb.ttl" ;
++    protected boolean useDefaultAssemblerFile = false ;
++    
++    public ModTDBAssembler()
++    { 
++        super() ;
++        ModAssembler.assemblerDescDecl.addName("tdb") ;
++    }
++    
++    @Override
++    public void processArgs(CmdArgModule cmdLine)
++    {
++        int count = 0 ;
++
++        modLocation.processArgs(cmdLine) ;
++        super.processArgs(cmdLine) ;
++        if ( super.getAssemblerFile() != null ) count++ ;
++        if ( modLocation.getLocation() != null ) count++ ;    
++        
++        if ( count == 0 )
++        {
++            useDefaultAssemblerFile = true ;
++            // throw new CmdException("No assembler file and no location") ;
++        }
++            
++        if ( count > 1 )
++            throw new CmdException("Only one of an assembler file and a location") ;
++    }
++   
++    @Override
++    public void registerWith(CmdGeneral cmdLine)
++    {
++        super.registerWith(cmdLine) ;
++        cmdLine.addModule(modLocation) ;
++        //cmdLine.getUsage().startCategory("Dataset") ;
++        cmdLine.getUsage().addUsage("--tdb=", "Assembler description file") ;
++    }
++ 
++    public Location getLocation() { return modLocation.getLocation() ; }
++    
++    @Override
++    public String getAssemblerFile()
++    {
++        if ( useDefaultAssemblerFile )
++        {
++            File f = new File(defaultAssemblerFile) ;
++            if ( f.exists() )
++                return defaultAssemblerFile ; 
++        }
++        return super.getAssemblerFile() ;
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBDataset.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBDataset.java
index 0000000,0000000..199268a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/cmdline/ModTDBDataset.java
@@@ -1,0 -1,0 +1,138 @@@
++/*
++ * 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 tdb2.cmdline;
++
++import java.util.ArrayList ;
++import java.util.List ;
++
++import arq.cmdline.ModDataset ;
++import jena.cmd.ArgDecl;
++import jena.cmd.CmdArgModule;
++import jena.cmd.CmdException;
++import jena.cmd.CmdGeneral;
++import org.apache.jena.atlas.logging.Log ;
++import org.apache.jena.query.* ;
++import org.apache.jena.rdf.model.Model ;
++import org.apache.jena.riot.RDFDataMgr ;
++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.util.FileManager ;
++import org.seaborne.dboe.base.file.Location;
++import org.seaborne.tdb2.TDB2Factory;
++import org.seaborne.tdb2.assembler.VocabTDB2;
++import org.seaborne.tdb2.store.DatasetGraphTDB;
++
++public class ModTDBDataset extends ModDataset
++{
++    // Mixes assembler, location and "tdb"
++    // Can make a single model or a dataset
++    
++    private ArgDecl argMem                  = new ArgDecl(ArgDecl.HasValue, "mem", "data") ;
++    private ModTDBAssembler modAssembler    = new ModTDBAssembler() ;
++    private String inMemFile                = null ;
++    
++    public ModTDBDataset() {}
++    
++    @Override
++    public void registerWith(CmdGeneral cmdLine)
++    {
++        cmdLine.add(argMem, "--mem=FILE", "Execute on an in-memory TDB database (for testing)") ;
++        cmdLine.addModule(modAssembler) ;
++    }
++
++    @Override
++    public void processArgs(CmdArgModule cmdLine)
++    {
++        inMemFile = cmdLine.getValue(argMem) ;
++        modAssembler.processArgs(cmdLine) ;
++    }        
++
++    @Override
++    public Dataset createDataset() {
++        if ( inMemFile != null ) {
++            Dataset ds = TDB2Factory.createDataset();
++            RDFDataMgr.read(ds, inMemFile);
++            return ds;
++        }
++
++        if ( modAssembler.getAssemblerFile() != null ) {
++            Dataset thing = null;
++            // Two variants: plain dataset with TDB2 dataset or plain building
++            // (which may go wrong later if TDB2 directly is needed).
++            try {
++                thing = (Dataset)AssemblerUtils.build(modAssembler.getAssemblerFile(), VocabTDB2.tDatasetTDB);
++                if ( thing != null && !(thing.asDatasetGraph() instanceof DatasetGraphTDB) )
++                    Log.warn(this, "Unexpected: Not a TDB2 dataset for type DatasetTDB2");
++
++                if ( thing == null )
++                    // Should use assembler inheritance but how do we assert
++                    // the subclass relationship in a program?
++                    thing = (Dataset)AssemblerUtils.build(modAssembler.getAssemblerFile(), DatasetAssemblerVocab.tDataset);
++            }
++            catch (JenaException ex) {
++                throw ex;
++            }
++            catch (Exception ex) {
++                throw new CmdException("Error creating", ex);
++            }
++            return thing;
++        }
++
++        if ( modAssembler.getLocation() == null )
++            throw new CmdException("No assembler file nor location provided");
++
++        // No assembler - use location to find a database.
++        Dataset ds = TDB2Factory.connectDataset(modAssembler.getLocation());
++        return ds;
++    }
++    
++    public Location getLocation()
++    {
++        List<String> x = locations() ;
++        if ( x.size() == 0 )
++            return null ;
++        return Location.create(x.get(0)) ;
++    }
++    
++    public List<String> locations()
++    {
++        List<String> locations = new ArrayList<>() ;
++        
++        if ( modAssembler.getLocation() != null )
++            locations.add(modAssembler.getLocation().getDirectoryPath()) ;
++
++        // Extract the location from the assember file.
++        if ( modAssembler.getAssemblerFile() != null )
++        {
++            // Find and clear all locations
++            Model m = FileManager.get().loadModel(modAssembler.getAssemblerFile()) ;
++            Query query = QueryFactory.create("PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#> SELECT ?dir { [] tdb:location ?dir FILTER (isURI(?dir)) }") ;
++            try(QueryExecution qExec = QueryExecutionFactory.create(query, m)) {
++                for (ResultSet rs = qExec.execSelect() ; rs.hasNext() ; )
++                {
++                    String x = rs.nextSolution().getResource("dir").getURI() ;
++                    locations.add(x) ;
++                }
++            }
++        }
++        
++        return locations ;
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbbackup.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbbackup.java
index 0000000,0000000..8291514
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbbackup.java
@@@ -1,0 -1,0 +1,55 @@@
++/*
++ * 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 tdb2;
++
++import arq.cmdline.ModLangOutput ;
++import org.seaborne.tdb2.store.DatasetGraphSwitchable ;
++import org.seaborne.tdb2.sys.DatabaseOps ;
++import tdb2.cmdline.CmdTDB;
++
++public class tdbbackup extends CmdTDB
++{
++    static ModLangOutput modLangOutput = new ModLangOutput() ;
++    
++    static public void main(String... argv)
++    { 
++        CmdTDB.init() ;
++        new tdbbackup(argv).mainRun() ;
++    }
++
++    protected tdbbackup(String[] argv)
++    {
++        super(argv) ;
++        addModule(modLangOutput) ;
++    }
++    
++    @Override
++    protected String getSummary()
++    {
++        return getCommandName()+" : Backup a TDB dataset" ;
++    }
++
++    @Override
++    protected void exec()
++    {
++        DatasetGraphSwitchable dsg = getDatabaseContainer();
++        String fn = DatabaseOps.backup(dsg);
++        System.out.println("Backup written to "+fn);
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbcompact.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbcompact.java
index 0000000,0000000..ea2e275
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbcompact.java
@@@ -1,0 -1,0 +1,48 @@@
++/*
++ * 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 tdb2;
++
++import org.seaborne.tdb2.store.DatasetGraphSwitchable ;
++import org.seaborne.tdb2.sys.DatabaseOps ;
++import tdb2.cmdline.CmdTDB;
++
++public class tdbcompact extends CmdTDB {
++    static public void main(String... argv) {
++        CmdTDB.init() ;
++        new tdbcompact(argv).mainRun() ;
++    }
++
++    protected tdbcompact(String[] argv) {
++        super(argv) ;
++    }
++
++    @Override
++    protected String getSummary() {
++        return getCommandName() + " : Compact a TDB2 dataset" ;
++    }
++
++    @Override
++    protected void exec() {
++        DatasetGraphSwitchable dsg = getDatabaseContainer() ;
++        long start = System.currentTimeMillis();
++        DatabaseOps.compact(dsg) ;
++        long finish = System.currentTimeMillis();
++        System.out.printf("Compacted in %.3fs", (finish-start)/1000.0);
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbdump.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbdump.java
index 0000000,0000000..9c50e87
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbdump.java
@@@ -1,0 -1,0 +1,66 @@@
++/*
++ * 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 tdb2;
++
++import arq.cmdline.ModLangOutput ;
++import jena.cmd.CmdException ;
++import org.apache.jena.riot.RDFDataMgr ;
++import org.apache.jena.riot.RDFFormat ;
++import org.apache.jena.riot.RDFLanguages ;
++import org.apache.jena.sparql.core.DatasetGraph ;
++import org.seaborne.dboe.jenax.Txn;
++import tdb2.cmdline.CmdTDB;
++
++public class tdbdump extends CmdTDB
++{
++    static ModLangOutput modLangOutput = new ModLangOutput() ;
++    
++    static public void main(String... argv) {
++        CmdTDB.init() ;
++        new tdbdump(argv).mainRun() ;
++    }
++
++    protected tdbdump(String[] argv) {
++        super(argv) ;
++        addModule(modLangOutput) ;
++    }
++
++    @Override
++    protected String getSummary() {
++        return getCommandName() + " : Write a dataset to stdout (defaults to N-Quads)" ;
++    }
++
++    @Override
++    protected void exec() {
++        DatasetGraph dsg = getDatasetGraph() ;
++        // Prefer stream over fully pretty output formats.
++        RDFFormat fmt = modLangOutput.getOutputStreamFormat() ;
++        // Stream writing happens naturally - no need to call StreamRDFWriter.
++        //if ( fmt != null && StreamRDFWriter.registered(fmt) )
++        if ( fmt == null )
++            fmt = modLangOutput.getOutputFormatted() ;
++        if ( fmt == null )
++            // Default.
++            fmt = RDFFormat.NQUADS ;
++        if ( ! RDFLanguages.isQuads(fmt.getLang() ))
++            throw new CmdException("Databases can be dumped only in quad formats (e.g. Trig, N-Quads), not "+fmt.getLang()) ;
++        RDFFormat fmtFinal = fmt ;
++        Txn.executeRead(dsg, ()->RDFDataMgr.write(System.out, dsg, fmtFinal));
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbloader.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbloader.java
index 0000000,0000000..f31cb70
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbloader.java
@@@ -1,0 -1,0 +1,175 @@@
++/*
++ * 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 tdb2 ;
++
++import java.util.List ;
++
++import jena.cmd.ArgDecl;
++import jena.cmd.CmdException;
++import org.apache.jena.atlas.lib.FileOps;
++import org.apache.jena.atlas.lib.NotImplemented;
++import org.apache.jena.atlas.lib.ProgressMonitor;
++import org.apache.jena.graph.Graph;
++import org.apache.jena.query.ARQ ;
++import org.apache.jena.riot.Lang ;
++import org.apache.jena.riot.RDFDataMgr;
++import org.apache.jena.riot.RDFLanguages ;
++import org.apache.jena.riot.system.ProgressStreamRDF;
++import org.apache.jena.riot.system.StreamRDF;
++import org.apache.jena.riot.system.StreamRDFLib;
++import org.apache.jena.sparql.core.DatasetGraph;
++import org.apache.jena.system.Txn;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import tdb2.cmdline.CmdTDB;
++import tdb2.cmdline.CmdTDBGraph;
++
++public class tdbloader extends CmdTDBGraph {
++    // private static final ArgDecl argParallel = new ArgDecl(ArgDecl.NoValue, "parallel") ;
++    // private static final ArgDecl argIncremental = new ArgDecl(ArgDecl.NoValue, "incr", "incremental") ;
++    private static final ArgDecl argNoStats = new ArgDecl(ArgDecl.NoValue, "nostats") ;
++    private static final ArgDecl argStats = new ArgDecl(ArgDecl.HasValue,  "stats") ;
++
++    private boolean showProgress  = true ;
++    private boolean generateStats  = true ;
++
++    static public void main(String... argv) {
++        CmdTDB.init() ;
++        new tdbloader(argv).mainRun() ;
++    }
++
++    protected tdbloader(String[] argv) {
++        super(argv) ;
++        super.add(argNoStats, "--nostats", "Switch off statistics gathering") ;
++        super.add(argStats) ;   // Hidden argument
++    }
++
++    @Override
++    protected void processModulesAndArgs() {
++        super.processModulesAndArgs() ;
++    }
++
++    @Override
++    protected String getSummary() {
++        return getCommandName() + " [--desc DATASET | -loc DIR] FILE ..." ;
++    }
++
++    @Override
++    protected void exec() {
++        if ( isVerbose() ) {
++            System.out.println("Java maximum memory: " + Runtime.getRuntime().maxMemory()) ;
++            System.out.println(ARQ.getContext()) ;
++        }
++        if ( isVerbose() )
++            showProgress = true ;
++        if ( isQuiet() )
++            showProgress = false ;
++        if ( super.contains(argStats) ) {
++            if ( ! hasValueOfTrue(argStats) && ! hasValueOfFalse(argStats) )
++                throw new CmdException("Not a boolean value: "+getValue(argStats)) ;
++            generateStats = super.hasValueOfTrue(argStats) ;
++        }
++
++        if ( super.contains(argNoStats))
++            generateStats = false ;
++        
++        List<String> urls = getPositional() ;
++        if ( urls.size() == 0 )
++            urls.add("-") ;
++
++        if ( graphName == null ) {
++            loadQuads(urls) ;
++            return ;
++        }
++        
++        // There's a --graph.
++        // Check/warn that there are no quads formats mentioned
++        // (RIOT will take the default graph from quads).  
++        
++        for ( String url : urls ) {
++            Lang lang = RDFLanguages.filenameToLang(url) ;
++            if ( lang != null && RDFLanguages.isQuads(lang) ) {
++                System.err.println("Warning: Quads format given - only the default graph is loaded into the graph for --graph") ;
++                break ;
++            }
++        }
++        
++        loadNamedGraph(urls) ;
++    }
++
++//    void loadDefaultGraph(List<String> urls) {
++//        GraphTDB graph = getGraph() ;
++//        TDBLoader.load(graph, urls, showProgress) ;
++//        return ;
++//    }
++
++    void loadNamedGraph(List<String> urls) {
++        Graph graph = getGraph() ;
++        TDBLoader.load(graph, urls, showProgress) ;
++        return ;
++    }
++
++    void loadQuads(List<String> urls) {
++        TDBLoader.load(getDatasetGraph(), urls, showProgress, generateStats) ;
++        return ;
++    }
++    
++    /** Tick point for messages during loading of data */
++    public static int       DataTickPoint         = 50 * 1000 ;
++    /** Tick point for messages during secondary index creation */
++    public static long      IndexTickPoint        = 100 * 1000 ;
++
++    /** Number of ticks per super tick */
++    public static int       superTick             = 10 ;
++    
++    private static Logger LOG = LoggerFactory.getLogger("TDB2");
++    
++    static class TDBLoader {
++
++        public static void load(DatasetGraph dsg, List<String> urls, boolean showProgress, boolean generateStats) {
++            Txn.executeWrite(dsg, ()->{
++                urls.forEach((x)->loadOne(dsg, x, showProgress));
++            });
++        }
++
++        private static void loadOne(DatasetGraph dsg, String x, boolean showProgress) {
++            StreamRDF dest = StreamRDFLib.dataset(dsg);
++            StreamRDF sink = dest;
++            ProgressMonitor monitor = null;
++            if ( showProgress ) { 
++                String basename = FileOps.splitDirFile(x).get(1);
++                monitor = ProgressMonitor.create(LOG, basename, DataTickPoint, superTick); 
++                sink = new ProgressStreamRDF(sink, monitor);
++            }
++            if ( monitor!= null )
++                monitor.start();
++            sink.start();
++            RDFDataMgr.parse(sink, x);
++            sink.finish();
++            if ( monitor!= null ) {
++                monitor.finish();
++                monitor.finishMessage();
++            }
++        }
++
++        public static void load(Graph graph, List<String> urls, boolean showProgress) {
++            throw new NotImplemented();
++        }
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbquery.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbquery.java
index 0000000,0000000..fffe597
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbquery.java
@@@ -1,0 -1,0 +1,51 @@@
++/*
++ * 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 tdb2;
++
++import arq.query;
++import arq.cmdline.ModDataset;
++import tdb2.cmdline.CmdTDB;
++import tdb2.cmdline.ModTDBDataset;
++
++public class tdbquery extends query {
++    // Inherits from arq.query so is not a CmdTDB. Mixins for Java!
++    public static void main(String... argv) {
++        CmdTDB.init();
++        new tdbquery(argv).mainRun();
++    }
++
++    public tdbquery(String[] argv) {
++        super(argv);
++    }
++
++    @Override
++    protected String getSummary() {
++        return getCommandName() + " --loc=<path> --query=<query>";
++    }
++
++//    @Override
++//    protected void processModulesAndArgs() {
++//        super.processModulesAndArgs();
++//    }
++
++    @Override
++    protected ModDataset setModDataset() {
++        return new ModTDBDataset();
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbstats.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbstats.java
index 0000000,0000000..7f53199
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbstats.java
@@@ -1,0 -1,0 +1,99 @@@
++/*
++ * 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 tdb2;
++
++import java.util.Iterator ;
++
++import org.apache.jena.atlas.lib.tuple.Tuple ;
++import org.apache.jena.atlas.logging.Log ;
++import org.apache.jena.graph.Node ;
++import org.apache.jena.sparql.core.Quad ;
++import org.seaborne.dboe.jenax.Txn;
++import org.seaborne.tdb2.solver.SolverLib;
++import org.seaborne.tdb2.solver.stats.Stats;
++import org.seaborne.tdb2.solver.stats.StatsCollectorNodeId;
++import org.seaborne.tdb2.solver.stats.StatsResults;
++import org.seaborne.tdb2.store.DatasetGraphTDB;
++import org.seaborne.tdb2.store.NodeId;
++import org.seaborne.tdb2.store.nodetable.NodeTable;
++import org.seaborne.tdb2.store.nodetupletable.NodeTupleTable;
++import org.seaborne.tdb2.sys.TDBInternal ;
++import tdb2.cmdline.CmdTDB;
++import tdb2.cmdline.CmdTDBGraph;
++
++public class tdbstats extends CmdTDBGraph {
++    static public void main(String... argv) {
++        CmdTDB.init();
++        new tdbstats(argv).mainRun();
++    }
++
++    protected tdbstats(String[] argv) {
++        super(argv);
++    }
++
++    @Override
++    protected String getSummary() {
++        return null;
++    }
++
++    public static StatsResults stats(DatasetGraphTDB dsg, Node gn) {
++        return Txn.calculateRead(dsg, ()->stats$(dsg, gn));
++    }
++    
++    private static StatsResults stats$(DatasetGraphTDB dsg, Node gn) {
++                            
++        NodeTable nt = dsg.getTripleTable().getNodeTupleTable().getNodeTable();
++        StatsCollectorNodeId stats = new StatsCollectorNodeId(nt);
++
++        if ( gn == null ) {
++            Iterator<Tuple<NodeId>> iter = dsg.getTripleTable().getNodeTupleTable().findAll();
++            for ( ; iter.hasNext() ; ) {
++                Tuple<NodeId> t = iter.next();
++                stats.record(null, t.get(0), t.get(1), t.get(2));
++            }
++        } else {
++            // If the union graph, then we need to scan all quads but with uniqueness.
++            boolean unionGraph = Quad.isUnionGraph(gn) ;
++            NodeId gnid = null ;
++            if ( !unionGraph ) {
++                gnid = nt.getNodeIdForNode(gn);
++                if ( NodeId.isDoesNotExist(gnid) )
++                    Log.warn(tdbstats.class, "No such graph: " + gn);
++            }
++
++            NodeTupleTable ntt = dsg.getQuadTable().getNodeTupleTable();
++            Iterator<Tuple<NodeId>> iter = unionGraph
++                ? SolverLib.unionGraph(ntt)
++                : ntt.find(gnid, null, null, null) ;
++            for ( ; iter.hasNext() ; ) {
++                Tuple<NodeId> t = iter.next();
++                stats.record(t.get(0), t.get(1), t.get(2), t.get(3));
++            }
++        }
++        return stats.results();
++    }
++
++    @Override
++    protected void exec() {
++        DatasetGraphTDB dsg = TDBInternal.getDatasetGraphTDB(getDatasetGraph());
++        Node gn = getGraphName();
++        StatsResults results = stats(dsg, gn);
++        Stats.write(System.out, results);
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/java/tdb2/tdbupdate.java
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/java/tdb2/tdbupdate.java
index 0000000,0000000..cbe0245
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/java/tdb2/tdbupdate.java
@@@ -1,0 -1,0 +1,56 @@@
++/*
++ * 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 tdb2;
++
++import arq.cmdline.ModDataset;
++import jena.cmd.CmdException;
++import org.apache.jena.sparql.core.DatasetGraph;
++import org.seaborne.tdb2.TDB2;
++import tdb2.cmdline.CmdTDB;
++import tdb2.cmdline.ModTDBDataset;
++
++public class tdbupdate extends arq.update {
++    // Inherits from arq.update so is not a CmdTDB. Mixins for Java!
++    public static void main(String... argv) {
++        CmdTDB.init();
++        new tdbupdate(argv).mainRun();
++    }
++
++    public tdbupdate(String[] argv) {
++        super(argv);
++        // Because this inherits from an ARQ command
++        CmdTDB.init();
++        super.modVersion.addClass(TDB2.class);
++    }
++
++    @Override
++    protected void processModulesAndArgs() {
++        super.processModulesAndArgs();
++    }
++
++    @Override
++    protected ModDataset setModeDataset() {
++        return new ModTDBDataset();
++    }
++
++    @Override
++    protected DatasetGraph dealWithNoDataset() {
++        throw new CmdException("No dataset provided");
++    }
++}

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/resources/META-INF/LICENSE
index 0000000,0000000..67db858
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/resources/META-INF/LICENSE
@@@ -1,0 -1,0 +1,175 @@@
++
++                                 Apache License
++                           Version 2.0, January 2004
++                        http://www.apache.org/licenses/
++
++   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
++
++   1. Definitions.
++
++      "License" shall mean the terms and conditions for use, reproduction,
++      and distribution as defined by Sections 1 through 9 of this document.
++
++      "Licensor" shall mean the copyright owner or entity authorized by
++      the copyright owner that is granting the License.
++
++      "Legal Entity" shall mean the union of the acting entity and all
++      other entities that control, are controlled by, or are under common
++      control with that entity. For the purposes of this definition,
++      "control" means (i) the power, direct or indirect, to cause the
++      direction or management of such entity, whether by contract or
++      otherwise, or (ii) ownership of fifty percent (50%) or more of the
++      outstanding shares, or (iii) beneficial ownership of such entity.
++
++      "You" (or "Your") shall mean an individual or Legal Entity
++      exercising permissions granted by this License.
++
++      "Source" form shall mean the preferred form for making modifications,
++      including but not limited to software source code, documentation
++      source, and configuration files.
++
++      "Object" form shall mean any form resulting from mechanical
++      transformation or translation of a Source form, including but
++      not limited to compiled object code, generated documentation,
++      and conversions to other media types.
++
++      "Work" shall mean the work of authorship, whether in Source or
++      Object form, made available under the License, as indicated by a
++      copyright notice that is included in or attached to the work
++      (an example is provided in the Appendix below).
++
++      "Derivative Works" shall mean any work, whether in Source or Object
++      form, that is based on (or derived from) the Work and for which the
++      editorial revisions, annotations, elaborations, or other modifications
++      represent, as a whole, an original work of authorship. For the purposes
++      of this License, Derivative Works shall not include works that remain
++      separable from, or merely link (or bind by name) to the interfaces of,
++      the Work and Derivative Works thereof.
++
++      "Contribution" shall mean any work of authorship, including
++      the original version of the Work and any modifications or additions
++      to that Work or Derivative Works thereof, that is intentionally
++      submitted to Licensor for inclusion in the Work by the copyright owner
++      or by an individual or Legal Entity authorized to submit on behalf of
++      the copyright owner. For the purposes of this definition, "submitted"
++      means any form of electronic, verbal, or written communication sent
++      to the Licensor or its representatives, including but not limited to
++      communication on electronic mailing lists, source code control systems,
++      and issue tracking systems that are managed by, or on behalf of, the
++      Licensor for the purpose of discussing and improving the Work, but
++      excluding communication that is conspicuously marked or otherwise
++      designated in writing by the copyright owner as "Not a Contribution."
++
++      "Contributor" shall mean Licensor and any individual or Legal Entity
++      on behalf of whom a Contribution has been received by Licensor and
++      subsequently incorporated within the Work.
++
++   2. Grant of Copyright License. Subject to the terms and conditions of
++      this License, each Contributor hereby grants to You a perpetual,
++      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
++      copyright license to reproduce, prepare Derivative Works of,
++      publicly display, publicly perform, sublicense, and distribute the
++      Work and such Derivative Works in Source or Object form.
++
++   3. Grant of Patent License. Subject to the terms and conditions of
++      this License, each Contributor hereby grants to You a perpetual,
++      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
++      (except as stated in this section) patent license to make, have made,
++      use, offer to sell, sell, import, and otherwise transfer the Work,
++      where such license applies only to those patent claims licensable
++      by such Contributor that are necessarily infringed by their
++      Contribution(s) alone or by combination of their Contribution(s)
++      with the Work to which such Contribution(s) was submitted. If You
++      institute patent litigation against any entity (including a
++      cross-claim or counterclaim in a lawsuit) alleging that the Work
++      or a Contribution incorporated within the Work constitutes direct
++      or contributory patent infringement, then any patent licenses
++      granted to You under this License for that Work shall terminate
++      as of the date such litigation is filed.
++
++   4. Redistribution. You may reproduce and distribute copies of the
++      Work or Derivative Works thereof in any medium, with or without
++      modifications, and in Source or Object form, provided that You
++      meet the following conditions:
++
++      (a) You must give any other recipients of the Work or
++          Derivative Works a copy of this License; and
++
++      (b) You must cause any modified files to carry prominent notices
++          stating that You changed the files; and
++
++      (c) You must retain, in the Source form of any Derivative Works
++          that You distribute, all copyright, patent, trademark, and
++          attribution notices from the Source form of the Work,
++          excluding those notices that do not pertain to any part of
++          the Derivative Works; and
++
++      (d) If the Work includes a "NOTICE" text file as part of its
++          distribution, then any Derivative Works that You distribute must
++          include a readable copy of the attribution notices contained
++          within such NOTICE file, excluding those notices that do not
++          pertain to any part of the Derivative Works, in at least one
++          of the following places: within a NOTICE text file distributed
++          as part of the Derivative Works; within the Source form or
++          documentation, if provided along with the Derivative Works; or,
++          within a display generated by the Derivative Works, if and
++          wherever such third-party notices normally appear. The contents
++          of the NOTICE file are for informational purposes only and
++          do not modify the License. You may add Your own attribution
++          notices within Derivative Works that You distribute, alongside
++          or as an addendum to the NOTICE text from the Work, provided
++          that such additional attribution notices cannot be construed
++          as modifying the License.
++
++      You may add Your own copyright statement to Your modifications and
++      may provide additional or different license terms and conditions
++      for use, reproduction, or distribution of Your modifications, or
++      for any such Derivative Works as a whole, provided Your use,
++      reproduction, and distribution of the Work otherwise complies with
++      the conditions stated in this License.
++
++   5. Submission of Contributions. Unless You explicitly state otherwise,
++      any Contribution intentionally submitted for inclusion in the Work
++      by You to the Licensor shall be under the terms and conditions of
++      this License, without any additional terms or conditions.
++      Notwithstanding the above, nothing herein shall supersede or modify
++      the terms of any separate license agreement you may have executed
++      with Licensor regarding such Contributions.
++
++   6. Trademarks. This License does not grant permission to use the trade
++      names, trademarks, service marks, or product names of the Licensor,
++      except as required for reasonable and customary use in describing the
++      origin of the Work and reproducing the content of the NOTICE file.
++
++   7. Disclaimer of Warranty. Unless required by applicable law or
++      agreed to in writing, Licensor provides the Work (and each
++      Contributor provides its Contributions) on an "AS IS" BASIS,
++      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
++      implied, including, without limitation, any warranties or conditions
++      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
++      PARTICULAR PURPOSE. You are solely responsible for determining the
++      appropriateness of using or redistributing the Work and assume any
++      risks associated with Your exercise of permissions under this License.
++
++   8. Limitation of Liability. In no event and under no legal theory,
++      whether in tort (including negligence), contract, or otherwise,
++      unless required by applicable law (such as deliberate and grossly
++      negligent acts) or agreed to in writing, shall any Contributor be
++      liable to You for damages, including any direct, indirect, special,
++      incidental, or consequential damages of any character arising as a
++      result of this License or out of the use or inability to use the
++      Work (including but not limited to damages for loss of goodwill,
++      work stoppage, computer failure or malfunction, or any and all
++      other commercial damages or losses), even if such Contributor
++      has been advised of the possibility of such damages.
++
++   9. Accepting Warranty or Additional Liability. While redistributing
++      the Work or Derivative Works thereof, You may choose to offer,
++      and charge a fee for, acceptance of support, warranty, indemnity,
++      or other liability obligations and/or rights consistent with this
++      License. However, in accepting such obligations, You may act only
++      on Your own behalf and on Your sole responsibility, not on behalf
++      of any other Contributor, and only if You agree to indemnify,
++      defend, and hold each Contributor harmless for any liability
++      incurred by, or claims asserted against, such Contributor by reason
++      of your accepting any such warranty or additional liability.

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/resources/META-INF/NOTICE
index 0000000,0000000..5ba7ec0
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/resources/META-INF/NOTICE
@@@ -1,0 -1,0 +1,10 @@@
++Mantis Database Operating Environment
++
++Copyright 2013-2017 Andy Seaborne
++Copyright 2014, 2015 Epimorphics Ltd.
++
++Portions of this software derive from software from Apache Jena:
++  - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
++  - Copyright 2010, 2011 Epimorphics Ltd.
++  - Copyright 2010, 2011 Talis Systems Ltd.
++These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/resources/META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/resources/META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle
index 0000000,0000000..21f02ea
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/resources/META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle
@@@ -1,0 -1,0 +1,1 @@@
++org.seaborne.tdb2.sys.InitTDB2

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/src/main/resources/org/apache/jena/tdb/tdb-properties.xml
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/src/main/resources/org/apache/jena/tdb/tdb-properties.xml
index 0000000,0000000..67d8255
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/src/main/resources/org/apache/jena/tdb/tdb-properties.xml
@@@ -1,0 -1,0 +1,8 @@@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
++<!-- Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 -->
++<properties version="1.0">
++  <comment>TDB System Properties</comment>
++  <entry key="org.apache.jena.tdb.version">${project.version}</entry>
++  <entry key="org.apache.jena.tdb.build.datetime">${build.time.xsd}</entry>
++</properties>

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/tdb2
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/tdb2
index 0000000,0000000..d2772db
new file mode 100755
--- /dev/null
+++ b/jena-db/tdb2-cmds/tdb2
@@@ -1,0 -1,0 +1,99 @@@
++#!/usr/bin/env bash
++
++## Usage: tdb2
++## Sets up the java enviroment to run Jena-based commands.
++
++CP=
++
++#JENA_CP="$(jena)"
++## If Jena development, this needs to be different.
++JENA_CP="$HOME/jlib/apache-jena/lib/"'*'
++
++## Log4j
++LOG4J_CP="/home/afs/.m2/repo/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar:/home/afs/.m2/repo/log4j/log4j/1.2.17/log4j-1.2.17.jar"
++## JUL
++JUL_CP="/home/afs/.m2/repo/org/slf4j/slf4j-jdk14/1.7.25/slf4j-jdk14-1.7.25.jar"
++
++H="$HOME/Mantis"
++D=
++
++# modules
++# Not dboe-index-test
++read -r -d '' MODULES << EOM
++dboe-base 
++dboe-index 
++dboe-transaction
++dboe-trans-data
++tdb2
++tdb2-cmds
++EOM
++
++if true # if in development area ./
++then
++    for X in $MODULES
++    do
++	[[ $D = "" ]] || D="$D:"
++	D="${D}$H/$X/target/classes"
++    done
++else
++    ## @@ By artifacts ...
++    echo "Not implemented: classpath by artifacts" 2>&1
++    exit 9
++fi
++
++
++TDB2_CP="$D"
++
++if [[ -e logging.properties ]]
++then
++    LOGGING_JUL=-Djava.util.logging.config.file=logging.properties
++fi
++if [[ -e log4j.properties ]]
++then
++    LOGGING_LOG4J=-Dlog4j.configuration=file:log4j.properties
++fi
++
++if [[ $# = 0 ]]
++then
++    echo "Class path: $TDB2_CP:${JENA_CP}"
++    exit
++    #echo "No class to run" 1>&2
++    #exit 1
++else
++    CMD="$1"
++    shift
++fi
++
++# Map CMD to class name
++TDB2_PKG="tdb2"
++
++# Alternative names.
++## case $CMD in
++##     ???
++## 	CMD=tdb2.$CMD
++## 	;;
++##     *) ;;
++## esac
++
++# Map to class name.
++case $CMD in
++    "")
++    ;;
++    tdbbackup | tdbdump | tdbloader | tdbquery | tdbstats | tdbupdate | tdbcompact)
++	CMD_CLS="$TDB2_PKG"."$CMD"
++	;;
++##     tools.*)
++## 	CMD_CLS="${BASE_PKG}"."$CMD"
++## 	;;
++    *)
++	echo "Unknown command $CMD" 2>&1
++	exit 1
++    ;;
++
++esac
++
++## echo "TDB2_CP=$TDB2_CP"
++## echo "JENA_CP=$JENA_CP"
++#echo java $JVM_ARGS $LOGGING_LOG4J $LOGGING_JUL -cp "$TDB2_CP:${JENA_CP}" "$CMD_CLS" "$@"
++
++java $JVM_ARGS $LOGGING_LOG4J $LOGGING_JUL -cp "$TDB2_CP:${JENA_CP}" "$CMD_CLS" "$@"

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-dataset-embed.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-dataset-embed.ttl
index 0000000,0000000..9edd5a3
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-dataset-embed.ttl
@@@ -1,0 -1,0 +1,23 @@@
++#  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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@prefix rdfs:	 <http://www.w3.org/2000/01/rdf-schema#> .
++@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
++
++<#dataset> rdf:type      tdb2:DatasetTDB2 ;
++    tdb2:location "--mem--" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-dataset.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-dataset.ttl
index 0000000,0000000..c9d8d7b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-dataset.ttl
@@@ -1,0 -1,0 +1,23 @@@
++#  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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
++
++<#dataset> rdf:type      tdb2:DatasetTDB2 ;
++    # Do at least one the long way.
++    tdb2:location "target/tdb-testing/DB" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-graph-embed.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-graph-embed.ttl
index 0000000,0000000..af3daab
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-graph-embed.ttl
@@@ -1,0 -1,0 +1,27 @@@
++#  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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@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#> .
++
++<#dataset> rdf:type      ja:RDFDataset ;
++    ja:defaultGraph <#graph> ;
++    . 
++
++<#graph> rdf:type tdb2:GraphTDB2 ;
++    tdb2:location "--mem--" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-graph-ref-dataset.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-graph-ref-dataset.ttl
index 0000000,0000000..fe256bd
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-graph-ref-dataset.ttl
@@@ -1,0 -1,0 +1,31 @@@
++#  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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@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#> .
++
++<#dataset> rdf:type      ja:RDFDataset ;
++    ja:defaultGraph <#graph> ;
++    . 
++
++<#graph> rdf:type tdb2:GraphTDB2 ;
++    tdb2:dataset <#dataset> ;
++    .
++
++<#dataset> rdf:type tdb2:DatasetTDB2 ;
++    tdb2:location "--mem--" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-graph.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-graph.ttl
index 0000000,0000000..2ae8396
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-graph.ttl
@@@ -1,0 -1,0 +1,27 @@@
++#  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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
++
++<#dataset> rdf:type      ja:RDFDataset ;
++    ja:defaultGraph <#graph> ;
++    . 
++
++<#graph> rdf:type tdb2:GraphTDB2 ;
++    tdb2:location "target/tdb-testing/DB" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-1.ttl
index 0000000,0000000..78e40cf
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-1.ttl
@@@ -1,0 -1,0 +1,29 @@@
++
++#  Licensed to the Apache Software Foundation (ASF) under one or more
++#  contributor license agreements.  See the NOTICE file distributed with
++#  this work for additional information regarding copyright ownership.
++#  The ASF licenses this file to You under the Apache License, Version 2.0
++#  (the "License"); you may not use this file except in compliance with
++#  the License.  You may obtain a copy of the License at
++# 
++#       http://www.apache.org/licenses/LICENSE-2.0
++# 
++#  Unless required by applicable law or agreed to in writing, software
++#  distributed under the License is distributed on an "AS IS" BASIS,
++#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++#  See the License for the specific language governing permissions and
++#  limitations under the License.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@prefix rdfs:	 <http://www.w3.org/2000/01/rdf-schema#> .
++@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
++
++<#dataset> rdf:type      ja:RDFDataset ;
++    ja:defaultGraph <#graph> ;
++    . 
++
++<#graph> rdf:type tdb2:GraphTDB2 ;
++    tdb2:location "--mem--" ;
++    tdb2:graphName "http://example.com/graph" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-2.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-2.ttl
index 0000000,0000000..ee2feab
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Assembler/tdb-named-graph-2.ttl
@@@ -1,0 -1,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.
++
++@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
++@prefix rdfs:	 <http://www.w3.org/2000/01/rdf-schema#> .
++@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
++@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
++
++<#dataset> rdf:type      ja:RDFDataset ;
++    ja:defaultGraph <#graph> ;
++    . 
++
++<#graph> rdf:type tdb2:GraphTDB2 ;
++    tdb2:location "--mem--" ;
++    tdb2:graphName "http://example.com/graph" ;
++    .

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-00.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-00.rq
index 0000000,0000000..f2341a0
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-00.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example>
++
++SELECT * 
++{ ?x ?p ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-O.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-O.rq
index 0000000,0000000..e1d1da7
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-O.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x ?p :z1 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-P.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-P.rq
index 0000000,0000000..d64b9f9
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-P.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x :p1 ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-PO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-PO.rq
index 0000000,0000000..01fa14a
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-PO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x :p1 :z1 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-S.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-S.rq
index 0000000,0000000..180188e
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-S.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1 ?p ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-SO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-SO.rq
index 0000000,0000000..a4242fb
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-SO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1 ?p :z1 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-SP.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-SP.rq
index 0000000,0000000..37ddfe6
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-SP.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1 :p1 ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-1-SPO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-1-SPO.rq
index 0000000,0000000..41aa20f
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-1-SPO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT ?v
++{ :x1 :p1 :z1 }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-2-SO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-2-SO.rq
index 0000000,0000000..49c5711
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-2-SO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT *
++{ ?x ?p ?x }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-O.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-O.rq
index 0000000,0000000..f7f3f6b
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-O.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x ?p :z1a }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-P.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-P.rq
index 0000000,0000000..8c79fa5
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-P.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x :p1a ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-PO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-PO.rq
index 0000000,0000000..a011a1c
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-PO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ ?x :p1 :z1a }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-S.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-S.rq
index 0000000,0000000..8b62930
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-S.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1a ?p ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-SO.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-SO.rq
index 0000000,0000000..e71f0b3
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-SO.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1 ?p :z1a }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/basic-3-SP.rq
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/basic-3-SP.rq
index 0000000,0000000..3b7ff81
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/basic-3-SP.rq
@@@ -1,0 -1,0 +1,4 @@@
++PREFIX :  <http://example/>
++
++SELECT * 
++{ :x1a :p1 ?z }

http://git-wip-us.apache.org/repos/asf/jena/blob/d9da3592/jena-db/tdb2-cmds/testing/Basic/data-1.ttl
----------------------------------------------------------------------
diff --cc jena-db/tdb2-cmds/testing/Basic/data-1.ttl
index 0000000,0000000..d3a3d80
new file mode 100644
--- /dev/null
+++ b/jena-db/tdb2-cmds/testing/Basic/data-1.ttl
@@@ -1,0 -1,0 +1,17 @@@
++@prefix : <http://example/> .
++
++:x1 :p1 :z1 .
++:x1 :p1 :z2 .
++
++:x1 :p2 :z1 .
++:x1 :p2 :z2 .
++
++:x2 :p1 :z1 .
++:x2 :p1 :z2 .
++
++:x2 :p2 :z1 .
++:x2 :p2 :z2 .
++
++:x :p :x .
++:x :x :x .
++


Mime
View raw message