<!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 (aka QRDF) - A modular RDF storage framework</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.1 --> <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 class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <h1><a class="el" href="namespaceSoprano.html">Soprano</a> (aka QRDF) - A modular RDF storage framework </h1> </div> </div> <div class="contents"> <h3 class="version">2.5.2 </h3><p>Soprano is a <a href="http://www.qtsoftware.com/">Qt</a>-based pluggable framework for <a href="http://www.w3.org/RDF/">RDF</a> storage and parsing. It tries to provide a highly usable interface to several Resource Description Framework (RDF) storage solutions.</p> <h2><a class="anchor" id="overview"></a> Overview</h2> <p>Soprano centers around 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.">Soprano::Model</a> class which represents one storage set. A <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.">Soprano::Model</a> is basically a set of RDF quadruples, i.e. <a class="el" href="classSoprano_1_1Statement.html" title="A Statement instance represents one RDF quadruple.">Soprano::Statement</a>. The actual storage is done via <a class="el" href="classSoprano_1_1Backend.html" title="Soprano::Backend defines the interface for a Soprano backend plugin.">Soprano::Backend</a> plugins. All query operations return <a class="el" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class.">Soprano::Iterator</a> instances. Iterator is an explicitly shared class which is very easy to understand and use.</p> <p>Soprano makes the distinction between two types of Models: <a class="el" href="classSoprano_1_1StorageModel.html" title="Base class for all Model implementations that store data (as compared to FilterModel).">Soprano::StorageModel</a> and <a class="el" href="classSoprano_1_1FilterModel.html" title="A FilterModel is a virtual model that wraps another Model.">Soprano::FilterModel</a>. The former is intended to be the basic Model which actually stores the data while the latter can be stacked on top of a <a class="el" href="classSoprano_1_1StorageModel.html" title="Base class for all Model implementations that store data (as compared to FilterModel).">Soprano::StorageModel</a> to perform certain filter operations. These filter operations can range from very basic things such as disallowing any write operation (<a class="el" href="classSoprano_1_1Util_1_1ReadOnlyModel.html" title="Simple filter model preventing any write operations.">Soprano::Util::ReadOnlyModel</a>) to more complex things such as full text indexing of all literal statements (<a class="el" href="classSoprano_1_1Index_1_1IndexFilterModel.html" title="The IndexFilterModel provides a full text index around any Soprano Model.">Soprano::Index::IndexFilterModel</a>) or exporting the Model via D-Bus (<a class="el" href="classSoprano_1_1Server_1_1DBusExportModel.html" title="Exports a Soprano Model via D-Bus.">Soprano::Server::DBusExportModel</a>).</p> <p>Apart from storage Soprano provides a system for RDF parser and serializer plugins. For more details on parsing or serializing RDF data see the <a class="el" href="classSoprano_1_1Parser.html" title="Soprano::Parser defines the interface for a Soprano RDF parser plugin.">Soprano::Parser</a> and <a class="el" href="classSoprano_1_1Serializer.html" title="Soprano::Serializer defines the interface for a Soprano RDF serializer plugin.">Soprano::Serializer</a> classes.</p> <p>Soprano comes with a built in <a class="el" href="namespaceSoprano_1_1Server.html">Server </a> and <a class="el" href="namespaceSoprano_1_1Client.html">Client </a> implementations allowing remote repositories to be built quickly. <a class="el" href="classSoprano_1_1Client_1_1SparqlModel.html" title="Remote client Model for Http SPARQL end points.">Soprano::Client::SparqlModel</a> provides a client to arbitrary <a href="http://www.w3.org/TR/rdf-sparql-protocol/">SPARQL (SPARQL Protocol and RDF Query Language)</a> Http services.</p> <h2><a class="anchor" id="quickstart"></a> Quickstart</h2> <p>(Also see the <a class="el" href="soprano_howto.html">Soprano Howto</a> for details on building Soprano applications)</p> <p>Create an RDF Model:</p> <div class="fragment"><pre class="fragment"> <a class="code" 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.">Soprano::Model</a>* model = <a class="code" href="namespaceSoprano.html#a66f765cf9fd9aae07f874fdb8867dd1c">Soprano::createModel</a>(); </pre></div><p>Fill it with statements:</p> <div class="fragment"><pre class="fragment"> model-><a class="code" href="classSoprano_1_1Model.html#aed5b923235288fbac997850cca8f6053">addStatement</a>( <a class="code" href="classSoprano_1_1Statement.html" title="A Statement instance represents one RDF quadruple.">Soprano::Statement</a>( <a class="codeRef" href="qurl.html">QUrl</a>( <span class="stringliteral">"http://mysite.org/data#A"</span>), <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDFS.html#af4ad9f5ac62961046e7d8be3906a8010">Soprano::Vocabulary::RDFS::label</a>(), <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">Soprano::LiteralValue</a>( <span class="stringliteral">"A test resource"</span> ) ) ); </pre></div><p>Read the data back:</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-><a class="code" href="classSoprano_1_1Model.html#a7f50dc6483e0bed7830877182c7906ac">listStatements</a>(); <span class="keywordflow">while</span>( it.<a class="code" href="classSoprano_1_1Iterator.html#a1ba632f6f015242ab9441da77d48415b">next</a>() ) { displayStatement( *it ); } </pre></div><p>Query the data:</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-><a class="code" href="classSoprano_1_1Model.html#a5157ca3996dea1e7a46947d41e530c51">executeQuery</a>( <span class="stringliteral">"select ?r where { ?r ?p ?o . }"</span>, <a class="code" href="namespaceSoprano_1_1Query.html#ab568869993a9d6c452c8e5a34d5ac26ca619ecf57d183bffe04ebf81089031334">Soprano::Query::QueryLanguageSparql</a> ); <span class="keywordflow">while</span>( it.<a class="code" href="classSoprano_1_1Iterator.html#a1ba632f6f015242ab9441da77d48415b">next</a>() ) { displayResult( it.<a class="code" href="classSoprano_1_1QueryResultIterator.html#a109b615a2f3f07d1924de368afc302bf">binding</a>( <span class="stringliteral">"r"</span> ) ); } </pre></div><h2><a class="anchor" id="contents"></a> Contents</h2> <p>The following sections contain further information on the usage of Soprano.</p> <ul> <li><a class="el" href="soprano_howto.html">Soprano Howto</a> - Learn how to integrate Soprano into your build system </li> <li><a class="el" href="soprano_storage.html">RDF Storage</a> - Learn how to use RDF storage in Soprano </li> <li><a class="el" href="soprano_misc.html">RDF Parsing and Serialization</a> - Learn how to parse and serialize RDF data in Soprano </li> <li><a class="el" href="soprano_error_handling.html">Error handling in Soprano</a> - Learn how Soprano's error system works </li> <li><a class="el" href="soprano_writing_plugins.html">Writing Soprano Plugins</a> - Learn how to write your own Soprano plugins </li> <li><a class="el" href="namespaceSoprano_1_1Server.html">Soprano::Server</a> - Learn how to create a Soprano server </li> <li><a class="el" href="namespaceSoprano_1_1Client.html">Soprano::Client</a> - Learn how to create a Soprano client accessing a Soprano server via DBus or a local socket </li> <li><a class="el" href="soprano_devel_tools.html">Soprano Development Tools</a> - Learn about the nice command line tools Soprano provides </li> <li><a class="el" href="soprano_backends.html">Soprano Backends</a> - Learn about the available storage backends and their features and settings </li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Oct 21 2010 for Soprano by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>