2
* \page soprano_server Soprano Server
4
* %Soprano provides simple server and client librarys which allow for remote access to %Soprano models.
6
* \sa \ref soprano_server_protocol, Soprano::Server, Soprano::Client
10
* \page soprano_server_protocol Soprano Server Protocol
12
* \warning The protocol described on this page is used internally by the Soprano TCP and Unix socket server and client.
13
* Normally there is no need to deal with it except if you want to write a client or server in another
14
* programming language.
16
* The server protocol is quite simple and is based on a set of commands and binary serializations for
17
* data types. It has been optimized for speed and nothing else so it always tries to comunicate as
18
* little data as possible.
20
* \section soprano_server_protocol_commands Commands
22
* Commands are identified by unsigned 16bit integer values (native bit order). Issuing a command
23
* is done by sending the command number followed by the command parameters.
25
* The following table lists the available commands.
28
* <tr><th>Command</th><th>Code</th><th>Parameters</th><th>Return values</th><th>Description</th></tr>
29
* <tr><td>Create model</td><td>0x1</td><td>name (string), settings (List of #Soprano::BackendSetting)</td><td>model ID (unsigned 32bit int)</td><td>Retrieve the ID for a model (if the model does not yet exist, it is craeted.</td></tr>
30
* <tr><td>FIXME...</td></tr>
33
* \section soprano_server_protocol_types Types
35
* The default implementation of the protocol uses QDataStream. Thus, all basic types are encoded as QDataStream does it.
37
* \subsection soprano_server_protocol_types_node Soprano::Node
39
* A %Soprano node starts with the node type encoded as unsigned 8bit. For the possible values see Soprano::Node::Type.
40
* If it is a literal node (Soprano::Node::LiteralNode) after the type follow the literal value (Soprano::LiteralValue)
41
* and the language (string). If it is a resource (Soprano::Node::ResourceNode) or blank node (Soprano::Node::BlankNode)
42
* after the type follows the URI of the node (URI). If it is an empty node, nothing follows the type.
44
* \subsection soprano_server_protocol_types_statement Soprano::Statement
46
* A %Soprano statement is encoded simply by encoding the subject, predicate, object, and context node in that order.
48
* \subsection soprano_server_protocol_types_literalvalue Soprano::LiteralValue
50
* A %Soprano literal value is encoded as a QVariant: The type of the data (unsigned 32bit) followed
51
* by a null flag (8bit) and the data of the specified type.
53
* \subsection soprano_server_protocol_types_bindingset Soprano::BindingSet
59
* \namespace Soprano::Server
61
* \sa \ref soprano_server, Soprano::Client
65
* \namespace Soprano::Client
67
* The server clients have the following restrictions:
70
* \li No signals are emitted (Model::statementsAdded() and Model::statementsRemoved())
71
* \li No permission handling, i.e. each process running on the machine can access a running %Soprano server,
72
* indifferent of the user id of the server process.
73
* <!--\li Queries are always transmitted as strings and thus, might be serialized on the client side and parsed
74
* again on the server side when using Model::executeQuery( const Query& ) const.-->
76
* <b>Unix Socket %Client:</b>
77
* \li No signals are emitted (Model::statementsAdded() and Model::statementsRemoved())
78
* <!--\li Queries are always transmitted as strings and thus, might be serialized on the client side and parsed
79
* again on the server side when using Model::executeQuery( const Query& ) const.-->
81
* <b>DBus %Client:</b>
83
* <!--\li Queries are always transmitted as strings and thus, might be serialized on the client side and parsed
84
* again on the server side when using Model::executeQuery( const Query& ) const.-->
86
* While the TCP comunication is the fastest due to its missing permission handling it is not recommended to use
87
* it yet. The best solution at the moment is the DBus client. Although being the slowest (slightly slower than
88
* the Unix Socket client) it is reliable and feature-complete (signals are transmitted).
90
* \sa \ref soprano_server, Soprano::Server