jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r798099 [5/5] - in /websites/staging/jena/trunk/content/jena: ./ about_jena/ documentation/ documentation/assembler/ documentation/inference/ documentation/io/ documentation/javadoc/ documentation/larq/ documentation/notes/ documentation/on...
Date Sat, 05 Nov 2011 01:11:13 GMT
Added: websites/staging/jena/trunk/content/jena/tutorials/sparql_optionals.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/sparql_optionals.html (added)
+++ websites/staging/jena/trunk/content/jena/tutorials/sparql_optionals.html Sat Nov  5 01:11:09 2011
@@ -0,0 +1,319 @@
+<!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 - SPARQL Tutorial - Optional Information</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">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></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">SPARQL Tutorial - Optional Information</h1>
+    <p>RDF is semi-structured data so SPARQL has a the ability to query
+for data but not to fail query when that data does not exist. The
+query is using an optional part to extend the information found in
+a query solution but to return the non-optional information
+anyway.</p>
+<h2 id="optionals">OPTIONALs</h2>
+<p>This query (<a href="sparql_data/q-opt1.rq">q-opt1.rq</a>) gets the name of a person and
+also their age if that piece of information is available.</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">info:</span>    <span class="sr">&lt;http://somewhere/peopleInfo#&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vcard:</span>   <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span> <span class="p">?</span><span class="n">age</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+    <span class="p">?</span><span class="n">person</span> <span class="n">vcard:FN</span>  <span class="p">?</span><span class="n">name</span> <span class="o">.</span>
+    <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">person</span> <span class="n">info:age</span> <span class="p">?</span><span class="n">age</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Two of the four people in the data (<a href="sparql_data/vc-db-2.rdf">vc-db-2.rdf</a>)have
+age properties so two of the query solutions have that
+information.  However, because the triple pattern for the age is
+optional, there is a pattern solution for the people who don't have
+age information.</p>
+<div class="codehilite"><pre><span class="o">------------------------</span>
+<span class="o">|</span> <span class="n">name</span>          <span class="o">|</span> <span class="n">age</span> <span class="o">|</span>
+<span class="o">=======================</span>
+<span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span> <span class="mi">23</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>     <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span> <span class="mi">25</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>     <span class="o">|</span>
+<span class="o">-----------------------</span>
+</pre></div>
+
+
+<p>If the optional clause had not been there, no age information would
+have been retrieved. If the triple pattern had been included but
+not optional then we would have the query
+(<a href="sparql_data/q-opt2.rq">q-opt2.rq</a>):</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">info:</span>   <span class="sr">&lt;http://somewhere/peopleInfo#&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vcard:</span>  <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span> <span class="p">?</span><span class="n">age</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+    <span class="p">?</span><span class="n">person</span> <span class="n">vcard:FN</span>  <span class="p">?</span><span class="n">name</span> <span class="o">.</span>
+    <span class="p">?</span><span class="n">person</span> <span class="n">info:age</span> <span class="p">?</span><span class="n">age</span> <span class="o">.</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>with only two solutions:</p>
+<div class="codehilite"><pre><span class="o">-----------------------</span>
+<span class="o">|</span> <span class="n">name</span>          <span class="o">|</span> <span class="n">age</span> <span class="o">|</span>
+<span class="o">=======================</span>
+<span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span> <span class="mi">23</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span> <span class="mi">25</span>  <span class="o">|</span>
+<span class="o">-----------------------</span>
+</pre></div>
+
+
+<p>because the <code>info:age</code> property must now be present in a solution.</p>
+<h2 id="optionals_with_filters">OPTIONALs with FILTERs</h2>
+<p><code>OPTIONAL</code> is a binary operator that combines two graph patterns.
+The optional pattern is any group pattern and may involve any
+SPARQL pattern types.  If the group matches, the solution is
+extended, if not, the original solution is given
+(<a href="sparql_data/q-opt3.rq">q-opt-3.rq</a>).</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">info:</span>        <span class="sr">&lt;http://somewhere/peopleInfo#&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vcard:</span>      <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span> <span class="p">?</span><span class="n">age</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+    <span class="p">?</span><span class="n">person</span> <span class="n">vcard:FN</span>  <span class="p">?</span><span class="n">name</span> <span class="o">.</span>
+    <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">person</span> <span class="n">info:age</span> <span class="p">?</span><span class="n">age</span> <span class="o">.</span> <span class="n">FILTER</span> <span class="p">(</span> <span class="p">?</span><span class="n">age</span> <span class="o">&gt;</span> <span class="mi">24</span> <span class="p">)</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>So, if we filter for ages greater than 24 in the optional part, we
+will still get 4 solutions (from the <code>vcard:FN</code> pattern) but only
+get ages if they pass the test.</p>
+<div class="codehilite"><pre><span class="o">-----------------------</span>
+<span class="o">|</span> <span class="n">name</span>          <span class="o">|</span> <span class="n">age</span> <span class="o">|</span>
+<span class="o">=======================</span>
+<span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span>     <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>     <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span> <span class="mi">25</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>     <span class="o">|</span>
+<span class="o">-----------------------</span>
+</pre></div>
+
+
+<p>No age included for "Becky Smith" because it is less than 24.</p>
+<p>If the filter condition is moved out of the optional part, then it
+can influence the number of solutions but it may be necessary to
+make the filter more complicated to allow for variable <code>age</code> being
+unbound (<a href="sparql_data/q-opt4.rq">q-opt4.rq</a>).</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">info:</span>        <span class="sr">&lt;http://somewhere/peopleInfo#&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vcard:</span>      <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span> <span class="p">?</span><span class="n">age</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+    <span class="p">?</span><span class="n">person</span> <span class="n">vcard:FN</span>  <span class="p">?</span><span class="n">name</span> <span class="o">.</span>
+    <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">person</span> <span class="n">info:age</span> <span class="p">?</span><span class="n">age</span> <span class="o">.</span> <span class="p">}</span>
+    <span class="n">FILTER</span> <span class="p">(</span> <span class="o">!</span><span class="n">bound</span><span class="p">(?</span><span class="n">age</span><span class="p">)</span> <span class="o">||</span> <span class="p">?</span><span class="n">age</span> <span class="o">&gt;</span> <span class="mi">24</span> <span class="p">)</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>If a solution has an <code>age</code> variable, then it must be greater than
+24. It can also be unbound.  There are now three solutions:</p>
+<div class="codehilite"><pre><span class="o">-----------------------</span>
+<span class="o">|</span> <span class="n">name</span>          <span class="o">|</span> <span class="n">age</span> <span class="o">|</span>
+<span class="o">=======================</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>     <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span> <span class="mi">25</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>     <span class="o">|</span>
+<span class="o">-----------------------</span>
+</pre></div>
+
+
+<p>Evaluating an expression which has an unbound variables where a
+bound one was expected causes an evaluation exception and the whole
+expression fails.</p>
+<h2 id="optionals_and_order_dependent_queries">OPTIONALs and Order Dependent Queries</h2>
+<p>One thing to be careful of is using the same variable in two or
+more optional clauses (and not in some basic pattern as well):</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vCard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+  <span class="p">?</span><span class="n">x</span> <span class="n">a</span> <span class="n">foaf:Person</span> <span class="o">.</span>
+  <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">x</span> <span class="n">foaf:name</span> <span class="p">?</span><span class="n">name</span> <span class="p">}</span>
+  <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">x</span> <span class="n">vCard:FN</span>  <span class="p">?</span><span class="n">name</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>If the first optional binds <code>?name</code> and <code>?x</code> to some values, the
+second <code>OPTIONAL</code> is an attempt to match the ground triples (<code>?x</code>
+and <code>&lt;kbd&gt;?name&lt;/kbd&gt;</code> have values). If the first optional did not
+match the optional part, then the second one is an attempt to match
+it's triple with two variables.</p>
+<p><a href="sparql_union.html">Next: union queries</a></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/tutorials/sparql_page.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/sparql_page.html (added)
+++ websites/staging/jena/trunk/content/jena/tutorials/sparql_page.html Sat Nov  5 01:11:09 2011
@@ -0,0 +1,172 @@
+<!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 - </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">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></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"></h1>
+    <h1 id="page">PAGE</h1>
+<p>This section covers ...</p>
+<p><a href="">Next: @@</a></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/tutorials/sparql_query1.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/sparql_query1.html (added)
+++ websites/staging/jena/trunk/content/jena/tutorials/sparql_query1.html Sat Nov  5 01:11:09 2011
@@ -0,0 +1,262 @@
+<!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 - SPARQL Tutorial - A First SPARQL 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">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></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">SPARQL Tutorial - A First SPARQL Query</h1>
+    <p>In this section, we look at a simple first query and show how to
+execute it with Jena.</p>
+<h2 id="a_hello_world_of_queries">A "hello world" of queries</h2>
+<p>The file "<a href="sparql_data/q1.rq">q1.rq</a>" contains the following query:</p>
+<div class="codehilite"><pre><span class="n">SELECT</span> <span class="p">?</span><span class="n">x</span>
+<span class="n">WHERE</span> <span class="p">{</span> <span class="p">?</span><span class="n">x</span>  <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#FN&gt;</span>  <span class="s">&quot;John Smith&quot;</span> <span class="p">}</span>
+</pre></div>
+
+
+<p>executing that query with the command line query application;</p>
+<div class="codehilite"><pre><span class="o">---------------------------------</span>
+<span class="o">|</span> <span class="n">x</span>                             <span class="o">|</span>
+<span class="o">=================================</span>
+<span class="o">|</span> <span class="sr">&lt;http://somewhere/JohnSmith/&gt;</span> <span class="o">|</span>
+<span class="o">---------------------------------</span>
+</pre></div>
+
+
+<p>This works by matching the triple pattern in the <code>WHERE</code> clause
+against the triples in the RDF graph. The predicate and object of
+the triple are fixed values so the pattern is going to match only
+triples with those values. The subject is a variable, and there are
+no other restrictions on the variable. The pattern matches any
+triples with these predicate and object values, and it matches with
+solutions for <code>x</code>.</p>
+<p>The item enclosed in &lt;&gt; is a URI (actually, it's an IRI) and the
+item enclosed in "" is a plain literal. Just like Turtle, N3 or
+N-triples, typed literals are written with ^^ and language tags
+can be added with @.</p>
+<p>?x is a variable called x. The ? does not form part of the name
+which is why it does not appear in the table output.</p>
+<p>There is one match. The query returns the match in the <code>x</code> query
+variable. The output shown was obtained by using one of ARQ's
+command line applications.</p>
+<h2 id="executing_the_query">Executing the query</h2>
+<p>There are <a href="/jena/documentation/query/cmds.html">helper scripts</a> in the ARQ <code>bat/</code> and
+<code>bin/</code> directories of the ARQ distribution. They may not be in a
+Jena distribution. You should check these scripts before use.</p>
+<h3 id="windows_setup">Windows setup</h3>
+<p>Set the <code>ARQROOT</code> environment variable to the file location of the
+ARQ distribution.</p>
+<div class="codehilite"><pre><span class="n">set</span> <span class="n">ARQROOT</span><span class="o">=</span><span class="n">c:</span><span class="o">\</span><span class="n">MyProjects</span><span class="o">\</span><span class="n">ARQ</span>
+</pre></div>
+
+
+<p>The distribution usually has the version number in the directory
+name.</p>
+<p>In the ARQ directory, execute:</p>
+<div class="codehilite"><pre><span class="n">bat</span><span class="o">\</span><span class="n">sparql</span><span class="o">.</span><span class="n">bat</span> <span class="o">--</span><span class="n">data</span><span class="o">=</span><span class="n">doc</span><span class="o">\</span><span class="n">Tutorial</span><span class="o">\</span><span class="n">vc</span><span class="o">-</span><span class="n">db</span><span class="o">-</span><span class="mi">1</span><span class="o">.</span><span class="n">rdf</span> <span class="o">--</span><span class="n">query</span><span class="o">=</span><span class="n">doc</span><span class="o">\</span><span class="n">Tutorial</span><span class="o">\</span><span class="n">q1</span><span class="o">.</span><span class="n">rq</span>
+</pre></div>
+
+
+<p>(TODO we will need to update these once the release structure is clear)</p>
+<p>You can just put the <code>bat/</code> directory on your classpath or copy the
+programs out of it. They all depend on ARQROOT.</p>
+<h3 id="bash_scripts_for_linuxcygwinunix">bash scripts for Linux/Cygwin/Unix</h3>
+<p>Set the <code>ARQROOT</code> environment variable to the file location of the
+ARQ distribution.</p>
+<div class="codehilite"><pre><span class="n">export</span> <span class="n">ARQROOT</span><span class="o">=</span><span class="nv">$HOME</span><span class="sr">/MyProjects/</span><span class="n">ARQ</span>
+</pre></div>
+
+
+<p>The distribution usually has the version number in the directory
+name.</p>
+<p>In the ARQ directory, execute:</p>
+<div class="codehilite"><pre><span class="n">bin</span><span class="sr">/sparql --data=doc/</span><span class="n">Tutorial</span><span class="sr">/vc-db-1.rdf --query=doc/</span><span class="n">Tutorial</span><span class="o">/</span><span class="n">q1</span><span class="o">.</span><span class="n">rq</span>
+</pre></div>
+
+
+<p>You can just put the <code>bin/</code> directory on your classpath or copy the
+programs out of it. They all depend on ARQROOT.</p>
+<p><a href="http://www.cygwin.com/">Cygwin</a> is a Linux-like environment for
+Windows.</p>
+<h3 id="using_the_java_command_line_applications_directly">Using the Java command line applications directly</h3>
+<p>You will need to set the classpath to include <em>all</em> the jar files
+in the ARQ <code>lib/</code> directory.</p>
+<p>For example, on Windows:</p>
+<div class="codehilite"><pre><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">antlr</span><span class="o">-</span><span class="mf">2.7.5</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">arq</span><span class="o">-</span><span class="n">extra</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">arq</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span>
+<span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">commons</span><span class="o">-</span><span class="n">logging</span><span class="o">-</span><span class="mf">1.1</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">concurrent</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">icu4j_3_4</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span>
+<span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">iri</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">jena</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">jenatest</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span>
+<span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">json</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">junit</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">log4j</span><span class="o">-</span><span class="mf">1.2.12</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span>
+<span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">lucene</span><span class="o">-</span><span class="n">core</span><span class="o">-</span><span class="mf">2.2.0</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">stax</span><span class="o">-</span><span class="n">api</span><span class="o">-</span><span class="mf">1.0</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span>
+<span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">wstx</span><span class="o">-</span><span class="n">asl</span><span class="o">-</span><span class="mf">3.0.0</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">xercesImpl</span><span class="o">.</span><span class="n">jar</span><span class="p">;</span><span class="n">ARQdir</span><span class="o">\</span><span class="n">lib</span><span class="o">\</span><span class="n">xml</span><span class="o">-</span><span class="n">apis</span><span class="o">.</span><span class="n">jar</span>
+</pre></div>
+
+
+<p>(TODO needs updating)</p>
+<p>where <code>&lt;i&gt;ARQdir&lt;/i&gt;</code> is where you unpacked ARQ. This must be all
+one line.</p>
+<p>The names of jar files sometimes changes and new jar files do get
+added - do check this list with your version of ARQ.</p>
+<p>The commands themselves are in the <code>arq</code> package.</p>
+<p><a href="sparql_basic_patterns.html">Next: basic patterns</a></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/tutorials/sparql_results.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/sparql_results.html (added)
+++ websites/staging/jena/trunk/content/jena/tutorials/sparql_results.html Sat Nov  5 01:11:09 2011
@@ -0,0 +1,243 @@
+<!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 - Producing Result Sets</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">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></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">Producing Result Sets</h1>
+    <p>SPARQL has four result forms:</p>
+<ul>
+<li>SELECT – Return a table of results.</li>
+<li>CONSTRUCT – Return an RDF graph, based on a template in the
+    query.</li>
+<li>DESCRIBE – Return an RDF graph, based on what the query
+    processor is configured to return.</li>
+<li>ASK – Ask a boolean query.</li>
+</ul>
+<p>The SELECT form directly returns a table of solutions as a result
+set, while DESCRIBE and CONSTRUCT use the outcome of matching to
+build RDF graphs.</p>
+<h2 id="solution_modifiers">Solution Modifiers</h2>
+<p>Pattern matching produces a set of solutions. This set can be
+modified in various ways:</p>
+<ul>
+<li>Projection - keep only selected variables</li>
+<li>OFFSET/LIMIT - chop the number solutions (best used with ORDER
+    BY)</li>
+<li>ORDER BY - sorted results</li>
+<li>DISTINCT - yield only one row for one combination of variables
+    and values.</li>
+</ul>
+<p>The solution modifiers OFFSET/LIMIT and ORDER BY always apply to
+all result forms. </p>
+<h3 id="offset_and_limit">OFFSET and LIMIT</h3>
+<p>A set of solutions can be abbreviated by specifying the offset (the
+start index) and the limit (the number of solutions) to be
+returned. Using LIMIT alone can be useful to ensure not too many
+solutions are returned, to restrict the effect of some unexpected
+situation.  LIMIT and OFFSET can be used in conjunction with
+sorting to take a defined slice through the solutions found.</p>
+<h3 id="order_by">ORDER BY</h3>
+<p>SPARQL solutions are sorted by expression, including custom
+functions.</p>
+<div class="codehilite"><pre><span class="n">ORDER</span> <span class="n">BY</span> <span class="p">?</span><span class="n">x</span> <span class="p">?</span><span class="n">y</span>
+
+<span class="n">ORDER</span> <span class="n">BY</span> <span class="n">DESC</span><span class="p">(?</span><span class="n">x</span><span class="p">)</span>
+
+<span class="n">ORDER</span> <span class="n">BY</span> <span class="n">x:func</span><span class="p">(?</span><span class="n">x</span><span class="p">)</span>  <span class="c1"># Custom sorting condition</span>
+</pre></div>
+
+
+<h3 id="distinct">DISTINCT</h3>
+<p>The SELECT result form can take the DISTINCT modifier which ensures
+that no two solutions returned are the same - this takes place
+after projection to the requested variables.</p>
+<h2 id="select">SELECT</h2>
+<p>The <code>SELECT</code> result form is a projection, with DISTINCT applied, of
+the solution set. <code>SELECT</code> identifies which named variables are in
+the result set.  This may be "<code>*</code>" meaning "all named variables"
+(blank nodes in the query act like variables for matching but are
+never returned).</p>
+<h2 id="construct">CONSTRUCT</h2>
+<p>CONSTRUCT builds an RDF based on a graph template.  The graph
+template can have variables which are bound by a WHERE clause.  The
+effect is to calculate the graph fragment, given the template, for
+each solution from the WHERE clause, after taking into account any
+solution modifiers. The graph fragments, one per solution, are
+merged into a single RDF graph which is the result.</p>
+<p>Any blank nodes explicitly mentioned in the graph template are
+created afresh for each time the template is used for a solution.</p>
+<h2 id="describe">DESCRIBE</h2>
+<p>The CONSTRUCT form, takes an application template for the graph
+results. The DESCRIBE form also creates a graph but the form of
+that graph is provided the query processor, not the application.
+For each URI found, or explicitly mentioned in the DESCRIBE clause,
+the query processor should provide a useful fragment of RDF, such
+as all the known details of a book. ARQ allows domain-specific
+description handlers to be written.</p>
+<h2 id="ask">ASK</h2>
+<p>The ASK result form returns a boolean, true of the pattern matched
+otherwise false.</p>
+<p><a href="index.html">Return to index</a></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/tutorials/sparql_union.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/sparql_union.html (added)
+++ websites/staging/jena/trunk/content/jena/tutorials/sparql_union.html Sat Nov  5 01:11:09 2011
@@ -0,0 +1,301 @@
+<!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 - SPARQL Tutorial - Alternatives in a Pattern</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">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></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">SPARQL Tutorial - Alternatives in a Pattern</h1>
+    <p>Another way of dealing with the semi-structured data is to query
+for one of a number of possibilities. This section covers <code>UNION</code>
+patterns, where one of a number of possibilities is tried.</p>
+<h2 id="union_-_two_ways_to_the_same_data">UNION - two ways to the same data</h2>
+<p>Both the vCard vocabulary and the FOAF vocabulary have properties
+for people's names.  In vCard, it is vCard:FN, the "formatted
+name", and in FOAF, it is foaf:name. In this section, we will look
+at a small set of data where the names of people can be given by
+either the FOAF or the vCard vocabulary.</p>
+<p>Suppose we have <a href="sparql_data/vc-db-3.ttl">an RDF graph</a> that contains name
+information using both the vCard and FOAF vocabularies.</p>
+<div class="codehilite"><pre><span class="nv">@prefix</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span> <span class="o">.</span>
+<span class="nv">@prefix</span> <span class="n">vcard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span> <span class="o">.</span>
+
+<span class="n">_:a</span> <span class="n">foaf:name</span>   <span class="s">&quot;Matt Jones&quot;</span> <span class="o">.</span>
+
+<span class="n">_:b</span> <span class="n">foaf:name</span>   <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">.</span>
+
+<span class="n">_:c</span> <span class="n">vcard:FN</span>    <span class="s">&quot;Becky Smith&quot;</span> <span class="o">.</span>
+
+<span class="n">_:d</span> <span class="n">vcard:FN</span>    <span class="s">&quot;John Smith&quot;</span> <span class="o">.</span>
+</pre></div>
+
+
+<p>A query to access the name information, when it can be in either
+form, could be (<a href="sparql_data/q-union1.rq">q-union1.rq</a>):</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vCard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+   <span class="p">{</span> <span class="o">[]</span> <span class="n">foaf:name</span> <span class="p">?</span><span class="n">name</span> <span class="p">}</span> <span class="n">UNION</span> <span class="p">{</span> <span class="o">[]</span> <span class="n">vCard:FN</span> <span class="p">?</span><span class="n">name</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>This returns the results:</p>
+<div class="codehilite"><pre><span class="o">-----------------</span>
+<span class="o">|</span> <span class="n">name</span>          <span class="o">|</span>
+<span class="o">=================</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span>
+<span class="o">-----------------</span>
+</pre></div>
+
+
+<p>It didn't matter which form of expression was used for the name,
+the ?name variable is set. This can be achieved using a <code>FILTER</code> as
+this query (<a href="sparql_data/q-union1alt.rq">q-union-1alt.rq</a>) shows:</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vCard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+  <span class="o">[]</span> <span class="p">?</span><span class="n">p</span> <span class="p">?</span><span class="n">name</span>
+  <span class="n">FILTER</span> <span class="p">(</span> <span class="p">?</span><span class="n">p</span> <span class="o">=</span> <span class="n">foaf:name</span> <span class="o">||</span> <span class="p">?</span><span class="n">p</span> <span class="o">=</span> <span class="n">vCard:FN</span> <span class="p">)</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>testing whether the property is one URI or another. The solutions
+may not come out in the same order.  The first form is more likely
+to be faster, depending on the data and the storage used, because
+the second form may have to get all the triples from the graph to
+match the triple pattern with unbound variables (or blank nodes) in
+each slot, then test each <code>?p</code> to see it it matches one of the
+values. It will depend on the sophistication of the query optimizer
+as to whether it spots that it can perform the query more
+efficiently and is able to pass the constraint down as will as to
+the storage layer.</p>
+<h2 id="union_-_remembering_where_the_data_was_found">Union - remembering where the data was found.</h2>
+<p>The example above used the same variable in each branch. If
+different variables are used, the application can discover which
+sub-pattern caused the match (<a href="sparql_data/q-union2.rq">q-union2.rq</a>):</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vCard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name1</span> <span class="p">?</span><span class="n">name2</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+   <span class="p">{</span> <span class="o">[]</span> <span class="n">foaf:name</span> <span class="p">?</span><span class="n">name1</span> <span class="p">}</span> <span class="n">UNION</span> <span class="p">{</span> <span class="o">[]</span> <span class="n">vCard:FN</span> <span class="p">?</span><span class="n">name2</span> <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="o">---------------------------------</span>
+<span class="o">|</span> <span class="n">name1</span>         <span class="o">|</span> <span class="n">name2</span>         <span class="o">|</span>
+<span class="o">=================================</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>               <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>               <span class="o">|</span>
+<span class="o">|</span>               <span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span>
+<span class="o">|</span>               <span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span>
+<span class="o">---------------------------------</span>
+</pre></div>
+
+
+<p>This second query has retained information of where the name of the
+person came from by assigning the name to different variables.</p>
+<h2 id="optional_and_union">OPTIONAL and UNION</h2>
+<p>In practice, <code>OPTIONAL</code> is more common than <code>UNION</code> but they both
+have their uses. <code>OPTIONAL</code> are useful for augmenting the solutions
+found, <code>UNION</code> is useful for concatenating the solutions from two
+possibilities. They don't necessary return the information in the
+same way:</p>
+<p>Query(<a href="sparql_data/q-union3.rq">q-union3.rq</a>):</p>
+<div class="codehilite"><pre><span class="n">PREFIX</span> <span class="n">foaf:</span> <span class="sr">&lt;http://xmlns.com/foaf/0.1/&gt;</span>
+<span class="n">PREFIX</span> <span class="n">vCard:</span> <span class="sr">&lt;http://www.w3.org/2001/vcard-rdf/3.0#&gt;</span>
+
+<span class="n">SELECT</span> <span class="p">?</span><span class="n">name1</span> <span class="p">?</span><span class="n">name2</span>
+<span class="n">WHERE</span>
+<span class="p">{</span>
+  <span class="p">?</span><span class="n">x</span> <span class="n">a</span> <span class="n">foaf:Person</span>
+  <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">x</span>  <span class="n">foaf:name</span>  <span class="p">?</span><span class="n">name1</span> <span class="p">}</span>
+  <span class="n">OPTIONAL</span> <span class="p">{</span> <span class="p">?</span><span class="n">x</span>  <span class="n">vCard:FN</span>   <span class="p">?</span><span class="n">name2</span> <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="o">---------------------------------</span>
+<span class="o">|</span> <span class="n">name1</span>         <span class="o">|</span> <span class="n">name2</span>         <span class="o">|</span>
+<span class="o">=================================</span>
+<span class="o">|</span> <span class="s">&quot;Matt Jones&quot;</span>  <span class="o">|</span>               <span class="o">|</span>
+<span class="o">|</span> <span class="s">&quot;Sarah Jones&quot;</span> <span class="o">|</span>               <span class="o">|</span>
+<span class="o">|</span>               <span class="o">|</span> <span class="s">&quot;Becky Smith&quot;</span> <span class="o">|</span>
+<span class="o">|</span>               <span class="o">|</span> <span class="s">&quot;John Smith&quot;</span>  <span class="o">|</span>
+<span class="o">---------------------------------</span>
+</pre></div>
+
+
+<p>but beware of using <code>?name</code> in each <code>OPTIONAL</code> because that is an
+order-dependent query.</p>
+<p><a href="sparql_datasets.html">Next: Named Graphs</a></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>

Modified: websites/staging/jena/trunk/content/jena/tutorials/using_jena_with_eclipse.html
==============================================================================
--- websites/staging/jena/trunk/content/jena/tutorials/using_jena_with_eclipse.html (original)
+++ websites/staging/jena/trunk/content/jena/tutorials/using_jena_with_eclipse.html Sat Nov  5 01:11:09 2011
@@ -86,7 +86,8 @@
 </ul>
 <h1 id="tutorials">Tutorials</h1>
 <ul>
-<li><a href="/jena/tutorials/index.html">RDF tutorial</a></li>
+<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>



Mime
View raw message