Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 5b6c31d6428e1f6ea754ea6f7b1aed6e > files > 193

soprano-apidocs-2.6.0-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Soprano: Soprano::QueryResultIterator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Soprano&#160;<span id="projectnumber">2.6.0</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceSoprano.html">Soprano</a>      </li>
      <li class="navelem"><a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<h1>Soprano::QueryResultIterator Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Soprano::QueryResultIterator" --><!-- doxytag: inherits="Iterator&lt; BindingSet &gt;" -->
<p>An iterator for query results.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="queryresultiterator_8h_source.html">Soprano/QueryResultIterator</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png"/> Inheritance diagram for Soprano::QueryResultIterator:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classSoprano_1_1QueryResultIterator__inherit__graph.png" border="0" usemap="#Soprano_1_1QueryResultIterator_inherit__map" alt="Inheritance graph"/></div>
<map name="Soprano_1_1QueryResultIterator_inherit__map" id="Soprano_1_1QueryResultIterator_inherit__map">
<area shape="rect" id="node10" href="classSoprano_1_1Client_1_1DBusQueryResultIterator.html" title="Interface to a DBus server query result iterator." alt="" coords="5,341,272,371"/><area shape="rect" id="node2" href="classSoprano_1_1Iterator.html" title="Soprano::Iterator\&lt; BindingSet \&gt;" alt="" coords="36,181,241,211"/><area shape="rect" id="node4" href="classSoprano_1_1Error_1_1ErrorCache.html" title="Core class of Soprano&#39;s exception system." alt="" coords="64,5,243,35"/><area shape="rect" id="node6" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class." alt="" coords="155,85,304,115"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classSoprano_1_1QueryResultIterator-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#aa780226058973f40c8a2030e29a183fd">QueryResultIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a7ddb07996e63483966841c92bc2bbae3">QueryResultIterator</a> (const <a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a> &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a41205f8686ced40379054cb7116c6f2d">QueryResultIterator</a> (<a class="el" href="classSoprano_1_1QueryResultIteratorBackend.html">QueryResultIteratorBackend</a> *qr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a4c3edcd957fca981654e420ffc7c6b69">~QueryResultIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a9fee954a4aafa8d2fd8d3ccbf1eb7d10">operator=</a> (const <a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a> &amp;)</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Statement.html">Statement</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#ae12d1b77dc81089975f584d1bac8bff5">currentStatement</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1BindingSet.html">BindingSet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a43bf7e0f3db4d5fce76c82b801f62fa0">currentBindings</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a70996b0f1c492e712a7cfb2a2c3b4127">boolValue</a> () const </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Node.html">Node</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#aaa38f389eb05cd459af7c5adb0bc0913">operator[]</a> (int offset) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Node.html">Node</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#aed684887e97532e9eb248433113e64a3">operator[]</a> (const <a class="elRef" href="qstring.html">QString</a> name) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Node.html">Node</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a109b615a2f3f07d1924de368afc302bf">binding</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;name) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Node.html">Node</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#aa5ded24bcb7c099bc109f614f3a9d3e7">binding</a> (int offset) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a174b9537f99f5b8f77cf8a81072f086d">bindingCount</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qstringlist.html">QStringList</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#ace6fd8bd8f50a9c5f844e2375de8dd75">bindingNames</a> () const </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#af2baa54907bb00c42914f300999b03fc">isGraph</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a525628dfafcc4b0d47d555c12699fe41">isBinding</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a9b3e90c00c2a77f20e199d7a1243394d">isBool</a> () const </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qlist.html">QList</a>&lt; <a class="el" href="classSoprano_1_1BindingSet.html">BindingSet</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#af8fdbfcf30b718aba94457f052c781d3">allBindings</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1StatementIterator.html">StatementIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a3641492adf6ade294fa2079291300ea2">iterateStatements</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a8e79fda5bafa6ddda5dac731ed0fda2e">iterateBindings</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;variableName) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#acb0f3495b8f9a151cb6c0aa6831bb1ae">iterateBindings</a> (int offset) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1StatementIterator.html">StatementIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1QueryResultIterator.html#a725667dad0ba3a87f35a5652d96c92d7">iterateStatementsFromBindings</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;subjectBindingName, const <a class="elRef" href="qstring.html">QString</a> &amp;predicateBindingName, const <a class="elRef" href="qstring.html">QString</a> &amp;objectBindingName, const <a class="elRef" href="qstring.html">QString</a> &amp;contextBindingName=<a class="elRef" href="qstring.html">QString</a>(), const <a class="el" href="classSoprano_1_1Statement.html">Statement</a> &amp;templateStatement=<a class="el" href="classSoprano_1_1Statement.html">Statement</a>()) const </td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An iterator for query results. </p>
<p>Query results in Soprano are wrapped in a <a class="el" href="classSoprano_1_1QueryResultIterator.html" title="An iterator for query results.">QueryResultIterator</a>.</p>
<p>Query iterators are returned by <a class="el" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">Model::executeQuery()</a>. In contrast to <a class="el" href="classSoprano_1_1NodeIterator.html" title="An iterator that provides a stream of Nodes.">NodeIterator</a> or <a class="el" href="classSoprano_1_1StatementIterator.html" title="An iterator that provides a stream of Statements.">StatementIterator</a> QueryResultIterator has a set of different access methods for the current dataset which can be one of three things:</p>
<ul>
<li>A <a class="el" href="classSoprano_1_1Statement.html" title="A Statement instance represents one RDF quadruple.">Statement</a>: <a class="el" href="classSoprano_1_1Graph.html" title="A simple collection of statements.">Graph</a> query results are represented as a stream of statements. See also <a class="el" href="classSoprano_1_1QueryResultIterator.html#ae12d1b77dc81089975f584d1bac8bff5">currentStatement()</a> and <a class="el" href="classSoprano_1_1QueryResultIterator.html#a3641492adf6ade294fa2079291300ea2">iterateStatements()</a>. </li>
<li>A <a class="el" href="classSoprano_1_1BindingSet.html" title="Represents one set of bindings in the result of a select query.">BindingSet</a>: Tuple query results are represented by a set of variable bindings according to the variables used in the query. The bindings can be accessed as a set through the normal <a class="el" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class.">Iterator</a> method <a class="el" href="classSoprano_1_1Iterator.html#a7060834a96aced1bba25e760474ac22e">current()</a> or separately through <a class="el" href="classSoprano_1_1QueryResultIterator.html#aa5ded24bcb7c099bc109f614f3a9d3e7">binding(int) const </a>or <a class="el" href="classSoprano_1_1QueryResultIterator.html#a109b615a2f3f07d1924de368afc302bf">binding(const QString&amp;) const</a>. </li>
<li>A boolean value: This is a special case in which the query was a boolean query (a SPARQL ASK query). In this case there is nothing to iterate but only a single boolean value which can be accessed through <a class="el" href="classSoprano_1_1QueryResultIterator.html#a70996b0f1c492e712a7cfb2a2c3b4127">boolValue()</a>.</li>
</ul>
<p><b>Example:</b></p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classSoprano_1_1QueryResultIterator.html#aa780226058973f40c8a2030e29a183fd">QueryResultIterator</a> it = model-&gt;<a class="code" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">executeQuery</a>( someGraphQuery );
 <span class="keywordflow">while</span>( it.next() ) {
    doSomething( it.currentStatement() );
 }

 <a class="code" href="classSoprano_1_1QueryResultIterator.html#aa780226058973f40c8a2030e29a183fd">QueryResultIterator</a> it2 = model-&gt;<a class="code" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">executeQuery</a>( someTupleQuery );
 <span class="keywordflow">while</span>( it.next() ) {
    doSomethingElse( it.currentBindings() );
    doSomethingCompletelyDifferent( it.binding( <span class="stringliteral">&quot;x&quot;</span> ) );
    doSomethingEntirelyDifferent( it.binding( 0 ) );
 }
</pre></div><p>Many backends do lock the underlying <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> during iteration. Thus, it is always a good idea to cache the results if they are to be used to modify the model to prevent a deadlock:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classSoprano_1_1QueryResultIterator.html" title="An iterator for query results.">Soprano::QueryResultIterator</a> it = model-&gt;<a class="code" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">executeQuery</a>( someTupleQuery );
 <a class="codeRef" href="qlist.html">QList&lt;BindingSet&gt;</a> <a class="code" href="classSoprano_1_1QueryResultIterator.html#af8fdbfcf30b718aba94457f052c781d3">allBindings</a> = it.<a class="code" href="classSoprano_1_1QueryResultIterator.html#af8fdbfcf30b718aba94457f052c781d3">allBindings</a>();
 Q_FOREACH( <a class="code" href="classSoprano_1_1BindingSet.html" title="Represents one set of bindings in the result of a select query.">Soprano::BindingSet</a> bs, allBindings ) {
    modifyTheModel( model, bs );
 }
</pre></div><p>Iterators have to be closed. This can either be achieved by deleting the iterator, finishing it (<a class="el" href="classSoprano_1_1Iterator.html#a1ba632f6f015242ab9441da77d48415b">next()</a> does return <code>false</code>), or calling <a class="el" href="classSoprano_1_1Iterator.html#a623fb6440a6cfadbb560bd7738c01871">close()</a>. Before that other operations on the <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> may block.</p>
<p>Iterators are not thread-safe. Two threads using the same iterator may result in undefined behaviour and even crashes. An iterator needs to be closed by the same thread that opened it (except if the iterator contains special code to handle such a situation.)</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Be aware that iterators in <a class="el" href="namespaceSoprano.html">Soprano</a> are shared objects which means that copies of one iterator object work on the same data.</dd></dl>
<p>For further details on Soprano iterators see <a class="el" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class.">Iterator</a>.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Daniele Galdi &lt;<a href="mailto:daniele.galdi@gmail.com">daniele.galdi@gmail.com</a>&gt;<br/>
Sebastian Trueg &lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="queryresultiterator_8h_source.html#l00109">109</a> of file <a class="el" href="queryresultiterator_8h_source.html">queryresultiterator.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa780226058973f40c8a2030e29a183fd"></a><!-- doxytag: member="Soprano::QueryResultIterator::QueryResultIterator" ref="aa780226058973f40c8a2030e29a183fd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::QueryResultIterator::QueryResultIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates and empty, invalid iterator. </p>

</div>
</div>
<a class="anchor" id="a7ddb07996e63483966841c92bc2bbae3"></a><!-- doxytag: member="Soprano::QueryResultIterator::QueryResultIterator" ref="a7ddb07996e63483966841c92bc2bbae3" args="(const QueryResultIterator &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::QueryResultIterator::QueryResultIterator </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a> &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copy constructor. Copies of iterators share their data. </p>

</div>
</div>
<a class="anchor" id="a41205f8686ced40379054cb7116c6f2d"></a><!-- doxytag: member="Soprano::QueryResultIterator::QueryResultIterator" ref="a41205f8686ced40379054cb7116c6f2d" args="(QueryResultIteratorBackend *qr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::QueryResultIterator::QueryResultIterator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classSoprano_1_1QueryResultIteratorBackend.html">QueryResultIteratorBackend</a> *&#160;</td>
          <td class="paramname"><em>qr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a new <a class="el" href="classSoprano_1_1QueryResultIterator.html" title="An iterator for query results.">QueryResultIterator</a> which uses qr as backend. <a class="el" href="classSoprano_1_1QueryResultIterator.html" title="An iterator for query results.">QueryResultIterator</a> will take ownership of the <a class="el" href="classSoprano_1_1QueryResultIteratorBackend.html" title="QueryResultIteratorBackend is the actual working horse behind QueryResultIterator.">QueryResultIteratorBackend</a>. </p>

</div>
</div>
<a class="anchor" id="a4c3edcd957fca981654e420ffc7c6b69"></a><!-- doxytag: member="Soprano::QueryResultIterator::~QueryResultIterator" ref="a4c3edcd957fca981654e420ffc7c6b69" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Soprano::QueryResultIterator::~QueryResultIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a9fee954a4aafa8d2fd8d3ccbf1eb7d10"></a><!-- doxytag: member="Soprano::QueryResultIterator::operator=" ref="a9fee954a4aafa8d2fd8d3ccbf1eb7d10" args="(const QueryResultIterator &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a>&amp; Soprano::QueryResultIterator::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSoprano_1_1QueryResultIterator.html">QueryResultIterator</a> &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copies of iterators share their data. </p>

</div>
</div>
<a class="anchor" id="ae12d1b77dc81089975f584d1bac8bff5"></a><!-- doxytag: member="Soprano::QueryResultIterator::currentStatement" ref="ae12d1b77dc81089975f584d1bac8bff5" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1Statement.html">Statement</a> Soprano::QueryResultIterator::currentStatement </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieve the current <a class="el" href="classSoprano_1_1Statement.html" title="A Statement instance represents one RDF quadruple.">Statement</a> after a call to next. This method does only make sense for graph queries. </p>

</div>
</div>
<a class="anchor" id="a43bf7e0f3db4d5fce76c82b801f62fa0"></a><!-- doxytag: member="Soprano::QueryResultIterator::currentBindings" ref="a43bf7e0f3db4d5fce76c82b801f62fa0" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1BindingSet.html">BindingSet</a> Soprano::QueryResultIterator::currentBindings </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that puts all current bindings into one map. This method does only make sense for tuple queries. </p>

</div>
</div>
<a class="anchor" id="a70996b0f1c492e712a7cfb2a2c3b4127"></a><!-- doxytag: member="Soprano::QueryResultIterator::boolValue" ref="a70996b0f1c492e712a7cfb2a2c3b4127" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Soprano::QueryResultIterator::boolValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This method does only make sense for boolean queries.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The result of a boolean query (SPARQL ASK).</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classSoprano_1_1QueryResultIterator.html#a9b3e90c00c2a77f20e199d7a1243394d">isBool()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aaa38f389eb05cd459af7c5adb0bc0913"></a><!-- doxytag: member="Soprano::QueryResultIterator::operator[]" ref="aaa38f389eb05cd459af7c5adb0bc0913" args="(int offset) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1Node.html">Node</a> Soprano::QueryResultIterator::operator[] </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>offset</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the current binding for a variable by index.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">offset</td><td>The index of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<p>This is equivalent to <a class="el" href="classSoprano_1_1QueryResultIterator.html#aa5ded24bcb7c099bc109f614f3a9d3e7">binding(int) const</a>.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The binding for the requested variable or and invalid node if offset is out of bounds, i.e. bigger or equal to <a class="el" href="classSoprano_1_1QueryResultIterator.html#a174b9537f99f5b8f77cf8a81072f086d">bindingCount()</a>.</dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>2.2 </dd></dl>

</div>
</div>
<a class="anchor" id="aed684887e97532e9eb248433113e64a3"></a><!-- doxytag: member="Soprano::QueryResultIterator::operator[]" ref="aed684887e97532e9eb248433113e64a3" args="(const QString name) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1Node.html">Node</a> Soprano::QueryResultIterator::operator[] </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a>&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the current binding for a variable.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The name of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<p>This is equivalent to <a class="el" href="classSoprano_1_1QueryResultIterator.html#a109b615a2f3f07d1924de368afc302bf">binding(const QString&amp;) const</a>.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The binding for the requested variable or and invalid node if the bindings do not contain the variable.</dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>2.2 </dd></dl>

</div>
</div>
<a class="anchor" id="a109b615a2f3f07d1924de368afc302bf"></a><!-- doxytag: member="Soprano::QueryResultIterator::binding" ref="a109b615a2f3f07d1924de368afc302bf" args="(const QString &amp;name) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1Node.html">Node</a> Soprano::QueryResultIterator::binding </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the current binding for a variable.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The name of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<p>This method does only make sense for tuple queries.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The binding for the requested variable or and invalid node if the bindings do not contain the variable. </dd></dl>

</div>
</div>
<a class="anchor" id="aa5ded24bcb7c099bc109f614f3a9d3e7"></a><!-- doxytag: member="Soprano::QueryResultIterator::binding" ref="aa5ded24bcb7c099bc109f614f3a9d3e7" args="(int offset) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1Node.html">Node</a> Soprano::QueryResultIterator::binding </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>offset</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get the current binding for a variable by index.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">offset</td><td>The index of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<p>This method does only make sense for tuple queries.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The binding for the requested variable or and invalid node if offset is out of bounds, i.e. bigger or equal to <a class="el" href="classSoprano_1_1QueryResultIterator.html#a174b9537f99f5b8f77cf8a81072f086d">bindingCount()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a174b9537f99f5b8f77cf8a81072f086d"></a><!-- doxytag: member="Soprano::QueryResultIterator::bindingCount" ref="a174b9537f99f5b8f77cf8a81072f086d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Soprano::QueryResultIterator::bindingCount </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The number of bindings in this query result.</p>
<p>This method does only make sense for tuple queries.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bindings. </dd></dl>

</div>
</div>
<a class="anchor" id="ace6fd8bd8f50a9c5f844e2375de8dd75"></a><!-- doxytag: member="Soprano::QueryResultIterator::bindingNames" ref="ace6fd8bd8f50a9c5f844e2375de8dd75" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" href="qstringlist.html">QStringList</a> Soprano::QueryResultIterator::bindingNames </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This method does only make sense for tuple queries.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The names of the bound variables in this query result. </dd></dl>

</div>
</div>
<a class="anchor" id="af2baa54907bb00c42914f300999b03fc"></a><!-- doxytag: member="Soprano::QueryResultIterator::isGraph" ref="af2baa54907bb00c42914f300999b03fc" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Soprano::QueryResultIterator::isGraph </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if this is a graph result.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if this result refers to a graph query, i.e. <a class="el" href="classSoprano_1_1QueryResultIterator.html#ae12d1b77dc81089975f584d1bac8bff5">currentStatement()</a> and <a class="el" href="classSoprano_1_1QueryResultIterator.html#a3641492adf6ade294fa2079291300ea2">iterateStatements()</a> return valid values. </dd></dl>

</div>
</div>
<a class="anchor" id="a525628dfafcc4b0d47d555c12699fe41"></a><!-- doxytag: member="Soprano::QueryResultIterator::isBinding" ref="a525628dfafcc4b0d47d555c12699fe41" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Soprano::QueryResultIterator::isBinding </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if this is a tuple result.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if this result refers to a tuple query, i.e. <a class="el" href="classSoprano_1_1QueryResultIterator.html#a43bf7e0f3db4d5fce76c82b801f62fa0">currentBindings()</a>, <a class="el" href="classSoprano_1_1QueryResultIterator.html#a109b615a2f3f07d1924de368afc302bf">binding()</a>, <a class="el" href="classSoprano_1_1QueryResultIterator.html#a174b9537f99f5b8f77cf8a81072f086d">bindingCount()</a>, <a class="el" href="classSoprano_1_1QueryResultIterator.html#ace6fd8bd8f50a9c5f844e2375de8dd75">bindingNames()</a>, and <a class="el" href="classSoprano_1_1QueryResultIterator.html#af8fdbfcf30b718aba94457f052c781d3">allBindings()</a> return valid values. </dd></dl>

</div>
</div>
<a class="anchor" id="a9b3e90c00c2a77f20e199d7a1243394d"></a><!-- doxytag: member="Soprano::QueryResultIterator::isBool" ref="a9b3e90c00c2a77f20e199d7a1243394d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Soprano::QueryResultIterator::isBool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if this is a boolean result.</p>
<p>There is no need to call <a class="el" href="classSoprano_1_1Iterator.html#a1ba632f6f015242ab9441da77d48415b">next()</a> for boolean results.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if this result refers to a boolean query (SPARQL ASK), i.e. <a class="el" href="classSoprano_1_1QueryResultIterator.html#a70996b0f1c492e712a7cfb2a2c3b4127">boolValue()</a> returns a valid value. </dd></dl>

</div>
</div>
<a class="anchor" id="af8fdbfcf30b718aba94457f052c781d3"></a><!-- doxytag: member="Soprano::QueryResultIterator::allBindings" ref="af8fdbfcf30b718aba94457f052c781d3" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" href="qlist.html">QList</a>&lt;<a class="el" href="classSoprano_1_1BindingSet.html">BindingSet</a>&gt; Soprano::QueryResultIterator::allBindings </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that collects all binding sets that are left in the iterator. </p>

</div>
</div>
<a class="anchor" id="a3641492adf6ade294fa2079291300ea2"></a><!-- doxytag: member="Soprano::QueryResultIterator::iterateStatements" ref="a3641492adf6ade294fa2079291300ea2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1StatementIterator.html">StatementIterator</a> Soprano::QueryResultIterator::iterateStatements </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that creates an iterator over the statements in this query result. This method does only make sense for graph queries.</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The new iterator is just a wrapper around this one. Thus, changing it will also change this one.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A wrapper iterator over the statements in a graph query. </dd></dl>

</div>
</div>
<a class="anchor" id="a8e79fda5bafa6ddda5dac731ed0fda2e"></a><!-- doxytag: member="Soprano::QueryResultIterator::iterateBindings" ref="a8e79fda5bafa6ddda5dac731ed0fda2e" args="(const QString &amp;variableName) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> Soprano::QueryResultIterator::iterateBindings </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>variableName</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that creates an iterator over one column of bindings in this query result. This method does only make sense for tuple queries.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">variableName</td><td>The name of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The new iterator is just a wrapper around this one. Thus, changing it will also change this one.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A wrapper iterator over one column in a tuple query or an invalid iterator if the result does not contain bindings for variableName. </dd></dl>

</div>
</div>
<a class="anchor" id="acb0f3495b8f9a151cb6c0aa6831bb1ae"></a><!-- doxytag: member="Soprano::QueryResultIterator::iterateBindings" ref="acb0f3495b8f9a151cb6c0aa6831bb1ae" args="(int offset) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> Soprano::QueryResultIterator::iterateBindings </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>offset</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that creates an iterator over one column of bindings in this query result. This method does only make sense for tuple queries.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">offset</td><td>The index of the requested variable.</td></tr>
  </table>
  </dd>
</dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The new iterator is just a wrapper around this one. Thus, changing it will also change this one.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A wrapper iterator over one column in a tuple query or an invalid iterator if offset is out of bounds, i.e. bigger or equal to <a class="el" href="classSoprano_1_1QueryResultIterator.html#a174b9537f99f5b8f77cf8a81072f086d">bindingCount()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a725667dad0ba3a87f35a5652d96c92d7"></a><!-- doxytag: member="Soprano::QueryResultIterator::iterateStatementsFromBindings" ref="a725667dad0ba3a87f35a5652d96c92d7" args="(const QString &amp;subjectBindingName, const QString &amp;predicateBindingName, const QString &amp;objectBindingName, const QString &amp;contextBindingName=QString(), const Statement &amp;templateStatement=Statement()) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1StatementIterator.html">StatementIterator</a> Soprano::QueryResultIterator::iterateStatementsFromBindings </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>subjectBindingName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>predicateBindingName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>objectBindingName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>contextBindingName</em> = <code><a class="elRef" href="qstring.html">QString</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classSoprano_1_1Statement.html">Statement</a> &amp;&#160;</td>
          <td class="paramname"><em>templateStatement</em> = <code><a class="el" href="classSoprano_1_1Statement.html">Statement</a>()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method that creates an iterator over statements constructed from the values of the provided bindings.</p>
<p>The typical usage would be with a query as follows:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classSoprano_1_1StatementIterator.html" title="An iterator that provides a stream of Statements.">Soprano::StatementIterator</a> it =
     model-&gt;<a class="code" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">executeQuery</a>( <span class="stringliteral">&quot;select * where { graph ?c { ?s ?p ?o . } }&quot;</span> )
     .iterateStatementsFromBindings( <span class="stringliteral">&quot;s&quot;</span>, <span class="stringliteral">&quot;p&quot;</span>, <span class="stringliteral">&quot;o&quot;</span>, <span class="stringliteral">&quot;c&quot;</span> );
</pre></div><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">subjectBindingName</td><td>The name of the binding that will be used to set the subject of the constructed statements. </td></tr>
    <tr><td class="paramname">predicateBindingName</td><td>The name of the binding that will be used to set the predicate of the constructed statements. </td></tr>
    <tr><td class="paramname">objectBindingName</td><td>The name of the binding that will be used to set the object of the constructed statements. </td></tr>
    <tr><td class="paramname">contextBindingName</td><td>The name of the binding that will be used to set the context of the constructed statements. </td></tr>
    <tr><td class="paramname">templateStatement</td><td>If any of the provided binding names is empty the corresponding nodes in the resulting statements will be filled by templateStatement.</td></tr>
  </table>
  </dd>
</dl>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The new iterator is just a wrapper around this one. Thus, changing it will also change this one.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A wrapper iterator over statements constructed from the specified bindings.</dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>2.2 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/builddir/build/BUILD/soprano-2.6.0/soprano/<a class="el" href="queryresultiterator_8h_source.html">queryresultiterator.h</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Mar 11 2011 for Soprano by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>