jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r797466 [3/4] - in /websites/staging/jena/trunk/content/jena: ./ about_jena/ css/ documentation/ documentation/assembler/ documentation/inference/ documentation/io/ documentation/javadoc/ documentation/larq/ documentation/notes/ documentati...
Date Tue, 25 Oct 2011 22:41:30 GMT
Added: websites/staging/jena/trunk/content/jena/documentation/sdb/javaapi.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/sdb/javaapi.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/sdb/javaapi.html Tue Oct 25 22:41:28 2011
@@ -0,0 +1,402 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    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.
+-->
+
+  <link href="/jena/css/jena.css" rel="stylesheet" type="text/css">
+  <title>Apache Jena - SDB JavaAPI</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <script src="/jena/js/jquery-1.6.4.min.js" type="text/javascript"></script>
+  <script src="/jena/js/jena-navigation.js" type="text/javascript"></script>
+</head>
+
+<body>
+  <div id="header">
+    <div id="logoblock">
+    <img alt="Apache Jena" src="/jena/images/jena-logo/jena-logo-small.png"/>
+    </div>
+
+    <div id="titleblock">
+      <h1 class="title">Apache Jena</h1>
+      <div id="topmenu" class="tabbar round-10">
+        <ul>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/index.html" id="home_menu">Home</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/help_and_support/index.html">Support</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/getting_started/index.html">Getting started</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/tutorials/index.html">Tutorials</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/documentation/index.html">Documentation</a></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+
+  <div id="navigation" class="clear">
+  <h1 id="quick_links">Quick links</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/download/index.html">Downloads</a></li>
+<li><a href="/jena/help_and_support/index.html">Help and support</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/getting_involved/index.html">Getting involved</a></li>
+<li><a href="/jena/documentation/">Documentation</a></li>
+</ul>
+<h1 id="about_jena">About Jena</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/about_jena/about.html">About Jena</a></li>
+<li><a href="/jena/about_jena/architecture.html">Architecture</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/about_jena/team.html">Project team</a></li>
+</ul>
+<h1 id="download">Download</h1>
+<ul>
+<li><a href="/jena/download/index.html">Downloading Jena</a></li>
+<li><a href="/jena/download/maven.html">Using Maven</a></li>
+<li><a href="/jena/download/osgi.html">Using OSGi</a></li>
+</ul>
+<h1 id="help_and_support">Help and support</h1>
+<ul>
+<li><a href="/jena/help_and_support/index.html">Getting help</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Bugs and suggestions</a></li>
+</ul>
+<h1 id="getting_started">Getting Started</h1>
+<ul>
+<li><a href="/jena/getting_started/index.html">A first Jena project</a></li>
+<li><a href="/jena/getting_started/rdf_api.html">RDF API overview</a></li>
+<li><a href="/jena/getting_started/sparql.html">Querying RDF with SPARQL</a></li>
+<li><a href="/jena/getting_started/fuseki.html">Serving RDF over HTTP</a></li>
+<li><a href="/jena/getting_started/tell_me_how.html">Tell me how to ...</a></li>
+</ul>
+<h1 id="tutorials">Tutorials</h1>
+<ul>
+<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<li><a href="/jena/tutorials/sparql.html">SPARQL queries</a></li>
+<li><a href="/jena/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
+</ul>
+<h1 id="documentation">Documentation</h1>
+<ul>
+<li><a href="/jena/documentation/index.html">Overview</a></li>
+<li><a href="/jena/documentation/javadoc">Javadoc</a></li>
+<li><a href="/jena/documentation/rdf/index.html">RDF</a></li>
+<li><a href="/jena/documentation/query/index.html">SPARQL (ARQ)</a></li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a></li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a><ul>
+<li><a href="/jena/documentation/sdb/installation.html">Installation</a></li>
+<li><a href="/jena/documentation/sdb/quickstart.html">Quick start</a></li>
+<li><a href="/jena/documentation/sdb/commands.html">Cmd line</a></li>
+<li><a href="/jena/documentation/sdb/javaapi.html">Java API</a></li>
+<li><a href="/jena/documentation/sdb/configuration.html">Config</a></li>
+<li><a href="/jena/documentation/sdb/databases_supported.html">Databases</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Serving Data</a></li>
+<li><a href="/jena/documentation/ontology/index.html">Ontology</a></li>
+<li><a href="/jena/documentation/inference/index.html">Inference</a></li>
+<li><a href="/jena/documentation/assembler/index.html">Assembler</a><ul>
+<li><a href="/jena/documentation/assembler/assembler-howto.html">Assembler how-to</a></li>
+<li><a href="/jena/documentation/assembler/inside-assemblers.html">Inside assemblers</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/io/index.html">I/O</a><ul>
+<li><a href="/jena/documentation/io/iohowto.html">I/O how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/notes/index.html">Notes</a><ul>
+<li><a href="/jena/documentation/notes/concurrency-howto.html">Concurrency how-to</a></li>
+<li><a href="/jena/documentation/notes/event-handler-howto.html">Event handler how-to</a></li>
+<li><a href="/jena/documentation/notes/file-manager.html">File manager how-to</a></li>
+<li><a href="/jena/documentation/notes/model-factory.html">Model factory how-to</a></li>
+<li><a href="/jena/documentation/notes/rdf-frames.html">RDF frames</a></li>
+<li><a href="/jena/documentation/notes/reification.html">Reification how-to</a></li>
+<li><a href="/jena/documentation/notes/typed-literals.html">Typed literals how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tools/index.html">Tools</a><ul>
+<li><a href="/jena/documentation/tools/schemagen.html">schemagen</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="getting_involved">Getting Involved</h1>
+<ul>
+<li><a href="/jena/getting_involved/index.html">Contributing to Jena</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+  </div>
+
+  <div id="content">
+    <h1 class="title">SDB JavaAPI</h1>
+    <p>This page describes how to use SDB from Java.</p>
+<p>Code examples are in <code>src-examples/</code> in the SDB distribution.</p>
+<h2 id="contents">Contents</h2>
+<ul>
+<li><a href="#Concepts">Concepts</a></li>
+<li><a href="#Obtaining_the_Store">Obtaining the Store</a><ul>
+<li><a href="#From_a_configuration_file">From a configuration file</a></li>
+<li><a href="#In_Java_code">In Java code</a></li>
+<li><a href="#Database_User_and_Password">Database User and Password</a></li>
+</ul>
+</li>
+<li><a href="#Connection_Management">Connection Management</a></li>
+<li><a href="#Formatting_or_Emptying_the_Store">Formatting or Emptying the Store</a></li>
+<li><a href="#Loading_data">Loading data</a></li>
+<li><a href="#Executing_Queries">Executing Queries</a></li>
+<li><a href="#Using_the_Jena_Model_API_with_SDB">Using the Jena Model API with SDB</a></li>
+</ul>
+<h2 id="concepts">Concepts</h2>
+<ul>
+<li><code>Store</code></li>
+<li><code>SDBFactory</code></li>
+<li><code>SDBConnection</code></li>
+</ul>
+<p>SDB loads and queries data based on the unit of a <code>Store</code>. The
+<code>Store</code> object has all the information for formatting, loading and
+accessing an SDB database. One database or table space is one
+Store. <code>Store</code> objects are made via the static method of the
+<code>StoreFactory</code> class.</p>
+<p><code>SDBConnection</code> wraps the underlying database connection, as well
+as providing logging operations.</p>
+<ul>
+<li><code>StoreDesc</code></li>
+</ul>
+<p>A store description is the low level mechanism for describing
+stores to be created.</p>
+<ul>
+<li><code>DatasetStore</code></li>
+<li><code>GraphSDB</code></li>
+</ul>
+<p>Two further class are not immediately visible because they are
+managed by the <code>SDBFactory</code> which creates the necessary classes,
+such as Jena models and graphs.</p>
+<p>An object of class <code>DatasetStore</code> represents an
+<a href="http://www.w3.org/TR/rdf-sparql-query/#rdfDataset" title="http://www.w3.org/TR/rdf-sparql-query/#rdfDataset">RDF dataset</a>
+backed by an SDB store. Objects of this class trigger SPARQL
+queries being sent to SDB.</p>
+<p>The class <code>GraphSDB</code> provides the adapter between the standard Jena
+Java API and an SDB store, either to the default graph or one of
+the named graphs. The <code>SDBFactory</code> can also create Jena Models
+backed by such a graph.</p>
+<h2 id="obtaining_the_store">Obtaining the Store</h2>
+<p>A store is build from a description. This can be a description in
+file as a
+<a href="http://jena.sourceforge.net/assembler/" title="http://jena.sourceforge.net/assembler/">Jena assembler</a>
+or the application can build the store description
+programmatically.</p>
+<h3 id="from_a_configuration_file">From a configuration file</h3>
+<p>The stored description is the only point where the specific details
+of store are given. This includes connection information, the
+database name, and database type. It makes sense to place this
+outside the code. That way, the application can be switched between
+different databases (e.g. testing and production) by changing a
+configuration file, and not the code, which would require
+recompilation and a rebuild.</p>
+<p>To create a <code>Store</code> from a store assembler</p>
+<div class="codehilite"><pre>  <span class="n">Store</span> <span class="n">store</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectStore</span><span class="p">(</span><span class="s">&quot;sdb.ttl&quot;</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>The assembler file has two parts, the connection details and the
+store type.</p>
+<div class="codehilite"><pre> <span class="nv">@prefix</span> <span class="n">rdfs:</span>     <span class="sr">&lt;http://www.w3.org/2000/01/rdf-schema#&gt;</span> <span class="o">.</span>
+ <span class="nv">@prefix</span> <span class="n">rdf:</span>      <span class="sr">&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;</span> <span class="o">.</span>
+ <span class="nv">@prefix</span> <span class="n">ja:</span>       <span class="sr">&lt;http://jena.hpl.hp.com/2005/11/Assembler#&gt;</span> <span class="o">.</span>
+ <span class="nv">@prefix</span> <span class="n">sdb:</span>      <span class="sr">&lt;http://jena.hpl.hp.com/2007/sdb#&gt;</span> <span class="o">.</span>
+
+ <span class="n">_:c</span> <span class="n">rdf:type</span> <span class="n">sdb:SDBConnection</span><span class="err"> </span><span class="p">;</span>
+     <span class="n">sdb:sdbType</span>        <span class="s">&quot;derby&quot;</span><span class="err"> </span><span class="p">;</span>
+     <span class="n">sdb:sdbName</span>        <span class="s">&quot;DB/SDB2&quot;</span><span class="err"> </span><span class="p">;</span>
+     <span class="n">sdb:driver</span>         <span class="s">&quot;org.apache.derby.jdbc.EmbeddedDriver&quot;</span><span class="err"> </span><span class="p">;</span>
+     <span class="o">.</span>
+
+ <span class="o">[]</span> <span class="n">rdf:type</span> <span class="n">sdb:Store</span><span class="err"> </span><span class="p">;</span>
+     <span class="n">sdb:layout</span>         <span class="s">&quot;layout2&quot;</span><span class="err"> </span><span class="p">;</span>
+     <span class="n">sdb:connection</span>     <span class="n">_:c</span><span class="err"> </span><span class="p">;</span>
+    <span class="o">.</span>
+</pre></div>
+
+
+<p>See the full details of
+<a href="store_description.html" title="SDB/Store Description">store description files</a>
+for the options.</p>
+<h3 id="in_java_code">In Java code</h3>
+<p>The less flexible way to create a store description is to build it
+in Java. For example:</p>
+<div class="codehilite"><pre>   <span class="n">StoreDesc</span> <span class="n">storeDesc</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StoreDesc</span><span class="p">(</span><span class="n">LayoutType</span><span class="o">.</span><span class="n">LayoutTripleNodesHash</span><span class="p">,</span>
+                                       <span class="n">DatabaseType</span><span class="o">.</span><span class="n">Derby</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">JDBC</span><span class="o">.</span><span class="n">loadDriverDerby</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">String</span> <span class="n">jdbcURL</span> <span class="o">=</span> <span class="s">&quot;jdbc:derby:DB/SDB2&quot;</span><span class="p">;</span>
+   <span class="n">SDBConnection</span> <span class="n">conn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SDBConnection</span><span class="p">(</span><span class="n">jdbcURL</span><span class="p">,</span> <span class="n">null</span><span class="p">,</span> <span class="n">null</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">Store</span> <span class="n">store</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectStore</span><span class="p">(</span><span class="n">conn</span><span class="p">,</span> <span class="n">storeDesc</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<h3 id="database_user_and_password">Database User and Password</h3>
+<p>The user and password for the database can be set in explicitly in
+the description file but it is usually better to use an environment
+variable or Java system property because this avoid writing use and
+password in a file.</p>
+<p>Environment variable: <code>SDB_USER</code>
+Java property: <code>jena.db.user</code></p>
+<p>Environment variable: <code>SDB_PASSWORD</code>
+Java property: <code>jena.db.password</code></p>
+<h2 id="connection_management">Connection Management</h2>
+<p>Each store has a JDBC connection associated with it.</p>
+<p>In situations where such connections are managed externally, the
+store object can be created and used within a single operation.</p>
+<p>A <code>Store</code> is lightweight and does not perform any database actions
+when created, so creating and releasing them will not impact
+performance. Closing a store does not close the JDBC connection.</p>
+<p>Similarly, a <code>SDBConnection</code> is lightweight and creation does not
+result in any database or JDBC connection actions.</p>
+<p>The store description can be read from the same file because any
+SDB connection information is ignored when reading to get just the
+store description. The store description can be kept across store
+creations:</p>
+<div class="codehilite"><pre>  <span class="n">storeDesc</span> <span class="o">=</span> <span class="n">StoreDesc</span><span class="o">.</span><span class="nb">read</span><span class="p">(</span><span class="s">&quot;sdb.ttl&quot;</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>then used with an JDBC connection object passed from the connection
+container:</p>
+<div class="codehilite"><pre>    <span class="n">public</span> <span class="n">static</span> <span class="n">void</span> <span class="n">query</span><span class="p">(</span><span class="n">String</span> <span class="n">queryString</span><span class="p">,</span>
+                             <span class="n">StoreDesc</span> <span class="n">storeDesc</span><span class="p">,</span>
+                             <span class="n">Connection</span> <span class="n">jdbcConnection</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">Query</span> <span class="n">query</span> <span class="o">=</span> <span class="n">QueryFactory</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">queryString</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+
+        <span class="n">SDBConnection</span> <span class="n">conn</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">createConnection</span><span class="p">(</span><span class="n">jdbcConnection</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+
+        <span class="n">Store</span> <span class="n">store</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectStore</span><span class="p">(</span><span class="n">conn</span><span class="p">,</span> <span class="n">storeDesc</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+
+        <span class="n">Dataset</span> <span class="n">ds</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectDataset</span><span class="p">(</span><span class="n">store</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+        <span class="n">QueryExecution</span> <span class="n">qe</span> <span class="o">=</span> <span class="n">QueryExecutionFactory</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">ds</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+        <span class="n">try</span> <span class="p">{</span>
+            <span class="n">ResultSet</span> <span class="n">rs</span> <span class="o">=</span> <span class="n">qe</span><span class="o">.</span><span class="n">execSelect</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+            <span class="n">ResultSetFormatter</span><span class="o">.</span><span class="n">out</span><span class="p">(</span><span class="n">rs</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+        <span class="p">}</span> <span class="n">finally</span> <span class="p">{</span> <span class="n">qe</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span> <span class="p">}</span>
+        <span class="n">store</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+    <span class="p">}</span>
+</pre></div>
+
+
+<h2 id="formatting_or_emptying_the_store">Formatting or Emptying the Store</h2>
+<p>SDB stores do not ensure that the database is formatted. You can
+check whether the store is already formatted using:</p>
+<div class="codehilite"><pre><span class="n">StoreUtils</span><span class="o">.</span><span class="n">isFormatted</span><span class="p">(</span><span class="n">store</span><span class="p">);</span>
+</pre></div>
+
+
+<p>This is an expensive operation, and should be used sparingly.</p>
+<p>Once you obtain a store for the first time you will need to:</p>
+<div class="codehilite"><pre><span class="n">store</span><span class="o">.</span><span class="n">getTableFormatter</span><span class="p">()</span><span class="o">.</span><span class="n">create</span><span class="p">();</span>
+</pre></div>
+
+
+<p>This will create the necessary tables and indexes required for a
+full SDB store.</p>
+<p>You may empty the store completely using:</p>
+<div class="codehilite"><pre><span class="n">store</span><span class="o">.</span><span class="n">getTableFormatter</span><span class="p">()</span><span class="o">.</span><span class="nb">truncate</span><span class="p">();</span>
+</pre></div>
+
+
+<h2 id="loading_data">Loading data</h2>
+<p>Data loading uses the standard Jena <code>Model.read</code> operations.
+<code>GraphSDB</code>, and models made from a <code>GraphSDB</code>, implement the
+standard Jena bulk data interface with backed by an SBD
+implementation of that interface.</p>
+<h2 id="executing_queries">Executing Queries</h2>
+<p>The interface to making queries with SDB is same as that for
+<a href="http://jena.sourceforge.net/ARQ/app_api.html" title="http://jena.sourceforge.net/ARQ/app_api.html">querying with ARQ</a>.
+SDB is an ARQ query engine that can handle queries made on an RDF
+dataset which is of the SDB class <code>DatasetStore</code>:</p>
+<div class="codehilite"><pre>   <span class="n">Dataset</span> <span class="n">ds</span> <span class="o">=</span> <span class="n">DatasetStore</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">store</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>This is then used as normal with ARQ:</p>
+<div class="codehilite"><pre>   <span class="n">Dataset</span> <span class="n">ds</span> <span class="o">=</span> <span class="n">DatasetStore</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">store</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">QueryExecution</span> <span class="n">qe</span> <span class="o">=</span> <span class="n">QueryExecutionFactory</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">ds</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">try</span> <span class="p">{</span>
+       <span class="n">ResultSet</span> <span class="n">rs</span> <span class="o">=</span> <span class="n">qe</span><span class="o">.</span><span class="n">execSelect</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">ResultSetFormatter</span><span class="o">.</span><span class="n">out</span><span class="p">(</span><span class="n">rs</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+   <span class="p">}</span> <span class="n">finally</span> <span class="p">{</span> <span class="n">qe</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span> <span class="p">}</span>
+</pre></div>
+
+
+<p>When finished, the store should be closed to release any resources
+associated with the particular implementation. Closing a store does
+<em>not</em> close it's JDBC connection.</p>
+<div class="codehilite"><pre>   <span class="n">store</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>Closing the SDBConnection <em>does</em> close the JDBC connection:</p>
+<div class="codehilite"><pre>   <span class="n">store</span><span class="o">.</span><span class="n">getConnection</span><span class="p">()</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">store</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>If models or graphs backed by SDB are placed in a general Dataset
+then the query is not efficiently executed by SDB.</p>
+<h2 id="using_the_jena_model_api_with_sdb">Using the Jena Model API with SDB</h2>
+<p>A Jena model can be connected to one graph in the store and used
+with all the Jena API operations.</p>
+<p>Here, the graph for the model is the the default graph:</p>
+<div class="codehilite"><pre>    <span class="n">Store</span> <span class="n">store</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectStore</span><span class="p">(</span><span class="s">&quot;sdb.ttl&quot;</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">Model</span> <span class="n">model</span> <span class="o">=</span> <span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectDefaultModel</span><span class="p">(</span><span class="n">store</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+
+    <span class="n">StmtIterator</span> <span class="n">sIter</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">listStatements</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+    <span class="k">for</span> <span class="p">(</span><span class="err"> </span><span class="p">;</span> <span class="n">sIter</span><span class="o">.</span><span class="n">hasNext</span><span class="p">()</span><span class="err"> </span><span class="p">;</span> <span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">Statement</span> <span class="n">stmt</span> <span class="o">=</span> <span class="n">sIter</span><span class="o">.</span><span class="n">nextStatement</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+        <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="n">stmt</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+    <span class="p">}</span>
+    <span class="n">sIter</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">store</span><span class="o">.</span><span class="nb">close</span><span class="p">()</span><span class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>SDB is optimized for SPARQL queries but queries and other Jena API
+operations can be mixed. The results from a SPARQL query are Jena
+RDFNodes, with the associated model having a graph implemented by
+SDB.</p>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br />
+        Apache Jena, Jena, the Apache Jena project logo,
+        Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>

Added: websites/staging/jena/trunk/content/jena/documentation/sdb/joseki_integration.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/sdb/joseki_integration.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/sdb/joseki_integration.html Tue Oct 25 22:41:28 2011
@@ -0,0 +1,228 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    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.
+-->
+
+  <link href="/jena/css/jena.css" rel="stylesheet" type="text/css">
+  <title>Apache Jena - SDB Joseki Integration</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <script src="/jena/js/jquery-1.6.4.min.js" type="text/javascript"></script>
+  <script src="/jena/js/jena-navigation.js" type="text/javascript"></script>
+</head>
+
+<body>
+  <div id="header">
+    <div id="logoblock">
+    <img alt="Apache Jena" src="/jena/images/jena-logo/jena-logo-small.png"/>
+    </div>
+
+    <div id="titleblock">
+      <h1 class="title">Apache Jena</h1>
+      <div id="topmenu" class="tabbar round-10">
+        <ul>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/index.html" id="home_menu">Home</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/help_and_support/index.html">Support</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/getting_started/index.html">Getting started</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/tutorials/index.html">Tutorials</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/documentation/index.html">Documentation</a></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+
+  <div id="navigation" class="clear">
+  <h1 id="quick_links">Quick links</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/download/index.html">Downloads</a></li>
+<li><a href="/jena/help_and_support/index.html">Help and support</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/getting_involved/index.html">Getting involved</a></li>
+<li><a href="/jena/documentation/">Documentation</a></li>
+</ul>
+<h1 id="about_jena">About Jena</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/about_jena/about.html">About Jena</a></li>
+<li><a href="/jena/about_jena/architecture.html">Architecture</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/about_jena/team.html">Project team</a></li>
+</ul>
+<h1 id="download">Download</h1>
+<ul>
+<li><a href="/jena/download/index.html">Downloading Jena</a></li>
+<li><a href="/jena/download/maven.html">Using Maven</a></li>
+<li><a href="/jena/download/osgi.html">Using OSGi</a></li>
+</ul>
+<h1 id="help_and_support">Help and support</h1>
+<ul>
+<li><a href="/jena/help_and_support/index.html">Getting help</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Bugs and suggestions</a></li>
+</ul>
+<h1 id="getting_started">Getting Started</h1>
+<ul>
+<li><a href="/jena/getting_started/index.html">A first Jena project</a></li>
+<li><a href="/jena/getting_started/rdf_api.html">RDF API overview</a></li>
+<li><a href="/jena/getting_started/sparql.html">Querying RDF with SPARQL</a></li>
+<li><a href="/jena/getting_started/fuseki.html">Serving RDF over HTTP</a></li>
+<li><a href="/jena/getting_started/tell_me_how.html">Tell me how to ...</a></li>
+</ul>
+<h1 id="tutorials">Tutorials</h1>
+<ul>
+<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<li><a href="/jena/tutorials/sparql.html">SPARQL queries</a></li>
+<li><a href="/jena/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
+</ul>
+<h1 id="documentation">Documentation</h1>
+<ul>
+<li><a href="/jena/documentation/index.html">Overview</a></li>
+<li><a href="/jena/documentation/javadoc">Javadoc</a></li>
+<li><a href="/jena/documentation/rdf/index.html">RDF</a></li>
+<li><a href="/jena/documentation/query/index.html">SPARQL (ARQ)</a></li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a></li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a><ul>
+<li><a href="/jena/documentation/sdb/installation.html">Installation</a></li>
+<li><a href="/jena/documentation/sdb/quickstart.html">Quick start</a></li>
+<li><a href="/jena/documentation/sdb/commands.html">Cmd line</a></li>
+<li><a href="/jena/documentation/sdb/javaapi.html">Java API</a></li>
+<li><a href="/jena/documentation/sdb/configuration.html">Config</a></li>
+<li><a href="/jena/documentation/sdb/databases_supported.html">Databases</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Serving Data</a></li>
+<li><a href="/jena/documentation/ontology/index.html">Ontology</a></li>
+<li><a href="/jena/documentation/inference/index.html">Inference</a></li>
+<li><a href="/jena/documentation/assembler/index.html">Assembler</a><ul>
+<li><a href="/jena/documentation/assembler/assembler-howto.html">Assembler how-to</a></li>
+<li><a href="/jena/documentation/assembler/inside-assemblers.html">Inside assemblers</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/io/index.html">I/O</a><ul>
+<li><a href="/jena/documentation/io/iohowto.html">I/O how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/notes/index.html">Notes</a><ul>
+<li><a href="/jena/documentation/notes/concurrency-howto.html">Concurrency how-to</a></li>
+<li><a href="/jena/documentation/notes/event-handler-howto.html">Event handler how-to</a></li>
+<li><a href="/jena/documentation/notes/file-manager.html">File manager how-to</a></li>
+<li><a href="/jena/documentation/notes/model-factory.html">Model factory how-to</a></li>
+<li><a href="/jena/documentation/notes/rdf-frames.html">RDF frames</a></li>
+<li><a href="/jena/documentation/notes/reification.html">Reification how-to</a></li>
+<li><a href="/jena/documentation/notes/typed-literals.html">Typed literals how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tools/index.html">Tools</a><ul>
+<li><a href="/jena/documentation/tools/schemagen.html">schemagen</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="getting_involved">Getting Involved</h1>
+<ul>
+<li><a href="/jena/getting_involved/index.html">Contributing to Jena</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+  </div>
+
+  <div id="content">
+    <h1 class="title">SDB Joseki Integration</h1>
+    <p><a href="http://www.joseki.org" title="http://www.joseki.org">Joseki</a> is a server
+that implements the SPARQL protocol for HTTP. It can be used to
+give a SPARQL interface to an SDB installation.</p>
+<p>The Joseki server needs the SDB jar files on its classpath. The
+Joseki configuration file needs to contain two triples to integrate
+SDB:</p>
+<div class="codehilite"><pre><span class="c1">## Initialize SDB.</span>
+<span class="o">[]</span> <span class="n">ja:loadClass</span> <span class="s">&quot;com.hp.hpl.jena.sdb.SDB&quot;</span> <span class="o">.</span>
+
+<span class="c1">## Declare that sdb:DatasetStore is an implementation of ja:RDFDataset .</span>
+<span class="n">sdb:DatasetStore</span> <span class="n">rdfs:subClassOf</span> <span class="n">ja:RDFDataset</span> <span class="o">.</span>
+</pre></div>
+
+
+<p>then a Joseki service can use an SBD-implemented dataset:</p>
+<div class="codehilite"><pre><span class="sr">&lt;#books&gt;</span> <span class="n">rdf:type</span> <span class="n">sdb:DatasetStore</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">sdb:store</span> <span class="sr">&lt;#store&gt;</span> <span class="o">.</span>
+
+ <span class="sr">&lt;#store&gt;</span> <span class="n">rdf:type</span> <span class="n">sdb:Store</span> <span class="err"> </span><span class="p">;</span>
+   <span class="n">rdfs:label</span> <span class="s">&quot;SDB&quot;</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">sdb:layout</span>         <span class="s">&quot;layout2&quot;</span><span class="err"> </span><span class="p">;</span>
+   <span class="n">sdb:connection</span>
+    <span class="p">[</span>  <span class="n">rdf:type</span> <span class="n">sdb:SDBConnection</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbType</span>        <span class="s">&quot;postgresql&quot;</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbHost</span>        <span class="s">&quot;localhost&quot;</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbName</span>        <span class="s">&quot;SDB&quot;</span><span class="err"> </span><span class="p">;</span>
+    <span class="p">]</span>
+    <span class="o">.</span>
+</pre></div>
+
+
+<p>To enable pooling of connections to the SDB store, use the
+joseki:poolSize property. This causes Joseki to create a pool of
+SDB datasets, each with it's own JDBC connection. This requires
+Joseki 3.2.</p>
+<div class="codehilite"><pre><span class="sr">&lt;#sdb&gt;</span> <span class="n">rdf:type</span> <span class="n">sdb:DatasetStore</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">joseki:poolSize</span>     <span class="mi">5</span><span class="err"> </span><span class="p">;</span>         <span class="c1"># Number of concurrent connections allowed to this dataset.</span>
+    <span class="n">sdb:store</span> <span class="sr">&lt;#store&gt;</span> <span class="o">.</span>
+</pre></div>
+
+
+<p>SDB 1.0:</p>
+<div class="codehilite"><pre><span class="c1">## Dataset in SDB.</span>
+<span class="sr">&lt;#books&gt;</span> <span class="n">rdf:type</span> <span class="n">sdb:DatasetStore</span> <span class="p">,</span> <span class="n">ja:RDFDataset</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">rdfs:label</span>       <span class="s">&quot;Books&quot;</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">sdb:layout</span>       <span class="s">&quot;layout2&quot;</span><span class="err"> </span><span class="p">;</span>
+    <span class="n">sdb:connection</span>
+    <span class="p">[</span>  <span class="n">rdf:type</span> <span class="n">sdb:SDBConnection</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbType</span>        <span class="s">&quot;postgresql&quot;</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbHost</span>        <span class="s">&quot;localhost&quot;</span><span class="err"> </span><span class="p">;</span>
+       <span class="n">sdb:sdbName</span>        <span class="s">&quot;SDB&quot;</span><span class="err"> </span><span class="p">;</span>
+    <span class="p">]</span>
+    <span class="o">.</span>
+</pre></div>
+
+
+<p>The database installation does not need to accept public requests,
+it needs only to be accessible to the Joseki server itself.</p>
+<p>There is an example configuration file for a Joseki server using
+SDB in the Joseki distribution.</p>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br />
+        Apache Jena, Jena, the Apache Jena project logo,
+        Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>

Added: websites/staging/jena/trunk/content/jena/documentation/sdb/loading_data.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/sdb/loading_data.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/sdb/loading_data.html Tue Oct 25 22:41:28 2011
@@ -0,0 +1,271 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    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.
+-->
+
+  <link href="/jena/css/jena.css" rel="stylesheet" type="text/css">
+  <title>Apache Jena - SDB Loading data</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <script src="/jena/js/jquery-1.6.4.min.js" type="text/javascript"></script>
+  <script src="/jena/js/jena-navigation.js" type="text/javascript"></script>
+</head>
+
+<body>
+  <div id="header">
+    <div id="logoblock">
+    <img alt="Apache Jena" src="/jena/images/jena-logo/jena-logo-small.png"/>
+    </div>
+
+    <div id="titleblock">
+      <h1 class="title">Apache Jena</h1>
+      <div id="topmenu" class="tabbar round-10">
+        <ul>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/index.html" id="home_menu">Home</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/help_and_support/index.html">Support</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/getting_started/index.html">Getting started</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/tutorials/index.html">Tutorials</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/documentation/index.html">Documentation</a></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+
+  <div id="navigation" class="clear">
+  <h1 id="quick_links">Quick links</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/download/index.html">Downloads</a></li>
+<li><a href="/jena/help_and_support/index.html">Help and support</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/getting_involved/index.html">Getting involved</a></li>
+<li><a href="/jena/documentation/">Documentation</a></li>
+</ul>
+<h1 id="about_jena">About Jena</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/about_jena/about.html">About Jena</a></li>
+<li><a href="/jena/about_jena/architecture.html">Architecture</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/about_jena/team.html">Project team</a></li>
+</ul>
+<h1 id="download">Download</h1>
+<ul>
+<li><a href="/jena/download/index.html">Downloading Jena</a></li>
+<li><a href="/jena/download/maven.html">Using Maven</a></li>
+<li><a href="/jena/download/osgi.html">Using OSGi</a></li>
+</ul>
+<h1 id="help_and_support">Help and support</h1>
+<ul>
+<li><a href="/jena/help_and_support/index.html">Getting help</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Bugs and suggestions</a></li>
+</ul>
+<h1 id="getting_started">Getting Started</h1>
+<ul>
+<li><a href="/jena/getting_started/index.html">A first Jena project</a></li>
+<li><a href="/jena/getting_started/rdf_api.html">RDF API overview</a></li>
+<li><a href="/jena/getting_started/sparql.html">Querying RDF with SPARQL</a></li>
+<li><a href="/jena/getting_started/fuseki.html">Serving RDF over HTTP</a></li>
+<li><a href="/jena/getting_started/tell_me_how.html">Tell me how to ...</a></li>
+</ul>
+<h1 id="tutorials">Tutorials</h1>
+<ul>
+<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<li><a href="/jena/tutorials/sparql.html">SPARQL queries</a></li>
+<li><a href="/jena/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
+</ul>
+<h1 id="documentation">Documentation</h1>
+<ul>
+<li><a href="/jena/documentation/index.html">Overview</a></li>
+<li><a href="/jena/documentation/javadoc">Javadoc</a></li>
+<li><a href="/jena/documentation/rdf/index.html">RDF</a></li>
+<li><a href="/jena/documentation/query/index.html">SPARQL (ARQ)</a></li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a></li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a><ul>
+<li><a href="/jena/documentation/sdb/installation.html">Installation</a></li>
+<li><a href="/jena/documentation/sdb/quickstart.html">Quick start</a></li>
+<li><a href="/jena/documentation/sdb/commands.html">Cmd line</a></li>
+<li><a href="/jena/documentation/sdb/javaapi.html">Java API</a></li>
+<li><a href="/jena/documentation/sdb/configuration.html">Config</a></li>
+<li><a href="/jena/documentation/sdb/databases_supported.html">Databases</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Serving Data</a></li>
+<li><a href="/jena/documentation/ontology/index.html">Ontology</a></li>
+<li><a href="/jena/documentation/inference/index.html">Inference</a></li>
+<li><a href="/jena/documentation/assembler/index.html">Assembler</a><ul>
+<li><a href="/jena/documentation/assembler/assembler-howto.html">Assembler how-to</a></li>
+<li><a href="/jena/documentation/assembler/inside-assemblers.html">Inside assemblers</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/io/index.html">I/O</a><ul>
+<li><a href="/jena/documentation/io/iohowto.html">I/O how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/notes/index.html">Notes</a><ul>
+<li><a href="/jena/documentation/notes/concurrency-howto.html">Concurrency how-to</a></li>
+<li><a href="/jena/documentation/notes/event-handler-howto.html">Event handler how-to</a></li>
+<li><a href="/jena/documentation/notes/file-manager.html">File manager how-to</a></li>
+<li><a href="/jena/documentation/notes/model-factory.html">Model factory how-to</a></li>
+<li><a href="/jena/documentation/notes/rdf-frames.html">RDF frames</a></li>
+<li><a href="/jena/documentation/notes/reification.html">Reification how-to</a></li>
+<li><a href="/jena/documentation/notes/typed-literals.html">Typed literals how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tools/index.html">Tools</a><ul>
+<li><a href="/jena/documentation/tools/schemagen.html">schemagen</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="getting_involved">Getting Involved</h1>
+<ul>
+<li><a href="/jena/getting_involved/index.html">Contributing to Jena</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+  </div>
+
+  <div id="content">
+    <h1 class="title">SDB Loading data</h1>
+    <p>There are three ways to load data into SDB:</p>
+<ol>
+<li>Use the command utility
+    <a href="commands.html#Loading_data" title="SDB/Commands">sdbload</a></li>
+<li>Use one of the Jena <code>model.read</code> operations</li>
+<li>Use the Jena <code>model.add</code></li>
+</ol>
+<p>The last one of these requires the application to signal the
+beginning and end of batches.</p>
+<h2 id="loading_with_modelread">Loading with <code>Model.read</code></h2>
+<p>A Jena Model obtained from SDB via:</p>
+<div class="codehilite"><pre><span class="n">SDBFactory</span><span class="o">.</span><span class="n">connectModel</span><span class="p">(</span><span class="n">store</span><span class="p">)</span>
+</pre></div>
+
+
+<p>will automatically bulk load data for each call of one of the
+<code>Model.read</code> operations.</p>
+<h2 id="loading_with_modeladd">Loading with <code>Model.add</code></h2>
+<p>The <code>Model.add</code> operations, in any form or combination of forms,
+whether loading a single statement, list of statements, or another
+model, will invoke the bulk loader if previously notified before an
+add operation.</p>
+<p>You can also explicitly delimit bulk operations:</p>
+<div class="codehilite"><pre> <span class="n">model</span><span class="o">.</span><span class="n">notifyEvent</span><span class="p">(</span><span class="n">GraphEvents</span><span class="o">.</span><span class="n">startRead</span><span class="p">)</span>
+ <span class="o">...</span> <span class="k">do</span> <span class="n">add</span><span class="o">/</span><span class="n">remove</span> <span class="n">operations</span> <span class="o">...</span>
+ <span class="n">model</span><span class="o">.</span><span class="n">notifyEvent</span><span class="p">(</span><span class="n">GraphEvents</span><span class="o">.</span><span class="n">finishRead</span><span class="p">)</span>
+</pre></div>
+
+
+<p><strong>Failing to notify the end of the operations will result in data loss</strong>.</p>
+<p>A try/finally block can ensure that the finish is notified.</p>
+<div class="codehilite"><pre> <span class="n">model</span><span class="o">.</span><span class="n">notifyEvent</span><span class="p">(</span><span class="n">GraphEvents</span><span class="o">.</span><span class="n">startRead</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+ <span class="n">try</span> <span class="p">{</span>
+    <span class="o">...</span> <span class="k">do</span> <span class="n">add</span><span class="o">/</span><span class="n">remove</span> <span class="n">operations</span> <span class="o">...</span>
+ <span class="p">}</span> <span class="n">finally</span> <span class="p">{</span>
+   <span class="n">model</span><span class="o">.</span><span class="n">notifyEvent</span><span class="p">(</span><span class="n">GraphEvents</span><span class="o">.</span><span class="n">finishRead</span><span class="p">)</span><span class="err"> </span><span class="p">;</span>
+ <span class="p">}</span>
+</pre></div>
+
+
+<p>The <code>model.read</code> operations do this automatically.</p>
+<p>The bulk loader will automatically chunk large sequences of
+additions to sizes appropriate to the underlying database. The bulk
+loader is threaded with double-buffered; loading to the database
+happens in parallel to the application thread and any RDF parsing.</p>
+<h2 id="how_the_loader_works">How the loader works</h2>
+<p>Loading consists of two phases: in the java VM, and on the database
+itself. The SDB loader takes incoming triples and breaks them down
+into components ready for the database. These prepared triples are
+added to a queue for the database phase, which (by default) takes
+place on a separate thread. When the number of triples reaches a
+limit (default 20,000), or finish update is signalled, the triples
+are passed to the database.</p>
+<p>You can configure whether to use threading and the 'chunk size' --
+the number of triples per load event -- via <code>StoreLoader</code>.</p>
+<div class="codehilite"><pre><span class="n">Store</span> <span class="n">store</span><span class="p">;</span> <span class="sr">//</span> <span class="n">SDB</span> <span class="n">Store</span>
+<span class="o">...</span>
+<span class="n">store</span><span class="o">.</span><span class="n">getLoader</span><span class="p">()</span><span class="o">.</span><span class="n">setChunkSize</span><span class="p">(</span><span class="mi">5000</span><span class="p">);</span> <span class="sr">//</span>
+<span class="n">store</span><span class="o">.</span><span class="n">getLoader</span><span class="p">()</span><span class="o">.</span><span class="n">setUseThreading</span><span class="p">(</span><span class="n">false</span><span class="p">);</span> <span class="sr">//</span> <span class="n">Don</span><span class="err">&#39;</span><span class="n">t</span> <span class="n">thread</span>
+</pre></div>
+
+
+<p>You should set these <em>before</em> the loader has been used.</p>
+<p>Each loader sets up two temporary tables (<code>NNode</code> and <code>NTrip</code>) that
+mirror <code>Nodes</code> and <code>Triples</code> tables. These tables are virtually
+identical, except that a) they are not indexed and b) for the index
+variant there is no index column for nodes.</p>
+<p>When loading prepared triples -- triples that have been broken down
+ready for the database -- are passed to the loader core (normally
+running on a different thread). When the chunk size is reached, or
+we are out of triples, the following happens:</p>
+<ul>
+<li>Prepared nodes are added in one go to <code>NNode</code>. Duplicate nodes
+    within a chunk are suppressed on the java side (this is worth doing
+    since they are quite common, e.g. properties).</li>
+<li>Prepared triples are added in one go to <code>NTrip</code>.</li>
+<li>New nodes are added to the node table (duplicate suppression is
+    explained below).</li>
+<li>New triples are added to the triple table (once again
+    suppressing dupes). For the index case this involves joining on the
+    node table to do a hash to index lookup.</li>
+<li>We commit.</li>
+<li>If anything goes wrong the transaction (the chunk) is rolled
+    back, and an exception is thrown (or readied for throwing on the
+    calling thread).</li>
+</ul>
+<p>Thus there are five calls to the database for every chunk. The
+database handles almost all of the work uninterrupted (duplicate
+suppression, hash to index lookup), which makes loading reasonably
+quick.</p>
+<h2 id="duplicate_suppression">Duplicate Suppression</h2>
+<p>MySQL has a very useful <code>INSERT IGNORE</code>, which will keep going,
+skipping an offending row if a uniqueness constraint is violated.
+For other databases we need something else.</p>
+<p>Having tried a number of options the best seems to be to <code>INSERT</code>
+new items by <code>LEFT JOIN</code> new items to existing items, then
+filtering <code>WHERE (existing item feature) IS NULL</code>. Specifically,
+for the triple hash case (where no id lookups are needed):</p>
+<div class="codehilite"><pre><span class="n">INSERT</span> <span class="n">INTO</span> <span class="n">Triples</span>
+<span class="n">SELECT</span> <span class="n">DISTINCT</span> <span class="n">NTrip</span><span class="o">.</span><span class="n">s</span><span class="p">,</span> <span class="n">NTrip</span><span class="o">.</span><span class="n">p</span><span class="p">,</span> <span class="n">NTrip</span><span class="o">.</span><span class="n">o</span> <span class="o">--</span> <span class="n">DISTINCT</span> <span class="n">because</span> <span class="k">new</span> <span class="n">nodes</span> <span class="n">may</span> <span class="n">contain</span> <span class="n">duplicates</span> <span class="p">(</span><span class="ow">not</span> <span class="n">so</span> <span class="k">for</span> <span class="n">nodes</span><span class="p">)</span>
+<span class="n">NTrip</span> <span class="n">LEFT</span> <span class="n">JOIN</span> <span class="n">Triples</span> <span class="n">ON</span> <span class="p">(</span><span class="n">NTrip</span><span class="o">.</span><span class="n">s</span><span class="o">=</span><span class="n">Triples</span><span class="o">.</span><span class="n">s</span> <span class="n">AND</span> <span class="n">NTrip</span><span class="o">.</span><span class="n">p</span><span class="o">=</span><span class="n">Triples</span><span class="o">.</span><span class="n">p</span> <span class="n">AND</span> <span class="n">NTrip</span><span class="o">.</span><span class="n">o</span><span class="o">=</span><span class="n">Triples</span><span class="o">.</span><span class="n">o</span><span class="p">)</span>
+<span class="n">WHERE</span> <span class="n">Triples</span><span class="o">.</span><span class="n">s</span> <span class="n">IS</span> <span class="n">NULL</span> <span class="n">OR</span> <span class="n">Triples</span><span class="o">.</span><span class="n">p</span> <span class="n">IS</span> <span class="n">NULL</span> <span class="n">OR</span> <span class="n">Triples</span><span class="o">.</span><span class="n">o</span> <span class="n">IS</span> <span class="n">NULL</span>
+</pre></div>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br />
+        Apache Jena, Jena, the Apache Jena project logo,
+        Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>

Added: websites/staging/jena/trunk/content/jena/documentation/sdb/loading_performance.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/sdb/loading_performance.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/sdb/loading_performance.html Tue Oct 25 22:41:28 2011
@@ -0,0 +1,333 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    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.
+-->
+
+  <link href="/jena/css/jena.css" rel="stylesheet" type="text/css">
+  <title>Apache Jena - SDB Loading performance</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <script src="/jena/js/jquery-1.6.4.min.js" type="text/javascript"></script>
+  <script src="/jena/js/jena-navigation.js" type="text/javascript"></script>
+</head>
+
+<body>
+  <div id="header">
+    <div id="logoblock">
+    <img alt="Apache Jena" src="/jena/images/jena-logo/jena-logo-small.png"/>
+    </div>
+
+    <div id="titleblock">
+      <h1 class="title">Apache Jena</h1>
+      <div id="topmenu" class="tabbar round-10">
+        <ul>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/index.html" id="home_menu">Home</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/help_and_support/index.html">Support</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/getting_started/index.html">Getting started</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/tutorials/index.html">Tutorials</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/documentation/index.html">Documentation</a></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+
+  <div id="navigation" class="clear">
+  <h1 id="quick_links">Quick links</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/download/index.html">Downloads</a></li>
+<li><a href="/jena/help_and_support/index.html">Help and support</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/getting_involved/index.html">Getting involved</a></li>
+<li><a href="/jena/documentation/">Documentation</a></li>
+</ul>
+<h1 id="about_jena">About Jena</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/about_jena/about.html">About Jena</a></li>
+<li><a href="/jena/about_jena/architecture.html">Architecture</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/about_jena/team.html">Project team</a></li>
+</ul>
+<h1 id="download">Download</h1>
+<ul>
+<li><a href="/jena/download/index.html">Downloading Jena</a></li>
+<li><a href="/jena/download/maven.html">Using Maven</a></li>
+<li><a href="/jena/download/osgi.html">Using OSGi</a></li>
+</ul>
+<h1 id="help_and_support">Help and support</h1>
+<ul>
+<li><a href="/jena/help_and_support/index.html">Getting help</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Bugs and suggestions</a></li>
+</ul>
+<h1 id="getting_started">Getting Started</h1>
+<ul>
+<li><a href="/jena/getting_started/index.html">A first Jena project</a></li>
+<li><a href="/jena/getting_started/rdf_api.html">RDF API overview</a></li>
+<li><a href="/jena/getting_started/sparql.html">Querying RDF with SPARQL</a></li>
+<li><a href="/jena/getting_started/fuseki.html">Serving RDF over HTTP</a></li>
+<li><a href="/jena/getting_started/tell_me_how.html">Tell me how to ...</a></li>
+</ul>
+<h1 id="tutorials">Tutorials</h1>
+<ul>
+<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<li><a href="/jena/tutorials/sparql.html">SPARQL queries</a></li>
+<li><a href="/jena/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
+</ul>
+<h1 id="documentation">Documentation</h1>
+<ul>
+<li><a href="/jena/documentation/index.html">Overview</a></li>
+<li><a href="/jena/documentation/javadoc">Javadoc</a></li>
+<li><a href="/jena/documentation/rdf/index.html">RDF</a></li>
+<li><a href="/jena/documentation/query/index.html">SPARQL (ARQ)</a></li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a></li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a><ul>
+<li><a href="/jena/documentation/sdb/installation.html">Installation</a></li>
+<li><a href="/jena/documentation/sdb/quickstart.html">Quick start</a></li>
+<li><a href="/jena/documentation/sdb/commands.html">Cmd line</a></li>
+<li><a href="/jena/documentation/sdb/javaapi.html">Java API</a></li>
+<li><a href="/jena/documentation/sdb/configuration.html">Config</a></li>
+<li><a href="/jena/documentation/sdb/databases_supported.html">Databases</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Serving Data</a></li>
+<li><a href="/jena/documentation/ontology/index.html">Ontology</a></li>
+<li><a href="/jena/documentation/inference/index.html">Inference</a></li>
+<li><a href="/jena/documentation/assembler/index.html">Assembler</a><ul>
+<li><a href="/jena/documentation/assembler/assembler-howto.html">Assembler how-to</a></li>
+<li><a href="/jena/documentation/assembler/inside-assemblers.html">Inside assemblers</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/io/index.html">I/O</a><ul>
+<li><a href="/jena/documentation/io/iohowto.html">I/O how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/notes/index.html">Notes</a><ul>
+<li><a href="/jena/documentation/notes/concurrency-howto.html">Concurrency how-to</a></li>
+<li><a href="/jena/documentation/notes/event-handler-howto.html">Event handler how-to</a></li>
+<li><a href="/jena/documentation/notes/file-manager.html">File manager how-to</a></li>
+<li><a href="/jena/documentation/notes/model-factory.html">Model factory how-to</a></li>
+<li><a href="/jena/documentation/notes/rdf-frames.html">RDF frames</a></li>
+<li><a href="/jena/documentation/notes/reification.html">Reification how-to</a></li>
+<li><a href="/jena/documentation/notes/typed-literals.html">Typed literals how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tools/index.html">Tools</a><ul>
+<li><a href="/jena/documentation/tools/schemagen.html">schemagen</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="getting_involved">Getting Involved</h1>
+<ul>
+<li><a href="/jena/getting_involved/index.html">Contributing to Jena</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+  </div>
+
+  <div id="content">
+    <h1 class="title">SDB Loading performance</h1>
+    <ul>
+<li><a href="#Introduction">Introduction</a></li>
+<li><a href="#The_Databases_and_Hardware">The Databases and Hardware</a><ul>
+<li><a href="#Hardware">Hardware</a></li>
+<li><a href="#Windows_setup">Windows setup</a></li>
+<li><a href="#Linux_setup">Linux setup</a></li>
+</ul>
+</li>
+<li><a href="#The_Dataset_and_Queries">The Dataset and Queries</a><ul>
+<li><a href="#LUBM">LUBM</a></li>
+<li><a href="#dbpedia">dbpedia</a></li>
+</ul>
+</li>
+<li><a href="#Loading">Loading</a></li>
+<li><a href="#Results">Results</a></li>
+<li><a href="#Uniprot_700m_loading:_Tuning_Helps">Uniprot 700m loading: Tuning Helps</a></li>
+</ul>
+<h2 id="introduction">Introduction</h2>
+<p>Performance reporting is an area prone to misinterpretation, and
+such reports should be liberally decorated with disclaimers. In our
+case there are an alarming number of variables: the hardware, the
+operating system, the database engine and its myriad parameters,
+the data itself, the queries, and planetary alignment.</p>
+<p>Given this here is some basic information. You may find it
+sufficient:</p>
+<ul>
+<li>Loading speed will be in the thousands of triples per second
+    range. Expect to load around 5 million triples per hour.</li>
+<li>Index layout is usually better than hash for loading speed.
+    Hash loading is very bad on MySQL.</li>
+<li>Hash layout is better for query speed.</li>
+</ul>
+<p>We suggest that you don't choose your database based on these
+figures. The performance is broadly similar, so if you already have
+a relational database installed this is your best option.</p>
+<h2 id="the_databases_and_hardware">The Databases and Hardware</h2>
+<p>SDB supports a range of databases, but the figures here are limited
+to SQLServer and Postgresql. The hardware used was identical,
+although running linux (for Postgresql) and windows (for
+SQLServer).</p>
+<h3 id="hardware">Hardware</h3>
+<ul>
+<li>Dual AMD Opteron processors, 64 bit, 1.8 GHz.</li>
+<li>8 GB memory.</li>
+<li>80 GB disk for database.</li>
+</ul>
+<h3 id="windows_setup">Windows setup</h3>
+<ul>
+<li>Windows server 2003</li>
+<li>Java 6 64 bit</li>
+<li>SQLServer 2005</li>
+</ul>
+<h3 id="linux_setup">Linux setup</h3>
+<ul>
+<li>Redhat Enterprise Linux 4</li>
+<li>Java 6 64 bit</li>
+<li>Postgresql 8.2</li>
+</ul>
+<h2 id="the_dataset_and_queries">The Dataset and Queries</h2>
+<p>We use the Lehigh University Benchmark
+<a href="http://swat.cse.lehigh.edu/projects/lubm/" title="http://swat.cse.lehigh.edu/projects/lubm/">http://swat.cse.lehigh.edu/projects/lubm/</a>
+and dbpedia
+<a href="http://dbpedia.org/" title="http://dbpedia.org/">http://dbpedia.org/</a>,
+together with some example queries that each provides. You can find
+the queries in SDB/PerfTests.</p>
+<h3 id="lubm">LUBM</h3>
+<p>LUBM generates artifical datasets. To be useful one needs to apply
+reasoning, and this was done in advance of loading. The queries are
+quite stressful for SDB in that they are not very ground (in many
+neither subjects nor objects are present), and many produce very
+large result sets. Thus they are probably atypical of many SPARQL
+queries.</p>
+<ul>
+<li>Size: 19 million triples (including inferred triples).</li>
+</ul>
+<h3 id="dbpedia">dbpedia</h3>
+<p>The dbpedia queries are, unlike LUBM, quite ground. dbpedia
+contains many large literals, in contrast to LUBM.</p>
+<ul>
+<li>Size: 25 million triples.</li>
+</ul>
+<h2 id="loading">Loading</h2>
+<p>All operations were performed using SDB's command line tools. The
+data was loaded into a freshly formatted SDB store -- although
+postgresql needs an ANALYSE to avoid silly planning -- then the
+additional indexes were added.</p>
+<h2 id="results">Results</h2>
+<table>
+<thead>
+<tr>
+<th>Benchmark</th>
+<th>Database loading Speed (tps)</th>
+<th>Index time (s)</th>
+<th>Size (MB)</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>LUBM Postgres (Hash)</td>
+<td>4972</td>
+<td>199</td>
+<td>5124</td>
+</tr>
+<tr>
+<td>LUBM Postgres (Index)</td>
+<td>8658</td>
+<td>176</td>
+<td>3666</td>
+</tr>
+<tr>
+<td>LUBM SQLServer (Hash)</td>
+<td>8762</td>
+<td>121</td>
+<td>3200</td>
+</tr>
+<tr>
+<td>LUBM SQLServer (Index)</td>
+<td>7419</td>
+<td>68</td>
+<td>2029</td>
+</tr>
+<tr>
+<td>DBpedia Postgres (Hash)</td>
+<td>3029</td>
+<td>298</td>
+<td>10193</td>
+</tr>
+<tr>
+<td>DBpedia Postgres (Index)</td>
+<td>4293</td>
+<td>227</td>
+<td>6251</td>
+</tr>
+<tr>
+<td>DBpedia SQLServer (Hash)</td>
+<td>5345</td>
+<td>162</td>
+<td>6349</td>
+</tr>
+<tr>
+<td>DBpedia SQLServer (Index)</td>
+<td>4749</td>
+<td>110</td>
+<td>4930</td>
+</tr>
+</tbody>
+</table>
+<h2 id="uniprot_700m_loading_tuning_helps">Uniprot 700m loading: Tuning Helps</h2>
+<p>To illustrate the variability in loading speed, and emphasise the
+importance of tuning, consider the case of Uniprot
+<a href="http://dev.isb-sib.ch/projects/uniprot-rdf/" title="http://dev.isb-sib.ch/projects/uniprot-rdf/">http://dev.isb-sib.ch/projects/uniprot-rdf/</a>.
+Uniprot contains (at the time of writing) around 700 million
+triples. We loaded these on to the SQLServer setup given above, but
+with the following changes:</p>
+<ul>
+<li>The database was stored on a separate disk.</li>
+<li>The database's transactional logs were stored on yet another
+    disk.</li>
+</ul>
+<p>So the rdf data, database data, and log data were all on distinct
+disks.</p>
+<p>Loading into an index-layout store proceeded at:</p>
+<ul>
+<li>11079 triples per second</li>
+</ul>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br />
+        Apache Jena, Jena, the Apache Jena project logo,
+        Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>

Added: websites/staging/jena/trunk/content/jena/documentation/sdb/query.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/sdb/query.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/sdb/query.html Tue Oct 25 22:41:28 2011
@@ -0,0 +1,173 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    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.
+-->
+
+  <link href="/jena/css/jena.css" rel="stylesheet" type="text/css">
+  <title>Apache Jena - SDB Query</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <script src="/jena/js/jquery-1.6.4.min.js" type="text/javascript"></script>
+  <script src="/jena/js/jena-navigation.js" type="text/javascript"></script>
+</head>
+
+<body>
+  <div id="header">
+    <div id="logoblock">
+    <img alt="Apache Jena" src="/jena/images/jena-logo/jena-logo-small.png"/>
+    </div>
+
+    <div id="titleblock">
+      <h1 class="title">Apache Jena</h1>
+      <div id="topmenu" class="tabbar round-10">
+        <ul>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/index.html" id="home_menu">Home</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/help_and_support/index.html">Support</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/getting_started/index.html">Getting started</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/tutorials/index.html">Tutorials</a></li>
+        <li class="round-top-8"><a class="round-top-8" href="/jena/documentation/index.html">Documentation</a></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+
+  <div id="navigation" class="clear">
+  <h1 id="quick_links">Quick links</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/download/index.html">Downloads</a></li>
+<li><a href="/jena/help_and_support/index.html">Help and support</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/getting_involved/index.html">Getting involved</a></li>
+<li><a href="/jena/documentation/">Documentation</a></li>
+</ul>
+<h1 id="about_jena">About Jena</h1>
+<ul>
+<li><a href="/jena/index.html">Home</a></li>
+<li><a href="/jena/about_jena/about.html">About Jena</a></li>
+<li><a href="/jena/about_jena/architecture.html">Architecture</a></li>
+<li><a href="/jena/about_jena/roadmap.html">Roadmap</a></li>
+<li><a href="/jena/about_jena/team.html">Project team</a></li>
+</ul>
+<h1 id="download">Download</h1>
+<ul>
+<li><a href="/jena/download/index.html">Downloading Jena</a></li>
+<li><a href="/jena/download/maven.html">Using Maven</a></li>
+<li><a href="/jena/download/osgi.html">Using OSGi</a></li>
+</ul>
+<h1 id="help_and_support">Help and support</h1>
+<ul>
+<li><a href="/jena/help_and_support/index.html">Getting help</a></li>
+<li><a href="/jena/help_and_support/bugs_and_suggestions.html">Bugs and suggestions</a></li>
+</ul>
+<h1 id="getting_started">Getting Started</h1>
+<ul>
+<li><a href="/jena/getting_started/index.html">A first Jena project</a></li>
+<li><a href="/jena/getting_started/rdf_api.html">RDF API overview</a></li>
+<li><a href="/jena/getting_started/sparql.html">Querying RDF with SPARQL</a></li>
+<li><a href="/jena/getting_started/fuseki.html">Serving RDF over HTTP</a></li>
+<li><a href="/jena/getting_started/tell_me_how.html">Tell me how to ...</a></li>
+</ul>
+<h1 id="tutorials">Tutorials</h1>
+<ul>
+<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<li><a href="/jena/tutorials/sparql.html">SPARQL queries</a></li>
+<li><a href="/jena/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
+</ul>
+<h1 id="documentation">Documentation</h1>
+<ul>
+<li><a href="/jena/documentation/index.html">Overview</a></li>
+<li><a href="/jena/documentation/javadoc">Javadoc</a></li>
+<li><a href="/jena/documentation/rdf/index.html">RDF</a></li>
+<li><a href="/jena/documentation/query/index.html">SPARQL (ARQ)</a></li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a></li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a><ul>
+<li><a href="/jena/documentation/sdb/installation.html">Installation</a></li>
+<li><a href="/jena/documentation/sdb/quickstart.html">Quick start</a></li>
+<li><a href="/jena/documentation/sdb/commands.html">Cmd line</a></li>
+<li><a href="/jena/documentation/sdb/javaapi.html">Java API</a></li>
+<li><a href="/jena/documentation/sdb/configuration.html">Config</a></li>
+<li><a href="/jena/documentation/sdb/databases_supported.html">Databases</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Serving Data</a></li>
+<li><a href="/jena/documentation/ontology/index.html">Ontology</a></li>
+<li><a href="/jena/documentation/inference/index.html">Inference</a></li>
+<li><a href="/jena/documentation/assembler/index.html">Assembler</a><ul>
+<li><a href="/jena/documentation/assembler/assembler-howto.html">Assembler how-to</a></li>
+<li><a href="/jena/documentation/assembler/inside-assemblers.html">Inside assemblers</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/io/index.html">I/O</a><ul>
+<li><a href="/jena/documentation/io/iohowto.html">I/O how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/notes/index.html">Notes</a><ul>
+<li><a href="/jena/documentation/notes/concurrency-howto.html">Concurrency how-to</a></li>
+<li><a href="/jena/documentation/notes/event-handler-howto.html">Event handler how-to</a></li>
+<li><a href="/jena/documentation/notes/file-manager.html">File manager how-to</a></li>
+<li><a href="/jena/documentation/notes/model-factory.html">Model factory how-to</a></li>
+<li><a href="/jena/documentation/notes/rdf-frames.html">RDF frames</a></li>
+<li><a href="/jena/documentation/notes/reification.html">Reification how-to</a></li>
+<li><a href="/jena/documentation/notes/typed-literals.html">Typed literals how-to</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tools/index.html">Tools</a><ul>
+<li><a href="/jena/documentation/tools/schemagen.html">schemagen</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="getting_involved">Getting Involved</h1>
+<ul>
+<li><a href="/jena/getting_involved/index.html">Contributing to Jena</a></li>
+</ul>
+<h1 id="asf_links">ASF links</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/licenses/LICENSE-2.0">License</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+<li><a href="http://www.apache.org/security/">Security</a></li>
+</ul>
+  </div>
+
+  <div id="content">
+    <h1 class="title">SDB Query</h1>
+    <p>SDB supports various layouts but the overall process of compiling a
+query is common to all layouts. Each layout provides the concrete,
+basic steps in mapping a query into the concrete database details.</p>
+<p><code>sdbquery</code> can be used to print out the SQL that would be used for
+a query.</p>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011 The Apache Software Foundation, Licensed under
+        the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+        <br />
+        Apache Jena, Jena, the Apache Jena project logo,
+        Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>



Mime
View raw message