KDE 4.3 PyKDE API Reference

- KDE's Python API

# soprano Module

*

## Soprano (aka QRDF) - A modular RDF storage framework

* * %Soprano is a Qt-based pluggable framework for RDF * storage and parsing. It tries to provide a highly usable interface to several RDF storage solutions. * * Overview * * %Soprano centers around the Soprano.Model class which represents one storage set. A Soprano.Model is basically a set of * RDF quadruples, i.e. Soprano.Statement. The actual storage is done via Soprano.Backend plugins. All * query operations return Soprano.Iterator instances. Iterator is a explicitely shared class which is very * easy to understand and use. * * %Soprano makes the distinction between two types of Models: Soprano.StorageModel and Soprano.FilterModel. * The former one is intended to be the basic Model which actually stores the data while the latter ones can be * stacked on top of a Soprano.StorageModel to perform certain filter operations. Thes filter operations can range * from very basic things such as disallowing any write operation (Soprano.Util.ReadOnlyModel) to more complex * things such as full text indexing of all literal statements (Soprano.Index.IndexFilterModel) or exporting * the Model via D-Bus (Soprano.Server.DBusExportModel). * * Apart from storage %Soprano provides a system for RDF parser and serializer plugins. For more details on parsing * or serializing RDF data see the Soprano.Parser and Soprano.Serializer classes. * * %Soprano comes with a builtin Soprano.Server Server and Soprano.Client Client implementations allowing to build remote repositories quickly. * Soprano.Client.SparqlModel provides a client to arbitrary SPARQL (SPARQL Protocol and RDF Query Language) * Http services. * * Quickstart * * (Also see the soprano_howto for details on building %Soprano applications) * * Create an RDF Model: * *

##

##

     * Soprano.Model* model = Soprano.createModel();
     * \endcode
     *
     * Fill it with statements:
     *
     * \code
     * model->addStatement( Soprano.Statement( QUrl( "http://mysite.org/data#A"), Soprano.Vocabulary.RDFS.label(), Soprano.LiteralValue( "A test resource" ) ) );
     * \endcode
     *
     * Read the data back:
     *
     * \code
     * Soprano.StatementIterator it = model->listStatements();
     * while( it.next() ) {
     *    displayStatement( *it );
     * }
     * \endcode
     *
     * Query the data:
     *
     * \code
     * Soprano.QueryResultIterator it = model->executeQuery( "select ?r where { ?r ?p ?o . }", Soprano.Query.QueryLanguageSparql );
     * while( it.next() ) {
     *    displayResult( it.binding( "r" ) );
     * }
     * \endcode
     *
     * \section contents Contents
     *
     * The following sections contain further information on the usage of %Soprano.
     *
     * \li \subpage soprano_howto - Learn how to integrate %Soprano into your build system
     * \li \subpage soprano_storage - Learn how to use RDF storage in %Soprano
     * \li \subpage soprano_misc - Learn how to parse and serialize RDF data in %Soprano
     * \li \subpage soprano_error_handling - Learn how %Soprano's error system works
     * \li \subpage soprano_writing_plugins - Learn how to write your own %Soprano plugins
     * \li \ref Soprano.Server - Learn how to create a %Soprano server
     * \li \ref Soprano.Client - Learn how to create a %Soprano client accessing a %Soprano server via DBus or a local socket
     * \li \subpage soprano_devel_tools - Learn about the nice command line tools %Soprano provides
     * \li \ref soprano_backends - Learn about the available storage backends and their features and settings
    Namespaces

      G  Soprano.Query   Soprano::Vocabulary.RDF
    global   Soprano.Server   Soprano::Vocabulary.RDFS
      S  Soprano.Util   Soprano::Vocabulary.SIL
    Soprano   Soprano.Vocabulary   Soprano::Vocabulary.Xesam
    Soprano.Client   Soprano::Vocabulary.NAO   Soprano::Vocabulary.XMLSchema
    Soprano.Error   Soprano::Vocabulary.NRL
    Soprano.Inference   Soprano::Vocabulary.OWL

    Class Index

      A  ErrorCache (Soprano.Error)   Plugin (Soprano)
    AsyncModel (Soprano.Util)     F  PluginManager (Soprano)
    AsyncResult (Soprano.Util)   FilterModel (Soprano)     Q
      B    G  QueryResultIterator (Soprano)
    Backend (Soprano)   Graph (Soprano)   QueryResultIterator (Soprano)
    BackendSetting (Soprano)     I    R
    BindingSet (Soprano)   InferenceModel (Soprano.Inference)   RdfSchemaModel (Soprano)
      D  IteratorBackend (Soprano)   ReadOnlyModel (Soprano.Util)
    DBusClient (Soprano.Client)     L  Rule (Soprano.Inference)
    DBusClient (Soprano.Client)   LanguageTag (Soprano)   RuleParser (Soprano.Inference)
    DBusExportIterator (Soprano.Server)   LiteralValue (Soprano)   RuleSet (Soprano.Inference)
    DBusExportIterator (Soprano.Server)   LocalSocketClient (Soprano.Client)     S
    DBusExportModel (Soprano.Server)   Locator (Soprano.Error)   Serializer (Soprano)
    DBusExportModel (Soprano.Server)     M  ServerCore (Soprano.Server)
    DBusModel (Soprano.Client)   Model (Soprano)   SignalCacheModel (Soprano.Util)
    DBusModel (Soprano.Client)   MutexModel (Soprano.Util)   SimpleNodeIterator (Soprano.Util)
    DBusNodeIterator (Soprano.Client)     N  SimpleStatementIterator (Soprano.Util)
    DBusNodeIterator (Soprano.Client)   Node (Soprano)   SparqlModel (Soprano.Client)
    DBusQueryResultIterator (Soprano.Client)   NodeIterator (Soprano)   Statement (Soprano)
    DBusQueryResultIterator (Soprano.Client)   NodeIterator (Soprano)   StatementIterator (Soprano)
    DBusStatementIterator (Soprano.Client)   NodePattern (Soprano.Inference)   StatementIterator (Soprano)
    DBusStatementIterator (Soprano.Client)   NRLModel (Soprano)   StatementPattern (Soprano.Inference)
    DummyModel (Soprano.Util)     P  StorageModel (Soprano)
      E  Parser (Soprano)     T
    Error (Soprano.Error)   ParserError (Soprano.Error)   TcpClient (Soprano.Client)