The server protocol is quite simple and is based on a set of commands and binary serializations for data types. It has been optimized for speed and nothing else so it always tries to comunicate as little data as possible.
Commands are identified by unsigned 16bit integer values (native bit order). Issuing a command is done by sending the command number followed by the command parameters.
The following table lists the available commands.
|Create model||0x1||name (string), settings (List of Soprano::BackendSetting)||model ID (unsigned 32bit int)||Retrieve the ID for a model (if the model does not yet exist, it is craeted.|
A Soprano node starts with the node type encoded as unsigned 8bit. For the possible values see Soprano::Node::Type. If it is a literal node (Soprano::Node::LiteralNode) after the type follow the literal value (Soprano::LiteralValue) and the language (string). If it is a resource (Soprano::Node::ResourceNode) or blank node (Soprano::Node::BlankNode) after the type follows the URI of the node (URI). If it is an empty node, nothing follows the type.
A Soprano statement is encoded simply by encoding the subject, predicate, object, and context node in that order.
A Soprano literal value is encoded as a QVariant: The type of the data (unsigned 32bit) followed by a null flag (8bit) and the data of the specified type.