You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by bu...@apache.org on 2014/07/30 14:40:37 UTC

svn commit: r917940 - in /websites/staging/jena/trunk/content: ./ documentation/inference/index.html

Author: buildbot
Date: Wed Jul 30 12:40:36 2014
New Revision: 917940

Log:
Staging update by buildbot for jena

Modified:
    websites/staging/jena/trunk/content/   (props changed)
    websites/staging/jena/trunk/content/documentation/inference/index.html

Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul 30 12:40:36 2014
@@ -1 +1 @@
-1614632
+1614636

Modified: websites/staging/jena/trunk/content/documentation/inference/index.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/inference/index.html (original)
+++ websites/staging/jena/trunk/content/documentation/inference/index.html Wed Jul 30 12:40:36 2014
@@ -246,8 +246,8 @@
 <h4 id="finding-a-reasoner">Finding a reasoner</h4>
 <p><p>For each type of reasoner there is a factory class (which conforms to the interface
   <code><a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/ReasonerFactory.html">ReasonerFactory</a></code>)
-  an instance of which can be used to create instances of the <code>associated
-  <a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/Reasoner.html">Reasoner</a></code>.
+  an instance of which can be used to create instances of the associated
+  <code><a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/Reasoner.html">Reasoner</a></code>.
   The factory instances can be located by going directly to a known factory class
   and using the static <code>theInstance</code>() method or by retrieval from
   a global <code><a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/ReasonerRegistry.html">ReasonerRegistry</a></code>
@@ -332,7 +332,7 @@
 <p>Now we can create an inference model which performs RDFS inference over this
   data by using:</p>
 
-<div class="codehilite"><pre><span class="n">InfModel</span> <span class="nb">inf</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">rdfsExample</span><span class="p">);</span>  <span class="o">//</span> <span class="o">\</span><span class="p">[</span>1<span class="o">\</span><span class="p">]</span>
+<div class="codehilite"><pre><span class="n">InfModel</span> <span class="nb">inf</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">rdfsExample</span><span class="p">);</span>  <span class="o">//</span> <span class="p">[</span>1<span class="p">]</span>
 </pre></div>
 
 
@@ -353,7 +353,7 @@
   in the statements directly to that model.</p>
 
 <p>If we wanted to use a different reasoner which is not available as a convenience
-  method or wanted to configure one we would change line \[1\]. For example, to
+  method or wanted to configure one we would change line [1]. For example, to
   create the same set up manually we could replace \[1\] by:</p>
 
 <div class="codehilite"><pre><span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">ReasonerRegistry</span><span class="p">.</span><span class="n">getRDFSReasoner</span><span class="p">();</span>
@@ -361,12 +361,12 @@
 </pre></div>
 
 
-<p>or even more manually by<br>
-</p>
+<p>or even more manually by</p>
+
+<div class="codehilite"><pre><span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">RDFSRuleReasonerFactory</span><span class="p">.</span><span class="n">theInstance</span><span class="p">().</span><span class="n">create</span><span class="p">(</span><span class="n">null</span><span class="p">);</span>
+<span class="n">InfModel</span> <span class="nb">inf</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createInfModel</span><span class="p">(</span><span class="n">reasoner</span><span class="p">,</span> <span class="n">rdfsExample</span><span class="p">);</span>
+</pre></div>
 
-<pre>    Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null);
-    InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</pre>
 
 <p>The purpose of creating a new reasoner instance like this variant would be
   to enable configuration parameters to be set. For example, if we were to listStatements
@@ -376,32 +376,35 @@
   the processing level parameter by creating a description of a new reasoner configuration
   and passing that to the factory method:</p>
 
-<pre>    Resource config = ModelFactory.createDefaultModel()
-                      .createResource()
-                      .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "simple");
-    Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(config);
-    InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</pre>
+<div class="codehilite"><pre><span class="n">Resource</span> <span class="n">config</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createDefaultModel</span><span class="p">()</span>
+                              <span class="p">.</span><span class="n">createResource</span><span class="p">()</span>
+                              <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">PROPsetRDFSLevel</span><span class="p">,</span> &quot;<span class="n">simple</span>&quot;<span class="p">);</span>
+<span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">RDFSRuleReasonerFactory</span><span class="p">.</span><span class="n">theInstance</span><span class="p">().</span><span class="n">create</span><span class="p">(</span><span class="n">config</span><span class="p">);</span>
+<span class="n">InfModel</span> <span class="nb">inf</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createInfModel</span><span class="p">(</span><span class="n">reasoner</span><span class="p">,</span> <span class="n">rdfsExample</span><span class="p">);</span>
+</pre></div>
+
 
 <p>This is a rather long winded way of setting a single parameter, though it can
   be useful in the cases where you want to store this sort of configuration information
   in a separate (RDF) configuration file. For hardwired cases the following alternative
   is often simpler:</p>
 
-<pre>    Reasoner reasoner = RDFSRuleReasonerFactory.theInstance()Create(null);
-    reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel,
-                          ReasonerVocabulary.RDFS_SIMPLE);
-    InfModel inf = ModelFactory.createInfModel(reasoner, rdfsExample);
-</pre>
+<div class="codehilite"><pre><span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">RDFSRuleReasonerFactory</span><span class="p">.</span><span class="n">theInstance</span><span class="p">()</span><span class="n">Create</span><span class="p">(</span><span class="n">null</span><span class="p">);</span>
+<span class="n">reasoner</span><span class="p">.</span><span class="n">setParameter</span><span class="p">(</span><span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">PROPsetRDFSLevel</span><span class="p">,</span>
+                      <span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">RDFS_SIMPLE</span><span class="p">);</span>
+<span class="n">InfModel</span> <span class="nb">inf</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createInfModel</span><span class="p">(</span><span class="n">reasoner</span><span class="p">,</span> <span class="n">rdfsExample</span><span class="p">);</span>
+</pre></div>
+
 
 <p>Finally, supposing you have a more complex set of schema information, defined
   in a Model called <i>schema,</i> and you want to apply this schema to several
   sets of instance data without redoing too many of the same intermediate deductions.
   This can be done by using the SPI level methods: </p>
 
-<pre>    Reasoner boundReasoner = reasoner.bindSchema(schema);
-    InfModel inf = ModelFactory.createInfModel(boundReasoner, data);
-</pre>
+<div class="codehilite"><pre><span class="n">Reasoner</span> <span class="n">boundReasoner</span> <span class="p">=</span> <span class="n">reasoner</span><span class="p">.</span><span class="n">bindSchema</span><span class="p">(</span><span class="n">schema</span><span class="p">);</span>
+<span class="n">InfModel</span> <span class="nb">inf</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createInfModel</span><span class="p">(</span><span class="n">boundReasoner</span><span class="p">,</span> <span class="n">data</span><span class="p">);</span>
+</pre></div>
+
 
 <p>This creates a new reasoner, independent from the original, which contains
   the schema data. Any queries to an InfModel created using the boundReasoner
@@ -411,13 +414,13 @@
 
 <p>[<a href="#api">API index</a>] [<a href="#index">main index</a>]</p>
 
-<h3 id="wzxhzdk279wzxhzdk280operations-on-inference-models"><a name="operationsOnInferenceModels"></a>Operations on inference models</h3>
+<h3 id="operationsOnInferenceModels">Operations on inference models</h3>
 <p><p>For many applications one simply creates a model incorporating some inference
   step, using the <code>ModelFactory</code> methods, and then just works within
   the standard Jena Model API to access the entailed statements. However, sometimes
   it is necessary to gain more control over the processing or to access additional
   reasoner features not available as <i>virtual</i> triples.</p></p>
-<h4 id="wzxhzdk287wzxhzdk288validation"><a name="validation"></a>Validation</h4>
+<h4 id="validation">Validation</h4>
 <p><p>The most common reasoner operation which can't be exposed through additional
   triples in the inference model is that of validation. Typically the ontology
   languages used with the semantic web allow constraints to be expressed, the
@@ -437,38 +440,44 @@
   an arbitrary reasoner-specific object which can be used to pass additional information
   which can be used for programmatic handling of the violations.</p>
 <p>For example, to check a data set and list any problems one could do something
-  like:</p>
-<pre>    Model data = FileManager.get().loadModel(fname);
-    InfModel infmodel = ModelFactory.createRDFSModel(data);
-    ValidityReport validity = infmodel.validate();
-    if (validity.isValid()) {
-        System.out.println("OK");
-    } else {
-        System.out.println("Conflicts");
-        for (Iterator i = validity.getReports(); i.hasNext(); ) {
-            System.out.println(" - " + i.next());
-        }
-    }
-</pre>
+  like:</p></p>
+<div class="codehilite"><pre><span class="n">Model</span> <span class="n">data</span> <span class="p">=</span> <span class="n">FileManager</span><span class="p">.</span><span class="n">get</span><span class="p">().</span><span class="n">loadModel</span><span class="p">(</span><span class="n">fname</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">data</span><span class="p">);</span>
+<span class="n">ValidityReport</span> <span class="n">validity</span> <span class="p">=</span> <span class="n">infmodel</span><span class="p">.</span><span class="n">validate</span><span class="p">();</span>
+<span class="k">if</span> <span class="p">(</span><span class="n">validity</span><span class="p">.</span><span class="n">isValid</span><span class="p">())</span> <span class="p">{</span>
+    <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">OK</span>&quot;<span class="p">);</span>
+<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Conflicts</span>&quot;<span class="p">);</span>
+    <span class="k">for</span> <span class="p">(</span><span class="n">Iterator</span> <span class="nb">i</span> <span class="p">=</span> <span class="n">validity</span><span class="p">.</span><span class="n">getReports</span><span class="p">();</span> <span class="nb">i</span><span class="p">.</span><span class="n">hasNext</span><span class="p">();</span> <span class="p">)</span> <span class="p">{</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot; <span class="o">-</span> &quot; <span class="o">+</span> <span class="nb">i</span><span class="p">.</span><span class="n">next</span><span class="p">());</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
 <p>The file <code>testing/reasoners/rdfs/dttest2.nt</code> declares a property
   <code>bar</code> with range <code>xsd:integer</code> and attaches a <code>bar</code>
   value to some resource with the value <code>&quot;25.5&quot;^^xsd:decimal</code>.
   If we run the above sample code on this file we see:</p>
+
 <blockquote>
   <p><i>Conflicts <br>
     - Error (dtRange): Property http://www.hpl.hp.com/semweb/2003/eg#bar has a
     typed range Datatype[http://www.w3.org/2001/XMLSchema#integer -&gt; class java.math.BigInteger]that
     is not compatible with 25.5:http://www.w3.org/2001/XMLSchema#decimal </i></p>
 </blockquote>
+
 <p>Whereas the file <code>testing/reasoners/rdfs/dttest3.nt</code> uses the value
   &quot;25&quot;^^xsd:decimal instead, which is a valid integer and so passes.
 </p>
+
 <p>Note that the individual validation records can include warnings as well as
   errors. A warning does not affect the overall <code>isValid()</code> status
   but may indicate some issue the application may wish to be aware of. For example,
   it would be possible to develop a modification to the RDFS reasoner which warned
   about use of a property on a resource that is not explicitly declared to have
   the type of the domain of the property. </p>
+
 <p>A particular case of this arises in the case of OWL. In the Description Logic
   community a class which cannot have an instance is regarded as &quot;inconsistent&quot;.
   That term is used because it generally arises from an error in the ontology.
@@ -481,8 +490,9 @@
   warnings rather than errors. To make it easier to test for this case there is
   an additional method <code>Report.isClean()</code> which returns true if the
   ontology is both valid (logically consistent) and generated no warnings (such
-  as inconsistent classes).</p></p>
-<h4 id="wzxhzdk349wzxhzdk350extended-list-statements"><a name="extendedListStatements"></a>Extended list statements</h4>
+  as inconsistent classes).</p>
+
+<h4 id="wzxhzdk340wzxhzdk341extended-list-statements"><a name="extendedListStatements"></a>Extended list statements</h4>
 <p><p>The default API supports accessing all entailed information at the level of
   individual triples. This is surprisingly flexible but there are queries which
   cannot be easily supported this way. The first such is when the query needs
@@ -501,7 +511,7 @@
   preloading your data with expressions you might need to query over. However,
   for some external reasoners, especially description logic reasoners, we anticipate
   restricted uses of this form of listStatement will be important.</p></p>
-<h4 id="wzxhzdk361wzxhzdk362direct-and-indirect-relationships"><a name="directRelations"></a>Direct and indirect relationships</h4>
+<h4 id="wzxhzdk352wzxhzdk353direct-and-indirect-relationships"><a name="directRelations"></a>Direct and indirect relationships</h4>
 <p><p>The second type of operation that is not obviously convenient at the triple
   level involves distinguishing between direct and indirect relationships. If
   a relation is transitive, for example rdfs:subClassOf, then we can define the
@@ -522,7 +532,7 @@
 <p>Typically the easiest way to work with such indirect and direct relations is
   to use the <a href="../ontology/index.html">Ontology API</a> which hides the
   grubby details of these property aliases.</p></p>
-<h4 id="wzxhzdk388wzxhzdk389derivations"><a name="derivations"></a>Derivations</h4>
+<h4 id="wzxhzdk379wzxhzdk380derivations"><a name="derivations"></a>Derivations</h4>
 <p><p>It is sometimes useful to be able to trace where an inferred statement was
   generated from. This is achieved using the <code>InfModel.getDerivation(Statement)</code>
   method. This returns a iterator over a set <a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/Derivation.html"><code>Derviation</code></a>
@@ -538,37 +548,51 @@
   must be used to enable derivations to be recorded. This should be called before
   any queries are made to the inference model.</p>
 <p>As an illustration suppose that we have a raw data model which asserts three
-  triples:</p>
-<pre>eg:A eg:p eg:B .
-eg:B eg:p eg:C .
-eg:C eg:p eg:D .</pre>
+  triples:</p></p>
+<div class="codehilite"><pre><span class="n">eg</span><span class="o">:</span><span class="n">A</span> <span class="n">eg</span><span class="o">:</span><span class="n">p</span> <span class="n">eg</span><span class="o">:</span><span class="n">B</span> <span class="o">.</span>
+<span class="n">eg</span><span class="o">:</span><span class="n">B</span> <span class="n">eg</span><span class="o">:</span><span class="n">p</span> <span class="n">eg</span><span class="o">:</span><span class="n">C</span> <span class="o">.</span>
+<span class="n">eg</span><span class="o">:</span><span class="n">C</span> <span class="n">eg</span><span class="o">:</span><span class="n">p</span> <span class="n">eg</span><span class="o">:</span><span class="n">D</span> <span class="o">.</span>
+</pre></div>
+
+
 <p>and suppose that we have a trivial rule set which computes the transitive closure
   over relation eg:p</p>
-<pre>    String rules = "[rule1: (?a eg:p ?b) (?b eg:p ?c) -&gt; (?a eg:p ?c)]";
-    Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
-    reasoner.setDerivationLogging(true);
-    InfModel inf = ModelFactory.createInfModel(reasoner, rawData);</pre>
+
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">rules</span> <span class="p">=</span> &quot;<span class="p">[</span><span class="n">rule1</span><span class="p">:</span> <span class="p">(</span>?<span class="n">a</span> <span class="n">eg</span><span class="p">:</span><span class="n">p</span> ?<span class="n">b</span><span class="p">)</span> <span class="p">(</span>?<span class="n">b</span> <span class="n">eg</span><span class="p">:</span><span class="n">p</span> ?<span class="n">c</span><span class="p">)</span> <span class="o">-&amp;</span><span class="n">gt</span><span class="p">;</span> <span class="p">(</span>?<span class="n">a</span> <span class="n">eg</span><span class="p">:</span><span class="n">p</span> ?<span class="n">c</span><span class="p">)]</span>&quot;<span class="p">;</span>
+<span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">new</span> <span class="n">GenericRuleReasoner</span><span class="p">(</span><span class="n">Rule</span><span class="p">.</span><span class="n">parseRules</span><span class="p">(</span><span class="n">rules</span><span class="p">));</span>
+<span class="n">reasoner</span><span class="p">.</span><span class="n">setDerivationLogging</span><span class="p">(</span><span class="n">true</span><span class="p">);</span>
+<span class="n">InfModel</span> <span class="nb">inf</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createInfModel</span><span class="p">(</span><span class="n">reasoner</span><span class="p">,</span> <span class="n">rawData</span><span class="p">);</span>
+</pre></div>
+
+
 <p>Then we can query whether eg:A is related through eg:p to eg:D and list the
   derivation route using the following code fragment: </p>
-<pre>    PrintWriter out = new PrintWriter(System.out);
-    for (StmtIterator i = inf.listStatements(A, p, D); i.hasNext(); ) {
-        Statement s = i.nextStatement();
-        System.out.println("Statement is " + s);
-        for (Iterator id = inf.getDerivation(s); id.hasNext(); ) {
-            Derivation deriv = (Derivation) id.next();
-            deriv.printTrace(out, true);
-        }
-    }
-    out.flush();
-</pre>
+
+<div class="codehilite"><pre><span class="n">PrintWriter</span> <span class="n">out</span> <span class="p">=</span> <span class="n">new</span> <span class="n">PrintWriter</span><span class="p">(</span><span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">);</span>
+<span class="k">for</span> <span class="p">(</span><span class="n">StmtIterator</span> <span class="nb">i</span> <span class="p">=</span> <span class="nb">inf</span><span class="p">.</span><span class="n">listStatements</span><span class="p">(</span><span class="n">A</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">D</span><span class="p">);</span> <span class="nb">i</span><span class="p">.</span><span class="n">hasNext</span><span class="p">();</span> <span class="p">)</span> <span class="p">{</span>
+    <span class="n">Statement</span> <span class="n">s</span> <span class="p">=</span> <span class="nb">i</span><span class="p">.</span><span class="n">nextStatement</span><span class="p">();</span>
+    <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Statement</span> <span class="n">is</span> &quot; <span class="o">+</span> <span class="n">s</span><span class="p">);</span>
+    <span class="k">for</span> <span class="p">(</span><span class="n">Iterator</span> <span class="n">id</span> <span class="p">=</span> <span class="nb">inf</span><span class="p">.</span><span class="n">getDerivation</span><span class="p">(</span><span class="n">s</span><span class="p">);</span> <span class="n">id</span><span class="p">.</span><span class="n">hasNext</span><span class="p">();</span> <span class="p">)</span> <span class="p">{</span>
+        <span class="n">Derivation</span> <span class="n">deriv</span> <span class="p">=</span> <span class="p">(</span><span class="n">Derivation</span><span class="p">)</span> <span class="n">id</span><span class="p">.</span><span class="n">next</span><span class="p">();</span>
+        <span class="n">deriv</span><span class="p">.</span><span class="n">printTrace</span><span class="p">(</span><span class="n">out</span><span class="p">,</span> <span class="n">true</span><span class="p">);</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+<span class="n">out</span><span class="p">.</span><span class="n">flush</span><span class="p">();</span>
+</pre></div>
+
+
 <p>Which generates the output:</p>
-<pre><i>Statement is [urn:x-hp:eg/A, urn:x-hp:eg/p, urn:x-hp:eg/D]
-Rule rule1 concluded (eg:A eg:p eg:D) &lt;-
+
+<div class="codehilite"><pre><span class="nt">&lt;i&gt;</span>Statement is [urn:x-hp:eg/A, urn:x-hp:eg/p, urn:x-hp:eg/D]
+Rule rule1 concluded (eg:A eg:p eg:D) <span class="ni">&amp;lt;</span>-
     Fact (eg:A eg:p eg:B)
-    Rule rule1 concluded (eg:B eg:p eg:D) &lt;-
+    Rule rule1 concluded (eg:B eg:p eg:D) <span class="ni">&amp;lt;</span>-
         Fact (eg:B eg:p eg:C)
-        Fact (eg:C eg:p eg:D)</i></pre></p>
-<h4 id="wzxhzdk431wzxhzdk432accessing-raw-data-and-deductions"><a name="rawAccess"></a>Accessing raw data and deductions</h4>
+        Fact (eg:C eg:p eg:D)<span class="nt">&lt;/i&gt;</span>
+</pre></div>
+
+
+<h4 id="wzxhzdk403wzxhzdk404accessing-raw-data-and-deductions"><a name="rawAccess"></a>Accessing raw data and deductions</h4>
 <p><p>From an <code>InfModel</code> it is easy to retrieve the original, unchanged,
   data over which the model has been computed using the <code>getRawModel()</code>
   call. This returns a model equivalent to the one used in the initial <code>bind</code>
@@ -577,7 +601,7 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
 <p>Some reasoners, notably the forward chaining rule engine, store the deduced
   statements in a concrete form and this set of deductions can be obtained separately
   by using the <code>getDeductionsModel()</code> call. </p></p>
-<h4 id="wzxhzdk445wzxhzdk446processing-control"><a name="processingControl"></a>Processing control</h4>
+<h4 id="wzxhzdk417wzxhzdk418processing-control"><a name="processingControl"></a>Processing control</h4>
 <p><p>Having bound a <code>Model</code> into an <code>InfModel</code> by using a
   <code>Reasoner</code> its content can still be changed by the normal <code>add</code>
   and <code>remove</code> calls to the <code>InfModel</code>. Any such change
@@ -604,28 +628,29 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
   call. It there are any outstanding queries (i.e. StmtIterators which have not
   been read to the end yet) then those will be aborted (the next hasNext() call
   will return false).</p></p>
-<h4 id="wzxhzdk475wzxhzdk476tracing"><a name="tracing"></a>Tracing</h4>
+<h4 id="wzxhzdk447wzxhzdk448tracing"><a name="tracing"></a>Tracing</h4>
 <p><p>When developing new reasoner configurations, especially new rule sets for the
   rule engines, it is sometimes useful to be able to trace the operations of the
   associated inference engine. Though, often this generates too much information
   to be of use and selective use of the <code>print</code> builtin can be more
   effective. </p>
 <p>Tracing is not supported by a convenience API call but, for those reasoners
-  that support it, it can be enabled using:</p>
-<pre>   reasoner.setParameter(ReasonerVocabulary.PROPtraceOn, Boolean.TRUE);
-</pre>
+  that support it, it can be enabled using:</p></p>
+<p>reasoner.setParameter(ReasonerVocabulary.PROPtraceOn, Boolean.TRUE);</p>
 <p>Dynamic tracing control is sometimes possible on the InfModel itself by retrieving
   its underlying InfGraph and calling <code>setTraceOn()</code> call. If you need
   to make use of this see the full javadoc for the relevant InfGraph implementation.</p>
-<p>[<a href="#api">API index</a>] [<a href="#index">main index</a>]</p></p>
-<h2 id="wzxhzdk495wzxhzdk496the-rdfs-reasoner"><a name="rdfs"></a>The RDFS reasoner</h2>
+
+<p>[<a href="#api">API index</a>] [<a href="#index">main index</a>]</p>
+
+<h2 id="wzxhzdk455wzxhzdk456the-rdfs-reasoner"><a name="rdfs"></a>The RDFS reasoner</h2>
 <p><ol>
   <li><a href="#RDFSintro">RDFS reasoner - introduction and coverage</a></li>
   <li><a href="#RDFSconfiguration">RDFS Configuration</a></li>
   <li><a href="#RDFSexamples">RDFS Example</a></li>
   <li><a href="#RDFSnotes">RDFS implementation and performance notes</a></li>
 </ol></p>
-<h3 id="wzxhzdk515wzxhzdk516rdfs-reasoner-intro-and-coverage"><a name="RDFSintro"></a>RDFS reasoner - intro and coverage</h3>
+<h3 id="wzxhzdk475wzxhzdk476rdfs-reasoner-intro-and-coverage"><a name="RDFSintro"></a>RDFS reasoner - intro and coverage</h3>
 <p><p>Jena includes an RDFS reasoner (<code>RDFSRuleReasoner</code>) which supports
   almost all of the RDFS entailments described by the RDF Core working group [<a href="http://www.w3.org/TR/rdf-mt/">RDF
   Semantics</a>]. The only omissions are deliberate and are described below.</p>
@@ -637,11 +662,18 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
 <p>When configured in <i>full</i> mode (see below for configuration information)
   then the RDFS reasoner implements all RDFS entailments except for the bNode
   closure rules. These closure rules imply, for example, that for all triples
-  of the form:</p>
-<pre>eg:a eg:p nnn^^datatype .</pre>
+  of the form:</p></p>
+<div class="codehilite"><pre><span class="n">eg</span><span class="o">:</span><span class="n">a</span> <span class="n">eg</span><span class="o">:</span><span class="n">p</span> <span class="n">nnn</span><span class="o">^^</span><span class="n">datatype</span> <span class="o">.</span>
+</pre></div>
+
+
 <p>we should introduce the corresponding blank nodes:</p>
-<pre>eg:a eg:p <em>:anon1 .
-</em>:anon1 rdf:type datatype .</pre>
+
+<div class="codehilite"><pre><span class="n">eg</span><span class="o">:</span><span class="n">a</span> <span class="n">eg</span><span class="o">:</span><span class="n">p</span> <span class="n">_</span><span class="o">:</span><span class="n">anon1</span> <span class="o">.</span>
+<span class="n">_</span><span class="o">:</span><span class="n">anon1</span> <span class="n">rdf</span><span class="o">:</span><span class="n">type</span> <span class="n">datatype</span> <span class="o">.</span>
+</pre></div>
+
+
 <p>Whilst such rules are both correct and necessary to reduce RDF datatype entailment
   down to simple entailment they are not useful in implementation terms. In Jena
   simple entailment can be implemented by translating a graph containing bNodes
@@ -650,8 +682,10 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
   the datatype of the literal. The value to applications of directly seeing the
   additional bNode triples, even in <i>virtual</i> triple form, is negligible
   and so this has been deliberately omitted from the reasoner. </p>
-<p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk551wzxhzdk552rdfs-configuration"><a name="RDFSconfiguration"></a>RDFS configuration</h3>
+
+<p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p>
+
+<h3 id="wzxhzdk495wzxhzdk496rdfs-configuration"><a name="RDFSconfiguration"></a>RDFS configuration</h3>
 <p><p>The RDFSRuleReasoner can be configured to work at three different compliance
   levels: </p>
 <dl>
@@ -678,17 +712,22 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
     mode but is not the default because it is a less complete implementation of
     the standard. </dd>
 </dl>
-<p>The level can be set using the <code>setParameter</code> call, e.g.</p>
-<pre>    reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel,
-                          ReasonerVocabulary.RDFS_SIMPLE);
-</pre>
+<p>The level can be set using the <code>setParameter</code> call, e.g.</p></p>
+<div class="codehilite"><pre><span class="n">reasoner</span><span class="p">.</span><span class="n">setParameter</span><span class="p">(</span><span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">PROPsetRDFSLevel</span><span class="p">,</span>
+                      <span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">RDFS_SIMPLE</span><span class="p">);</span>
+</pre></div>
+
+
 <p>or by constructing an RDF configuration description and passing that to the
   RDFSRuleReasonerFactory e.g.</p>
-<pre>    Resource config = ModelFactory.createDefaultModel()
-                      .createResource()
-                      .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "simple");
-    Reasoner reasoner = RDFSRuleReasonerFactory.theInstance()Create(config);
-</pre></p>
+
+<div class="codehilite"><pre><span class="n">Resource</span> <span class="n">config</span> <span class="p">=</span> <span class="n">ModelFactory</span><span class="p">.</span><span class="n">createDefaultModel</span><span class="p">()</span>
+                  <span class="p">.</span><span class="n">createResource</span><span class="p">()</span>
+                  <span class="p">.</span><span class="n">addProperty</span><span class="p">(</span><span class="n">ReasonerVocabulary</span><span class="p">.</span><span class="n">PROPsetRDFSLevel</span><span class="p">,</span> &quot;<span class="n">simple</span>&quot;<span class="p">);</span>
+<span class="n">Reasoner</span> <span class="n">reasoner</span> <span class="p">=</span> <span class="n">RDFSRuleReasonerFactory</span><span class="p">.</span><span class="n">theInstance</span><span class="p">()</span><span class="n">Create</span><span class="p">(</span><span class="n">config</span><span class="p">);</span>
+</pre></div>
+
+
 <h4 id="summary-of-parameters">Summary of parameters</h4>
 <p><table width="90%" border="1" cellspacing="0" cellpadding="0">
   <tr>
@@ -739,62 +778,81 @@ Rule rule1 concluded (eg:A eg:p eg:D) &l
   </tr>
 </table>
 <p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk668wzxhzdk669rdfs-example"><a name="RDFSexamples"></a>RDFS Example</h3>
+<h3 id="wzxhzdk606wzxhzdk607rdfs-example"><a name="RDFSexamples"></a>RDFS Example</h3>
 <p><p>As a complete worked example let us create a simple RDFS schema, some instance
   data and use an instance of the RDFS reasoner to query the two.</p>
-<p>We shall use a trivial schema:</p>
-<pre>
- &nbsp;&lt;rdf:Description rdf:about="&amp;eg;mum"&gt;
- &nbsp;&nbsp;&nbsp;&lt;rdfs:subPropertyOf rdf:resource="&amp;eg;parent"/&gt;
- &nbsp;&lt;/rdf:Description&gt;</p>
-<p>&nbsp;&lt;rdf:Description rdf:about="&amp;eg;parent"&gt;
- &nbsp;&nbsp;&nbsp;&lt;rdfs:range &nbsp;rdf:resource="&amp;eg;Person"/&gt;
- &nbsp;&nbsp;&nbsp;&lt;rdfs:domain rdf:resource="&amp;eg;Person"/&gt;
- &nbsp;&lt;/rdf:Description&gt;</p>
-<p>&nbsp;&lt;rdf:Description rdf:about="&amp;eg;age"&gt;
- &nbsp;&nbsp;&nbsp;&lt;rdfs:range rdf:resource="&amp;xsd;integer" /&gt;
- &nbsp;&lt;/rdf:Description&gt;
-</pre>
+<p>We shall use a trivial schema:</p></p>
+<div class="codehilite"><pre> <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span> <span class="n">rdf</span><span class="p">:</span><span class="n">about</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">mum</span>&quot;<span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdfs</span><span class="p">:</span><span class="n">subPropertyOf</span> <span class="n">rdf</span><span class="p">:</span><span class="n">resource</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">parent</span>&quot;<span class="o">/&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="o">/</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span> <span class="n">rdf</span><span class="p">:</span><span class="n">about</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">parent</span>&quot;<span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdfs</span><span class="p">:</span><span class="n">range</span> <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="n">rdf</span><span class="p">:</span><span class="n">resource</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">Person</span>&quot;<span class="o">/&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdfs</span><span class="p">:</span><span class="n">domain</span> <span class="n">rdf</span><span class="p">:</span><span class="n">resource</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">Person</span>&quot;<span class="o">/&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="o">/</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span> <span class="n">rdf</span><span class="p">:</span><span class="n">about</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">age</span>&quot;<span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">rdfs</span><span class="p">:</span><span class="n">range</span> <span class="n">rdf</span><span class="p">:</span><span class="n">resource</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">xsd</span><span class="p">;</span><span class="n">integer</span>&quot; <span class="o">/&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="o">/</span><span class="n">rdf</span><span class="p">:</span><span class="n">Description</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+</pre></div>
+
+
 <p>This defines a property <code>parent</code> from <code>Person</code> to <code>Person</code>,
   a sub-property <code>mum</code> of <code>parent</code> and an integer-valued
   property <code>age</code>.</p>
+
 <p>We shall also use the even simpler instance file:</p>
-<pre>
- &nbsp;&lt;Teenager rdf:about="&amp;eg;colin"&gt;
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mum rdf:resource="&amp;eg;rosy" /&gt;
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;age&gt;13&lt;/age&gt;
- &nbsp;&lt;/Teenager&gt;
-</pre>
+
+<div class="codehilite"><pre> <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">Teenager</span> <span class="n">rdf</span><span class="p">:</span><span class="n">about</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">colin</span>&quot;<span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">mum</span> <span class="n">rdf</span><span class="p">:</span><span class="n">resource</span><span class="p">=</span>&quot;<span class="o">&amp;</span><span class="n">amp</span><span class="p">;</span><span class="n">eg</span><span class="p">;</span><span class="n">rosy</span>&quot; <span class="o">/&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="n">age</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>13<span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="o">/</span><span class="n">age</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+ <span class="o">&amp;</span><span class="n">nbsp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span><span class="o">/</span><span class="n">Teenager</span><span class="o">&amp;</span><span class="n">gt</span><span class="p">;</span>
+</pre></div>
+
+
 <p>
   Which defines a <code>Teenager</code> called <code>colin</code> who has a <code>mum</code>
   <code>rosy</code> and an <code>age</code> of 13.</p>
+
 <p>Then the following code fragment can be used to read files containing these
   definitions, create an inference model and query it for information on the <code>rdf:type</code>
   of <code>colin</code> and the <code>rdf:type</code> of <code>Person</code>:</p>
-<pre>Model schema = FileManager.get().loadModel("file:data/rdfsDemoSchema.rdf");
-Model data = FileManager.get().loadModel("file:data/rdfsDemoData.rdf");
-InfModel infmodel = ModelFactory.createRDFSModel(schema, data);</p>
-<p>Resource colin = infmodel.getResource("urn:x-hp:eg/colin");
-System.out.println("colin has types:");
-printStatements(infmodel, colin, RDF.type, null);</p>
-<p>Resource Person = infmodel.getResource("urn:x-hp:eg/Person");
-System.out.println("\nPerson has types:");
-printStatements(infmodel, Person, RDF.type, null);</pre>
+
+<p>```
+    Model schema = FileManager.get().loadModel("file:data/rdfsDemoSchema.rdf");
+    Model data = FileManager.get().loadModel("file:data/rdfsDemoData.rdf");
+    InfModel infmodel = ModelFactory.createRDFSModel(schema, data);</p>
+<div class="codehilite"><pre><span class="n">Resource</span> <span class="n">colin</span> <span class="p">=</span> <span class="n">infmodel</span><span class="p">.</span><span class="n">getResource</span><span class="p">(</span>&quot;<span class="n">urn</span><span class="p">:</span><span class="n">x</span><span class="o">-</span><span class="n">hp</span><span class="p">:</span><span class="n">eg</span><span class="o">/</span><span class="n">colin</span>&quot;<span class="p">);</span>
+<span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">colin</span> <span class="n">has</span> <span class="n">types</span><span class="p">:</span>&quot;<span class="p">);</span>
+<span class="n">printStatements</span><span class="p">(</span><span class="n">infmodel</span><span class="p">,</span> <span class="n">colin</span><span class="p">,</span> <span class="n">RDF</span><span class="p">.</span><span class="n">type</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+
+<span class="n">Resource</span> <span class="n">Person</span> <span class="p">=</span> <span class="n">infmodel</span><span class="p">.</span><span class="n">getResource</span><span class="p">(</span>&quot;<span class="n">urn</span><span class="p">:</span><span class="n">x</span><span class="o">-</span><span class="n">hp</span><span class="p">:</span><span class="n">eg</span><span class="o">/</span><span class="n">Person</span>&quot;<span class="p">);</span>
+<span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="o">\</span><span class="n">nPerson</span> <span class="n">has</span> <span class="n">types</span><span class="p">:</span>&quot;<span class="p">);</span>
+<span class="n">printStatements</span><span class="p">(</span><span class="n">infmodel</span><span class="p">,</span> <span class="n">Person</span><span class="p">,</span> <span class="n">RDF</span><span class="p">.</span><span class="n">type</span><span class="p">,</span> <span class="n">null</span><span class="p">);</span>
+</pre></div>
+
+
+<p>```</p>
 <p>This produces the output:</p>
+
 <pre><i>colin has types:
  - (eg:colin rdf:type eg:Teenager)
  - (eg:colin rdf:type rdfs:Resource)
- - (eg:colin rdf:type eg:Person)</p>
-<p>Person has types:
+ - (eg:colin rdf:type eg:Person)
+
+Person has types:
  - (eg:Person rdf:type rdfs:Class)
  - (eg:Person rdf:type rdfs:Resource)</i></pre>
+
 <p>This says that <code>colin</code> is both a <code>Teenager</code> (by direct
   definition), a <code>Person</code> (because he has a <code>mum</code> which
   means he has a <code>parent</code> and the domain of <code>parent</code> is
   <code>Person</code>) and an <code>rdfs:Resource</code>. It also says that <code>Person</code>
   is an <code>rdfs:Class</code>, even though that wasn't explicitly in the schema,
   because it is used as object of range and domain statements.</p>
+
 <p>If we add the additional code:</p>
+
 <pre>ValidityReport validity = infmodel.validate();
 if (validity.isValid()) {
     System.out.println("\nOK");
@@ -805,16 +863,21 @@ if (validity.isValid()) {
         System.out.println(" - " + report);
     }
 }</pre>
+
 <p>
   Then we get the additional output:</p>
+
 <pre><i>Conflicts
  - Error (dtRange): Property urn:x-hp:eg/age has a typed range
 Datatype[http://www.w3.org/2001/XMLSchema#integer -&gt; class java.math.BigInteger]
 that is not compatible with 13</i></pre>
+
 <p>because the age was given using an RDF plain litera where as the schema requires
   it to be a datatyped literal which is compatible with xsd:integer.</p>
-<p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk835wzxhzdk836rdfs-implementation-and-performance-notes"><a name="RDFSnotes"></a>RDFS implementation and performance notes</h3>
+
+<p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p>
+
+<h3 id="wzxhzdk612wzxhzdk613rdfs-implementation-and-performance-notes"><a name="RDFSnotes"></a>RDFS implementation and performance notes</h3>
 <p><p>The RDFSRuleReasoner is a hybrid implementation. The subproperty and subclass
   lattices are eagerly computed and stored in a compact in-memory form using the
   TransitiveReasoner (see below). The identification of which container membership
@@ -872,7 +935,7 @@ that is not compatible with 13</i></pre>
   on adapting the rule engines to exploit the capabilities of the more sophisticated
   database backends will be considered.</p>
 <p>[<a href="#rdfs">RDFS index</a>] [<a href="#index">main index</a>]</p></p>
-<h2 id="wzxhzdk923wzxhzdk924the-owl-reasoner"><a name="owl"></a>The OWL reasoner</h2>
+<h2 id="wzxhzdk700wzxhzdk701the-owl-reasoner"><a name="owl"></a>The OWL reasoner</h2>
 <p><ol>
   <li><a href="#OWLintro">OWL reasoner introduction</a></li>
   <li><a href="#OWLcoverage">OWL coverage</a></li>
@@ -889,7 +952,7 @@ an external DL reasoner such as Pellet, 
 configuration still leaves something to be desired and will the subject of future work - time permitting.</p>
 <p>See also <a href="#OWLnotes">subsection 5</a> for notes on more specific limitations
   of the current implementation. </p></p>
-<h3 id="wzxhzdk957wzxhzdk958owl-coverage"><a name="OWLcoverage"></a>OWL coverage</h3>
+<h3 id="wzxhzdk734wzxhzdk735owl-coverage"><a name="OWLcoverage"></a>OWL coverage</h3>
 <p><p>The Jena OWL reasoners could be described as instance-based reasoners. That
   is, they work by using rules to propagate the if- and only-if- implications of
   the OWL constructs on instance data. Reasoning about classes is done indirectly
@@ -1108,7 +1171,7 @@ configuration still leaves something to 
     restriction.</li>
 </ul>
 <p>[<a href="#owl">OWL index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1207wzxhzdk1208owl-configuration"><a name="OWLconfiguration"></a>OWL Configuration</h3>
+<h3 id="wzxhzdk984wzxhzdk985owl-configuration"><a name="OWLconfiguration"></a>OWL Configuration</h3>
 <p><p>This reasoner is accessed using <code>ModelFactory.createOntologyModel</code>
   with the prebuilt <a href="/documentation/javadoc/jena/com/hp/hpl/jena/ontology/OntModelSpec.html"><code>OntModelSpec</code></a>
   <code>OWL_MEM_RULE_INF</code> or manually via <code>ReasonerRegistery.getOWLReasoner()</code>.</p>
@@ -1145,7 +1208,7 @@ configuration still leaves something to 
   of the rule-based approach we imagine useful subsets of functionality emerging
   - like that that supported by the RDFS reasoner in the form of the level settings.</p>
 <p>[<a href="#owl">OWL index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1273wzxhzdk1274owl-example"><a name="OWLexamples"></a>OWL Example</h3>
+<h3 id="wzxhzdk1050wzxhzdk1051owl-example"><a name="OWLexamples"></a>OWL Example</h3>
 <p><p>As an example of using the OWL inference support, consider the sample schema
   and data file in the data directory - <a href="data/owlDemoSchema.xml">owlDemoSchema.xml</a>
   and <a href="data/owlDemoData.xml">owlDemoData.xml</a>. </p>
@@ -1234,7 +1297,7 @@ Implicated node: eg:bigNameSpecialMB</i>
   referencing two motherboards which are explicitly defined to be different resources
   and thus violate the FunctionProperty nature of <code>hasMotherBoard</code>.</p>
 <p>[<a href="#owl">OWL index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1382wzxhzdk1383owl-notes-and-limitations"><a name="OWLnotes"></a>OWL notes and limitations</h3>
+<h3 id="wzxhzdk1159wzxhzdk1160owl-notes-and-limitations"><a name="OWLnotes"></a>OWL notes and limitations</h3>
 <h4 id="comprehension-axioms">Comprehension axioms</h4>
 <p><p>A critical implication of our variant of the instance-based approach is that
   the reasoner does not directly answer queries relating to dynamically introduced
@@ -1305,7 +1368,7 @@ class B = cardinality(P,1)</pre>
   should be valid) but not complete. </p></p>
 <p>[<a href="#owl">OWL index</a>] [<a href="#index">main index</a>]</p>
 
-<h2 id="wzxhzdk1421wzxhzdk1422the-transitive-reasoner"><a name="transitive"></a>The transitive reasoner</h2>
+<h2 id="wzxhzdk1198wzxhzdk1199the-transitive-reasoner"><a name="transitive"></a>The transitive reasoner</h2>
 <p><p>The TransitiveReasoner provides support for storing and traversing class and
   property lattices. This implements just the <i>transitive</i> and <i>symmetric</i>
   properties of <code>rdfs:subPropertyOf</code> and <code>rdfs:subClassOf</code>.
@@ -1321,7 +1384,7 @@ class B = cardinality(P,1)</pre>
   used in the default RDFS reasoner.</p>
 <p>It has no configuration options.</p>
 <p>[<a href="#index">Index</a>]</p></p>
-<h2 id="wzxhzdk1443wzxhzdk1444the-general-purpose-rule-engine"><a name="rules"></a>The general purpose rule engine</h2>
+<h2 id="wzxhzdk1220wzxhzdk1221the-general-purpose-rule-engine"><a name="rules"></a>The general purpose rule engine</h2>
 <p><ol>
   <li><a href="#RULEoverview">Overview of the rule engine(s)</a></li>
   <li><a href="#RULEsyntax">Rule syntax and structure</a></li>
@@ -1335,7 +1398,7 @@ class B = cardinality(P,1)</pre>
   <li><a href="#RULEnotes">Notes</a></li>
   <li><a href="#RULEextensions">Extensions</a></li>
 </ol></p>
-<h3 id="wzxhzdk1491wzxhzdk1492overview-of-the-rule-engines"><a name="RULEoverview"></a>Overview of the rule engine(s)</h3>
+<h3 id="wzxhzdk1268wzxhzdk1269overview-of-the-rule-engines"><a name="RULEoverview"></a>Overview of the rule engine(s)</h3>
 <p><p>Jena includes a general purpose rule-based reasoner which is used to implement
   both the RDFS and OWL reasoners but is also available for general use. This
   reasoner supports rule-based inference over RDF graphs and provides forward
@@ -1354,7 +1417,7 @@ class B = cardinality(P,1)</pre>
   The current release includes a starting set of primitives which are sufficient
   for the RDFS and OWL implementations but is easily extensible.</p>
 <p>[<a href="#rules">rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1513wzxhzdk1514rule-syntax-and-structure"><a name="RULEsyntax"></a>Rule syntax and structure</h3>
+<h3 id="wzxhzdk1290wzxhzdk1291rule-syntax-and-structure"><a name="RULEsyntax"></a>Rule syntax and structure</h3>
 <p><p>A rule for the rule-based reasoner is defined by a Java <code><a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/rulesys/Rule.html">Rule</a></code>
   object with a list of body terms (premises), a list of head terms (conclusions)
   and an optional name and optional direction. Each term or <a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/rulesys/ClauseEntry.html"><code>ClauseEntry</code></a>
@@ -1464,7 +1527,7 @@ a single extra rule is:
 
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p>
 
-<h3 id="wzxhzdk1692wzxhzdk1693forward-chaining-engine"><a name="RULEforward"></a>Forward chaining engine</h3>
+<h3 id="wzxhzdk1469wzxhzdk1470forward-chaining-engine"><a name="RULEforward"></a>Forward chaining engine</h3>
 <p><p>If the rule reasoner is configured to run in forward mode then only the forward
   chaining engine will be used. The first time the inference Model is queried
   (or when an explicit <code>prepare()</code> call is made, see <a href="#processingControl">above</a>)
@@ -1503,7 +1566,7 @@ a single extra rule is:
   done to the default RETE engine.</p></p>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p>
 
-<h3 id="wzxhzdk1725wzxhzdk1726backward-chaining-engine"><a name="RULEbackward"></a>Backward chaining engine</h3>
+<h3 id="wzxhzdk1502wzxhzdk1503backward-chaining-engine"><a name="RULEbackward"></a>Backward chaining engine</h3>
 <p><p>If the rule reasoner is run in backward chaining mode it uses a logic programming
   (LP) engine with a similar execution strategy to Prolog engines. When the inference
   Model is queried then the query is translated into a goal and the engine attempts
@@ -1569,7 +1632,7 @@ triple(s1, p1, o1) :- triple(sb1, pb1, o
 might be run in either backward or forward mode then they should be limited to a single consequent each.
 </p>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1789wzxhzdk1790hybrid-rule-engine"><a name="RULEhybrid"></a>Hybrid rule engine</h3>
+<h3 id="wzxhzdk1566wzxhzdk1567hybrid-rule-engine"><a name="RULEhybrid"></a>Hybrid rule engine</h3>
 <p><p>The rule reasoner has the option of employing both of the individual rule engines
   in conjunction. When run in this <i>hybrid</i> mode the data flows look something
   like this: </p>
@@ -1610,7 +1673,7 @@ might be run in either backward or forwa
   removing backward rules in response to the data changes.</p></p>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p>
 
-<h3 id="wzxhzdk1821wzxhzdk1822genericrulereasoner-configuration"><a name="RULEconfiguration"></a>GenericRuleReasoner configuration</h3>
+<h3 id="wzxhzdk1598wzxhzdk1599genericrulereasoner-configuration"><a name="RULEconfiguration"></a>GenericRuleReasoner configuration</h3>
 <p><p>As with the other reasoners there are a set of parameters, identified by RDF
   properties, to control behaviour of the <code>GenericRuleReasoner</code>. These
   parameters can be set using the <code>Reasoner.setParameter</code> call or passed
@@ -1711,7 +1774,7 @@ Reasoner reasoner = new GenericRuleReaso
   </tr>
 </table>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk1959wzxhzdk1960builtin-primitives"><a name="RULEbuiltins"></a>Builtin primitives</h3>
+<h3 id="wzxhzdk1736wzxhzdk1737builtin-primitives"><a name="RULEbuiltins"></a>Builtin primitives</h3>
 <p><p>The procedural primitives which can be called by the rules are each implemented
   by a Java object stored in a registry. Additional primitives can be created
   and registered - see below for more details.</p>
@@ -1928,7 +1991,7 @@ do not "pollute" the inference results.<
   </tr>
 </table>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk2200wzxhzdk2201example"><a name="RULEexamples"></a>Example</h3>
+<h3 id="wzxhzdk1977wzxhzdk1978example"><a name="RULEexamples"></a>Example</h3>
 <p><p>As a simple illustration suppose we wish to create a simple ontology language
   in which we can declare one property as being the concatenation of two others
   and to build a rule reasoner to implement this.</p>
@@ -2021,7 +2084,7 @@ while (i.hasNext()) {
       [ (?A ?P ?C) &lt;- (?A ?P ?B), (?B ?P ?C) ]
 ] </pre>
 <p>[<a href="#rules">rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk2277wzxhzdk2278combining-rdfsowl-with-custom-rules"><a name="RDFSPlusRules"></a>Combining RDFS/OWL with custom rules</h3>
+<h3 id="wzxhzdk2054wzxhzdk2055combining-rdfsowl-with-custom-rules"><a name="RDFSPlusRules"></a>Combining RDFS/OWL with custom rules</h3>
 <p><p>Sometimes one wishes to write generic inference rules but combine them
  with some RDFS or OWL infernece. With the current Jena architecture limited forms of this
  is possible but you need to be aware of the limitations.</p>
@@ -2078,7 +2141,7 @@ while (i.hasNext()) {
 </pre></p>
 <p>[<a href="#rules">rule index</a>] [<a href="#index">main index</a>]</p>
 
-<h3 id="wzxhzdk2307wzxhzdk2308notes"><a name="RULEnotes"></a>Notes</h3>
+<h3 id="wzxhzdk2084wzxhzdk2085notes"><a name="RULEnotes"></a>Notes</h3>
 <p><p>One final aspect of the general rule engine to mention is that of validation
   rules. We described earlier how reasoners can implement a <code>validate</code>
   call which returns a set of error reports and warnings about inconsistencies
@@ -2108,7 +2171,7 @@ while (i.hasNext()) {
 <p>Future extensions will improve the formatting capabilities and flexibility
   of this mechanism. </p>
 <p>[<a href="#rules">Rule index</a>] [<a href="#index">main index</a>]</p></p>
-<h3 id="wzxhzdk2351wzxhzdk2352extensions"><a name="RULEextensions"></a>Extensions</h3>
+<h3 id="wzxhzdk2128wzxhzdk2129extensions"><a name="RULEextensions"></a>Extensions</h3>
 <p><p>There are several places at which the rule system can be extended by application
   code.</p></p>
 <h4 id="rule-syntax">Rule syntax</h4>
@@ -2140,7 +2203,7 @@ while (i.hasNext()) {
   and the <a href="/documentation/javadoc/jena/com/hp/hpl/jena/reasoner/rulesys/RulePreprocessHook.html"><code>RulePreprocessHook</code></a>
   class for more details.</p>
 <p>[<a href="#index">Index</a>]</p></p>
-<h2 id="wzxhzdk2403wzxhzdk2404extending-the-inference-support"><a name="extensions"></a>Extending the inference support</h2>
+<h2 id="wzxhzdk2180wzxhzdk2181extending-the-inference-support"><a name="extensions"></a>Extending the inference support</h2>
 <p><p>Apart from the extension points in the rule reasoner discussed above, the intention
   is that it should be possible to plug external inference engines into Jena.
   The core interfaces of <code>InfGraph</code> and <code>Reasoner</code> are kept
@@ -2151,7 +2214,7 @@ while (i.hasNext()) {
   freely available, reasoner to both validate the machinery and to provide an
   example of how this extension can be done.</p>
 <p>[<a href="#index">Index</a>]</p></p>
-<h2 id="wzxhzdk2419wzxhzdk2420futures"><a name="futures"></a>Futures</h2>
+<h2 id="wzxhzdk2196wzxhzdk2197futures"><a name="futures"></a>Futures</h2>
 <p><p>Whilst we can make no firm commitments, at the time of writing we intend to
   continue work on the Jena reasoning support. The key activities on the drawing
   board are:</p>