Author: buildbot
Date: Thu Aug 20 00:05:48 2015
New Revision: 962401
Log:
Staging update by buildbot for jena
Modified:
websites/staging/jena/trunk/content/ (props changed)
websites/staging/jena/trunk/content/documentation/query/construct-quad.html
Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Aug 20 00:05:48 2015
@@ -1 +1 @@
-1696533
+1696691
Modified:
websites/staging/jena/trunk/content/documentation/query/construct-quad.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/query/construct-quad.html
(original)
+++ websites/staging/jena/trunk/content/documentation/query/construct-quad.html
Thu Aug 20 00:05:48 2015
@@ -156,19 +156,19 @@
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink,
h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink,
dt:hover > .elementid-permalink { visibility: visible }</style>
<p>The current W3C recommendation of
-<a href="http://www.w3.org/TR/sparql11-query/">SPARQL 1.1</a> supports the
CONSTRUCT query
-form, which returns a single RDF graph specified by a graph template. The
+<a href="http://www.w3.org/TR/sparql11-query/">SPARQL 1.1</a> supports the <a
href="http://www.w3.org/TR/sparql11-query/#construct">CONSTRUCT query
+form</a>, which returns a single RDF graph specified by a graph template. The
result is an RDF graph formed by taking each query solution in the solution
sequence, substituting for the variables in the graph template, and
combining the triples into a single RDF graph by set union. However, it
does not directly generate quads or
<a href="http://www.w3.org/TR/sparql11-query/#rdfDataset">RDF datasets</a>.<br
/>
In order to
-eliminate this limitation, Jena ARQ extends the grammar of the CONSTRUCT
+eliminate this limitation, Jena ARQ extends the grammar of the
<code>CONSTRUCT</code>
query form and provides the according components, which brings more
conveniences for the users manipulating RDF datasets with SPARQL.</p>
<h2 id="query-syntax">Query Syntax<a class="headerlink" href="#query-syntax"
title="Permanent link">¶</a></h2>
-<p>A CONSTRUST template of the SPARQL 1.1 query String is
+<p>A <code>CONSTRUST</code> template of the SPARQL 1.1 query String is
<a href="http://www.w3.org/TR/turtle/">Turtle</a> format with possible
variables. The
syntax for this extension follows that style in ARQ, using
<a href="http://www.w3.org/TR/trig/">TriG</a> plus variables. Just like
SPARQL 1.1,
@@ -185,51 +185,79 @@ there're 2 forms for ARQ Contruct Quad q
<span class="p">:</span><span class="n">s</span> ?<span class="n">p</span>
<span class="p">:</span><span class="n">o</span>
<span class="p">}</span> <span class="n">WHERE</span> <span class="p">{</span>
# <span class="n">SPARQL</span> 1<span class="p">.</span>1 <span
class="n">WHERE</span> <span class="n">Clause</span>
-<span class="p">...</span>
+ <span class="p">...</span>
<span class="p">}</span>
</pre></div>
<p>The default graphs and the named graphs can be constructed within the
-CONSTRUCT clause in the above way. Note that, for constructing the named
-graph, the token of GRAPH can be optional. The brackets of the triples to
+<code>CONSTRUCT</code> clause in the above way. Note that, for constructing
the named
+graph, the token of <code>GRAPH</code> can be optional. The brackets of the
triples to
be constructed in the default graph can also be optional.</p>
<h3 id="short-form">Short Form<a class="headerlink" href="#short-form"
title="Permanent link">¶</a></h3>
<div class="codehilite"><pre><span class="n">CONSTRUCT</span> <span
class="n">WHERE</span> <span class="p">{</span>
# <span class="n">Basic</span> <span class="n">dataset</span> <span
class="n">pattern</span> <span class="p">(</span><span class="n">only</span>
<span class="n">the</span> <span class="n">default</span> <span
class="n">graph</span> <span class="n">and</span> <span class="n">the</span>
<span class="n">named</span> <span class="n">graphs</span><span
class="p">)</span>
-<span class="p">...</span>
+ <span class="p">...</span>
<span class="p">}</span>
</pre></div>
<p>A short form is provided for the case where the template and the pattern
-are the same and the pattern is just a basic dataset pattern (no FILTERs
+are the same and the pattern is just a basic dataset pattern (no
<code>FILTER</code>s
and no complex graph patterns are allowed in the short form). The keyword
-WHERE is required in the short form.</p>
+<code>WHERE</code> is required in the short form.</p>
<h3 id="grammar">Grammar<a class="headerlink" href="#grammar" title="Permanent
link">¶</a></h3>
<p>The normative definition of the syntax grammar of the query string is
defined in this table:</p>
-<div class="codehilite"><pre><span class="n">ConstructQuery</span>
<span class="o">|</span> <span class="p">::=</span> <span
class="s">'CONSTRUCT'</span> <span class="p">(</span> <span
class="n">ConstructTemplate</span> <span class="n">DatasetClause</span><span
class="o">*</span> <span class="n">WhereClause</span> <span
class="n">SolutionModifier</span> <span class="o">|</span> <span
class="n">DatasetClause</span><span class="o">*</span> <span
class="s">'WHERE'</span> <span class="s">'{'</span> <span
class="n">ConstructQuads</span> <span class="s">'}'</span> <span
class="n">SolutionModifier</span> <span class="p">)</span>
-<span class="n">ConstructTemplate</span> <span class="o">|</span>
<span class="p">::=</span> <span class="s">'{'</span> <span
class="n">ConstructQuads</span> <span class="s">'}'</span>
-<span class="n">ConstructQuads</span> <span class="o">|</span>
<span class="p">::=</span> <span class="n">TriplesTemplate</span>? <span
class="p">(</span> <span class="n">ConstructQuadsNotTriples</span> <span
class="s">'.'</span>? <span class="n">TriplesTemplate</span>? <span
class="p">)</span><span class="o">*</span>
-<span class="n">ConstructQuadsNotTriples</span> <span class="o">|</span>
<span class="p">::=</span> <span class="p">(</span> <span
class="s">'GRAPH'</span> <span class="n">VarOrIri</span> <span
class="p">)</span>? <span class="s">'{'</span> <span
class="n">TriplesTemplate</span>? <span class="s">'}'</span>
-<span class="n">TriplesTemplate</span> <span class="o">|</span>
<span class="p">::=</span> <span class="n">TriplesSameSubject</span> <span
class="p">(</span> <span class="s">'.'</span> <span
class="n">TriplesTemplate</span>? <span class="p">)</span>?
-</pre></div>
-
-
+<table class="table">
+<thead>
+<tr>
+<th>Rule</th>
+<th></th>
+<th>Expression</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>ConstructQuery</td>
+<td>::=</td>
+<td>'CONSTRUCT' ( ConstructTemplate DatasetClause* WhereClause
SolutionModifier \</td>
+</tr>
+<tr>
+<td>ConstructTemplate</td>
+<td>::=</td>
+<td ConstructQuads="ConstructQuads" _="'">'</td>
+</tr>
+<tr>
+<td>ConstructQuads</td>
+<td>::=</td>
+<td>TriplesTemplate? ( ConstructQuadsNotTriples '.'? TriplesTemplate? )*</td>
+</tr>
+<tr>
+<td>ConstructQuadsNotTriples</td>
+<td>::=</td>
+<td TriplesTemplate_="TriplesTemplate?" _="'">( 'GRAPH' VarOrIri )? '</td>
+</tr>
+<tr>
+<td>TriplesTemplate</td>
+<td>::=</td>
+<td>TriplesSameSubject ( '.' TriplesTemplate? )?</td>
+</tr>
+</tbody>
+</table>
<p><code>DatasetClause</code>, <code>WhereClause</code>,
<code>SolutionModifier</code>, <code>TriplesTemplate</code>,
<code>VarOrIri</code>,
<code>TriplesSameSubject</code> are as for the <a
href="http://www.w3.org/TR/sparql11-query/#grammar">SPARQL 1.1 Grammar</a></p>
<h2 id="programming-api">Programming API<a class="headerlink"
href="#programming-api" title="Permanent link">¶</a></h2>
-<p>ARQ provides 2 additional methods in QueryExecution for Construct Quad.</p>
+<p>ARQ provides 2 additional methods in <a
href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/QueryExecution.html">QueryExecution</a>
for Construct Quad.</p>
<div class="codehilite"><pre><span class="n">Iterator</span><span
class="o"><</span><span class="n">Quad</span><span class="o">></span>
<span class="n">QueryExecution</span><span class="p">.</span><span
class="n">execConstructQuads</span><span class="p">()</span> <span
class="o">//</span> <span class="n">allow</span> <span
class="n">duplication</span>
<span class="n">Dataset</span> <span class="n">QueryExecution</span><span
class="p">.</span><span class="n">execConstructDataset</span><span
class="p">()</span> <span class="o">//</span> <span class="n">no</span> <span
class="n">duplication</span>
</pre></div>
<p>One difference of the 2 methods is:
-The method of execConstructQuads() returns an Iterator of Quad, allowing
duplication.
-But execConstructDataset() constructs the desired Dataset object with only
unique Quads.</p>
+The method of <code>execConstructQuads()</code> returns an
<code>Iterator</code> of <code>Quad</code>, allowing duplication.
+But <code>execConstructDataset()</code> constructs the desired Dataset object
with only unique <code>Quad</code>s.</p>
<p>In order to use these methods, it's required to swtich on the query syntax
-of ARQ beforehead, when creating the Query object:</p>
+of ARQ beforehead, when creating the <code>Query</code> object:</p>
<div class="codehilite"><pre><span class="n">Query</span> <span
class="n">query</span> <span class="p">=</span> <span
class="n">QueryFactory</span><span class="p">.</span><span
class="n">create</span><span class="p">(</span><span
class="n">queryString</span><span class="p">,</span> <span
class="n">Syntax</span><span class="p">.</span><span
class="n">syntaxARQ</span><span class="p">);</span>
</pre></div>
@@ -244,8 +272,8 @@ will be constructed in the default graph
<p>If the query string stands for constructing quads while the method of
-exeConstructTriples() are called, it returns only the triples in the
-default graph of the CONSTRUCT query template. It's called a "projection"
+<code>exeConstructTriples()</code> are called, it returns only the triples in
the
+default graph of the <code>CONSTRUCT</code> query template. It's called a
"projection"
on the default graph. For instance:</p>
<div class="codehilite"><pre><span class="n">String</span> <span
class="n">queryString</span> <span class="p">=</span> "<span
class="n">CONSTRUCT</span> <span class="p">{</span> ?<span class="n">s</span>
?<span class="n">p</span> ?<span class="n">o</span> <span class="p">.</span>
<span class="n">GRAPH</span> ?<span class="n">g1</span> <span
class="p">{</span> ?<span class="n">s1</span> ?<span class="n">p1</span> ?<span
class="n">o1</span> <span class="p">}</span> <span class="p">}</span> <span
class="n">WHERE</span> <span class="p">...</span>"
<span class="p">...</span>
@@ -254,12 +282,12 @@ on the default graph. For instance:</p>
</pre></div>
-<p>More examples can be found at
jena-arq/src-examples/arq/examples/constructquads/ExampleConstructQuads.java</p>
+<p>More examples can be found at <code>ExampleConstructQuads.java</code> under
<code>jena-arq/src-examples</code></p>
<h2 id="fuseki-support">Fuseki Support<a class="headerlink"
href="#fuseki-support" title="Permanent link">¶</a></h2>
-<p>Jena [Fuseki] is also empowed with Construct Quad query as a built-in
+<p>Jena <a
href="http://jena.apache.org/documentation/fuseki2/index.html">Fuseki</a> is
also empowed with Construct Quad query as a built-in
function. No more addtional configuration is required to switch it on.
Because
-<a
href="http://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/sparql/engine/http/QueryEngineHTTP.html">QueryEngineHTTP</a>
+<a
href="http://jena.apache.org/documentation/javadoc/arq/org/apache/jena/sparql/engine/http/QueryEngineHTTP.html">QueryEngineHTTP</a>
is just an implementation of QueryExcecution, there's no much difference
for the client users to manipulate the programming API described in the
previous sections, e.g.</p>
@@ -267,10 +295,13 @@ previous sections, e.g.</p>
<span class="n">Query</span> <span class="n">query</span> <span
class="p">=</span> <span class="n">QueryFactory</span><span
class="p">.</span><span class="n">create</span><span class="p">(</span><span
class="n">queryString</span><span class="p">,</span> <span
class="n">Syntax</span><span class="p">.</span><span
class="n">syntaxARQ</span><span class="p">);</span>
<span class="k">try</span> <span class="p">(</span> <span
class="n">QueryExecution</span> <span class="n">qExec</span> <span
class="p">=</span> <span class="n">QueryExecutionFactory</span><span
class="p">.</span><span class="n">sparqlService</span><span
class="p">(</span><span class="n">serviceQuery</span><span class="p">,</span>
<span class="n">query</span><span class="p">)</span> <span class="p">)</span>
<span class="p">{</span> <span class="o">//</span> <span
class="n">serviceQuery</span> <span class="n">is</span> <span
class="n">the</span> <span class="n">URL</span> <span class="n">of</span> <span
class="n">the</span> <span class="n">remote</span> <span
class="n">service</span>
<span class="n">Iterator</span><span class="o"><</span><span
class="n">Quad</span><span class="o">></span> <span class="n">result</span>
<span class="p">=</span> <span class="n">qExec</span><span
class="p">.</span><span class="n">execConstructQuads</span><span
class="p">();</span>
-<span class="p">...</span>
+ <span class="p">...</span>
<span class="p">}</span>
<span class="p">...</span>
</pre></div>
+
+
+<p><a href="index.html">ARQ documentation index</a></p>
</div>
</div>