title: Stardog data loading and Jena
body: <p>I am using Stardog to store a bunch of triples that come from different sources. I use Jena to collect and merge the data in a single Jena graph. All these triples are part of ABoxes.</p>
  
  <ol>
  <li><p>I am not sure Stardog will require that the TBox is also merged with the ABox graphs. I supposed it does because otherwise I cannot see how Stardog will do reasoning over the data. I have not seen any option to store and use the TBox apart as in some others triple stores. Do I need to include the TBox in the Jena graph or is there a way to store the TBox in another Stardog database so when querying the database of ABoxes it is taken into consideration too?</p></li>
  <li><p>I am considering options to load the Jena graph (varies between 1 and 7 million triples) into Stardog:</p>
  
  <ul>
  <li>One of the options I don't really like is to write the graph into a file and execute the client to load it into Stardog. One the data is in a Jena graph, I would prefer a direct solution.</li>
  <li>Another option is to load the triples one by one (<a href="https://stackoverflow.com/questions/16053904/example-of-stardog-sparql-insert-query-in-java/16061801#16061801">example of stardog sparql insert query in java</a>), which I dislike for potential inefficiency.</li>
  </ul></li>
  </ol>
  
  <p>Is there any elegant way to load the whole graph from Jena?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Attempt of code based on the example in the distribution:</p>
  
  <pre><code>Server aServer = Stardog.buildServer()
          .bind(new InetSocketAddress("10.0.0.1", 5820))
          .start();
  
  AdminConnection aAdminConnection = AdminConnectionConfiguration.toServer("...").credentials("admin", "admin").connect();
          if (aAdminConnection.list().contains("test")) {
              aAdminConnection.drop("test");
          }
  
  Connection aConn = aAdminConnection.memory("test").create(file).connect();
  
  Model aModel = SDJenaFactory.createModel(aConn);
  </code></pre>
  
  <p><strong>EDIT 2:</strong> Corrected some bits of my code.</p>
  
  <p>Additional information in <a href="http://docs.stardog.com/faq/#sd-Remote-Bulk-Loading" rel="nofollow noreferrer">the Stardog documentation</a></p>