jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r803221 - in /websites/staging/jena/trunk/content/jena/documentation/query: explain.html index.html
Date Tue, 24 Jan 2012 23:33:34 GMT
Author: buildbot
Date: Tue Jan 24 23:33:34 2012
New Revision: 803221

Log:
Staging update by buildbot for jena

Added:
    websites/staging/jena/trunk/content/jena/documentation/query/explain.html
Modified:
    websites/staging/jena/trunk/content/jena/documentation/query/index.html

Added: websites/staging/jena/trunk/content/jena/documentation/query/explain.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/query/explain.html (added)
+++ websites/staging/jena/trunk/content/jena/documentation/query/explain.html Tue Jan 24 23:33:34
2012
@@ -0,0 +1,251 @@
+<!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 - explaining ARQ queries</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>
+<li><a href="/jena/about_jena/contributions.html">Related projects</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">Tutorials index</a></li>
+<li><a href="/jena/tutorials/rdf_api.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><ul>
+<li><a href="/jena/documentation/query/app_api.html">Application API</a></li>
+<li><a href="/jena/documentation/query/cmds.html">Command line utilities</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/tdb/index.html">TDB</a><ul>
+<li><a href="/jena/documentation/tdb/tdb_transactions.html">API for Transactions</a></li>
+<li><a href="/jena/documentation/tdb/assembler.html">Dataset Assembler</a></li>
+</ul>
+</li>
+<li><a href="/jena/documentation/sdb/index.html">SDB</a></li>
+<li><a href="/jena/documentation/larq/index.html">LARQ</a></li>
+<li><a href="/jena/documentation/serving_data/index.html">Fuseki: 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>
+<li><a href="/jena/documentation/io/riot.html">RIOT</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>
+<li><a href="/jena/documentation/notes/iri.html">Support for IRI's</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>
+<li><a href="/jena/documentation/tools/eyeball-getting-started.html">eyeball</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">explaining ARQ queries</h1>
+    <p><em>This page applies to ARQ version 2.8.6 and later. In this version
query
+logging was consolidated and made uniform across ARQ, SDB and TDB.
+Details of TDB logging changed to use this logging and explanation
+framework from TDB version 0.8.8.</em></p>
+<p>Optimization in ARQ proceeds on two levels. After the query is parsed,
+the SPARQL algebra for the query is generated as described in the SPARQL
+specification. High-level optimization occurs by rewriting the algebra
+into new, equivalent algebra forms and introducing specialized algebra
+operators. During query execution, the low-level, storage-specific
+optimization occurs such as choosing the order of triple patterns within
+basic graph patterns.</p>
+<p>The effect of <a href="#Algebra_Transformations">high-level optimizations</a>
can
+be seen using <code>arq.qparse</code> and the low-level runtime optimziations
can
+be seen by <a href="#Execution_Logging">execution logging</a>.</p>
+<h2 id="algebra_transformations">Algebra Transformations</h2>
+<p>The preparation for a query for execution can be investigated with the
+command <code>arq.qparse --explain --query QueryFile.rq</code>. Different storage
+systems may perform different optimizations, usually chosen from the
+standard set. <code>qparse</code> shows the action of the memory-storage optimizer
+which applies all optimizations.</p>
+<p>Other useful arguments are:</p>
+<p><strong>qparse arguments</strong>
+Argument | Effect
+-------- | -----
+<code>--print=query</code> | Print the parsed query
+<code>--print=op</code> | Print the SPARQL algebra for the query. This is exactly
the algebra specified by the SPARQL standard.
+<code>--print=opt</code> | Print the optimized algebra for the query.
+<code>--print=quad</code> | Print the quad form algebra for the query.
+<code>--print=optquad</code> | Print the quad-form optimized algebra for the
query.</p>
+<p>The argument <code>--explain</code> is equivalent to <code>--print=query
--print=opt</code></p>
+<p>Examples:</p>
+<div class="codehilite"><pre><span class="n">arq</span><span class="o">.</span><span
class="n">qparse</span> <span class="o">--</span><span class="n">explain</span>
<span class="o">--</span><span class="n">query</span> <span class="n">Q</span><span
class="o">.</span><span class="n">rq</span>
+
+<span class="n">arq</span><span class="o">.</span><span class="n">qparse</span>
<span class="o">--</span><span class="n">explain</span> <span class="s">&#39;SELECT
* { ?s ?p ?o }&#39;</span>
+</pre></div>
+
+
+<h2 id="execution_logging">Execution Logging</h2>
+<p>ARQ can log query and update execution details globally or for an
+individual operations. This adds another level of control on top of the
+logger level controls.</p>
+<p>From command line:</p>
+<div class="codehilite"><pre><span class="n">arq</span><span class="o">.</span><span
class="n">sparql</span> <span class="o">--</span><span class="n">explain</span>
<span class="o">--</span><span class="n">data</span> <span class="o">...</span>
<span class="o">--</span><span class="n">query</span> <span class="o">...</span>
+</pre></div>
+
+
+<p>Explanatory messages are controlled by the <code>Explain.InfoLevel</code>
level in
+the execution context.</p>
+<p>Execution logging at level <code>ALL</code> can cause a significant
slowdown in
+query execution speeds but the order of operations logged will be
+correct.</p>
+<p>The logger used is called <code>com.hp.hpl.jena.arq.exec</code>. Message
are sent
+at level "info". So for log4j, the following can be set in the
+log4j.properties file:</p>
+<div class="codehilite"><pre><span class="n">log4j</span><span
class="o">.</span><span class="n">logger</span><span class="o">.</span><span
class="n">com</span><span class="o">.</span><span class="n">hp</span><span
class="o">.</span><span class="n">hpl</span><span class="o">.</span><span
class="n">jena</span><span class="o">.</span><span class="n">arq</span><span
class="o">.</span><span class="nb">exec</span><span class="o">=</span><span
class="n">INFO</span>
+</pre></div>
+
+
+<p>The context setting is for key (Java constant) <code>ARQ.symLogExec</code>.
To set
+globally:</p>
+<div class="codehilite"><pre><span class="n">ARQ</span><span class="o">.</span><span
class="n">setExecutionLogging</span><span class="p">(</span><span
class="n">Explain</span><span class="o">.</span><span class="n">InfoLevel</span><span
class="o">.</span><span class="n">ALL</span><span class="p">)</span><span
class="err"> </span><span class="p">;</span>
+</pre></div>
+
+
+<p>and it may also be set on an individual query execution using it's local
+context.</p>
+<div class="codehilite"><pre> <span class="n">QueryExecutiuon</span>
<span class="n">qExec</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="o">...</span><span class="p">)</span><span class="err"> </span><span
class="p">;</span>
+ <span class="n">qExec</span><span class="o">.</span><span class="n">getContext</span><span
class="p">()</span><span class="o">.</span><span class="n">set</span><span
class="p">(</span><span class="n">ARQ</span><span class="o">.</span><span
class="n">symLogExec</span><span class="p">,</span> <span class="n">Explain</span><span
class="o">.</span><span class="n">InfoLevel</span><span class="o">.</span><span
class="n">ALL</span><span class="p">)</span><span class="err"> </span><span
class="p">;</span>
+</pre></div>
+
+
+<p>On the command line:</p>
+<div class="codehilite"><pre> <span class="n">arq</span><span
class="o">.</span><span class="n">query</span> <span class="o">--</span><span
class="n">explain</span> <span class="o">--</span><span class="n">data</span>
<span class="n">data</span> <span class="n">file</span> <span class="o">--</span><span
class="n">query</span><span class="o">=</span><span class="n">queryfile</span>
+</pre></div>
+
+
+<p>The command tdbquery takes the same --explain argument.</p>
+<p>Logging information levels: see the <a href="logging.html">logging page</a></p>
+  </div>
+
+  <div id="footer">
+    <div class="copyright">
+      <p>
+        Copyright &copy; 2011&ndash;12 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>

Modified: websites/staging/jena/trunk/content/jena/documentation/query/index.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/documentation/query/index.html (original)
+++ websites/staging/jena/trunk/content/jena/documentation/query/index.html Tue Jan 24 23:33:34
2012
@@ -184,6 +184,7 @@ SPARQL is the query language developed b
 <li>Application <a href="../javadoc/arq/index.html">javadoc</a></li>
 <li><a href="cmds.html">Command line utilities</a></li>
 <li><a href="logging.html">Logging</a></li>
+<li><a href="explain.html">Explaining queries</a></li>
 </ul>
 <h2 id="advanced_sparql_use">Advanced SPARQL use</h2>
 <p>Features of ARQ that are legal SPARQL syntax.</p>



Mime
View raw message