jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1019790 - in /websites/staging/jena/trunk/content: ./ documentation/tdb/datasets.html
Date Thu, 19 Oct 2017 13:24:51 GMT
Author: buildbot
Date: Thu Oct 19 13:24:51 2017
New Revision: 1019790

Log:
Staging update by buildbot for jena

Modified:
    websites/staging/jena/trunk/content/   (props changed)
    websites/staging/jena/trunk/content/documentation/tdb/datasets.html

Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Oct 19 13:24:51 2017
@@ -1 +1 @@
-1812613
+1812641

Modified: websites/staging/jena/trunk/content/documentation/tdb/datasets.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/tdb/datasets.html (original)
+++ websites/staging/jena/trunk/content/documentation/tdb/datasets.html Thu Oct 19 13:24:51
2017
@@ -224,6 +224,24 @@ graph or default model obtained with dat
 <p>The RDF merge of all named graph can be accessed as the named graph
 <code>urn:x-arq:UnionGraph</code> using
 <code>Dataset.getNamedModel("urn:x-arq:UnionGraph")</code> .</p>
+<h2 id="dataset-inferencing">Dataset Inferencing<a class="headerlink" href="#dataset-inferencing"
title="Permanent link">&para;</a></h2>
+<p>Inferencing on a Model in a Dataset, using the <a href="java_api.html">TDB
Java API</a>, follows the same pattern as an in-memory InfModel.
+The use of <a href="tdb_transactions.html">TDB Transactions</a> is <strong>strongly</strong>
recommended to avoid data corruption.</p>
+<div class="codehilite"><pre>  <span class="o">//</span><span
class="n">Open</span> <span class="n">TDB</span> <span class="n">Dataset</span>
+  <span class="n">String</span> <span class="n">directory</span>
<span class="p">=</span> <span class="p">...</span>
+  <span class="n">Dataset</span> <span class="n">dataset</span> <span
class="p">=</span> <span class="n">TDBFactory</span><span class="p">.</span><span
class="n">createDataset</span><span class="p">(</span><span class="n">directory</span><span
class="p">);</span>
+
+  <span class="o">//</span><span class="n">Retrieve</span> <span
class="n">Named</span> <span class="n">Graph</span> <span class="n">from</span>
<span class="n">Dataset</span><span class="p">,</span> <span class="n">or</span>
<span class="n">use</span> <span class="n">Default</span> <span
class="n">Graph</span><span class="p">.</span>
+  <span class="n">String</span> <span class="n">graphURI</span> <span
class="p">=</span> &quot;<span class="n">http</span><span class="p">:</span><span
class="o">//</span><span class="n">example</span><span class="p">.</span><span
class="n">org</span><span class="o">/</span><span class="n">myGraph</span>&quot;<span
class="p">;</span>
+  <span class="n">Model</span> <span class="n">model</span> <span
class="p">=</span> <span class="n">dataset</span><span class="p">.</span><span
class="n">getNamedModel</span><span class="p">(</span><span class="n">graphURI</span><span
class="p">);</span>
+
+  <span class="o">//</span><span class="n">Create</span> <span
class="n">RDFS</span> <span class="n">Inference</span> <span class="n">Model</span><span
class="p">,</span> <span class="n">or</span> <span class="n">use</span>
<span class="n">other</span> <span class="n">Reasoner</span> <span
class="n">e</span><span class="p">.</span><span class="n">g</span><span
class="p">.</span> <span class="n">OWL</span><span class="p">.</span>
+  <span class="n">InfModel</span> <span class="n">infModel</span>
<span class="p">=</span> <span class="n">ModelFactory</span><span
class="p">.</span><span class="n">createRDFSModel</span><span class="p">(</span><span
class="n">model</span><span class="p">);</span>
+
+  <span class="p">...</span>
+  <span class="o">//</span><span class="n">Perform</span> <span
class="n">operations</span> <span class="n">on</span> <span class="n">infModel</span><span
class="p">.</span>
+  <span class="p">...</span>
+</pre></div>
   </div>
 </div>
 



Mime
View raw message