# Namespace Soprano

Module | soprano
Namespace | Soprano

### classes

Soprano.Backend | Soprano.Model | Soprano.QueryResultIterator
Soprano.BackendSetting | Soprano.Node | Soprano.QueryResultIteratorBackend
Soprano.BindingSet | Soprano.NodeIterator | Soprano.RdfSchemaModel
Soprano.FilterModel | Soprano.Parser | Soprano.Serializer
Soprano.IteratorBackend | Soprano.Plugin | Soprano.Statement
Soprano.LiteralValue | Soprano.PluginManager | Soprano.StatementIterator

### enums

- BackendFeature { BackendFeatureNone, BackendFeatureAddStatement, BackendFeatureRemoveStatements, BackendFeatureListStatements, BackendFeatureQuery, BackendFeatureInference, BackendFeatureInferenceOptional, BackendFeatureContext, BackendFeatureStorageMemory, BackendFeatureUser }
- BackendOption { BackendOptionNone, BackendOptionStorageMemory, BackendOptionEnableInference, BackendOptionStorageDir, BackendOptionUser }
- RdfSerialization { SerializationUnknown, SerializationRdfXml, SerializationN3, SerializationNTriples, SerializationTurtle, SerializationTrig, SerializationNQuads, SerializationUser }

enum details

### methods

- createModel (settings)

  returns Soprano.Model

  Argument | Type | Default
  --- | --- | ---
  settings | QList<Soprano::BackendSetting> | QList<Soprano.BackendSetting>()

  Creates a new RDF storage using the backend set via setUsedBackend. The caller takes ownership and has to care about deletion.

  settings - The settings that should be used to create the Model. Backend implementations should never ignore settings but rather return 0 if an option is not supported. Backends can, however, define their own default settings.

  See also Model, Backend.createModel

- discoverBackendByFeatures (features, userFeatures)

  returns Soprano.Backend

  Argument | Type | Default
  --- | --- | ---
  features | Soprano.BackendFeatures |
  userFeatures | QStringList | QStringList()

  Find a backend plugin by its features.

  features - The features that are requested.

  userFeatures - If features contain Soprano.BackendFeatureUser this paramter states the additionally requested user features.

  Returns a backend that supports the features defined in features.

  See also PluginManager.discoverBackendByFeatures()

- discoverBackendByName (name)

  returns Soprano.Backend

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Find a backend plugin by its name.

  Returns the backend specified by name or null if could not be found.

- mimeTypeToSerialization (mimetype)

  returns Soprano.RdfSerialization

  Argument | Type | Default
  --- | --- | ---
  mimetype | QString |

  Parse a mimetype and match it to the Soprano.RdfSerialization enum. Returns the Soprano.RdfSerialization type that matches mimetype or SerializationUnknown if the mimetype could not be parsed. Be aware that Soprano is very lax in parsing the mimetype, i.e. you can use simple strings like 'trig' or 'n-quads' instead of the proper mimetype for convenience.

- serializationMimeType (serialization, userSerialization)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  serialization | Soprano.RdfSerialization |
  userSerialization | QString | QString()

  Get the mimetype string of a serialization.

  serialization - The serialization the mimetype is wanted for.

  userSerialization - If serialization is SerializationUser then this is the user defined serialization. (this parameter is added for convinience to avoid having an additional check before using this method.)

  Returns The mimetype of serialization, an empty string is serialization is SerializationUnknown, or userSerialization if serialization is SerializationUser.

- setUsedBackend (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | Soprano.Backend |

  By default and if available backend "redland" is used.

- usedBackend ( )

  returns Soprano.Backend

### enums - detail

- BackendFeature { BackendFeatureNone, BackendFeatureAddStatement, BackendFeatureRemoveStatements, BackendFeatureListStatements, BackendFeatureQuery, BackendFeatureInference, BackendFeatureInferenceOptional, BackendFeatureContext, BackendFeatureStorageMemory, BackendFeatureUser }

  Each Backend plugin can support different features. %Soprano defines a list of well-known features that each backend implementation should try to realize. In addition user features can be defined. For this BackendFeatureUser has to be included in the supported features. Then additional features may be reported through Backend.supportedUserFeatures().

  See also Backend.supportedFeatures(), Backend.supportedUserFeatures()

  | BackendFeatureNone | - 0x0 | - |
  | BackendFeatureAddStatement | - 0x1 | - |
  | BackendFeatureRemoveStatements | - 0x2 | - |
  | BackendFeatureListStatements | - 0x4 | - |
  | BackendFeatureQuery | - 0x8 | - |
  | BackendFeatureInference | - 0x10 | - |
  | BackendFeatureInferenceOptional | - 0x20 | - |
  | BackendFeatureContext | - 0x40 | - |
  | BackendFeatureStorageMemory | - 0x80 | - |
  | BackendFeatureUser | - 0x1000 | - |

- BackendOption { BackendOptionNone, BackendOptionStorageMemory, BackendOptionEnableInference, BackendOptionStorageDir, BackendOptionUser }

  There are two types of backend settings: boolean flags and key/value pairs. The boolean flags are identified by BackendFlag.

  See also BackendSetting, Backend.createModel()

  | BackendOptionNone | - 0x0 | - |
  | BackendOptionStorageMemory | - 0x1 | - |
  | BackendOptionEnableInference | - 0x2 | - |
  | BackendOptionStorageDir | - 0x4 | - |
  | BackendOptionUser | - 0x1000 | - |

- RdfSerialization { SerializationUnknown, SerializationRdfXml, SerializationN3, SerializationNTriples, SerializationTurtle, SerializationTrig, SerializationNQuads, SerializationUser }

  Different types of RDF serialization.

  | SerializationUnknown | - 0x0 | - | The serialization is unknown.
  | SerializationRdfXml | - 0x1 | - | Standard RDF XML serialization
  | SerializationN3 | - 0x2 | - | Notation 3: http: www.w3.org DesignIssues Notation3
  | SerializationNTriples | - 0x4 | - | N-Triples as defined by W3: http: www.w3.org TR rdf-testcases #ntriples
  | SerializationTurtle | - 0x8 | - | Turtle - Terse RDF Triple Language: http: www.dajobe.org 2004 01 turtle
  | SerializationTrig | - 0x10 | - | TriG - Turtle + Named Graphs: http: sites.wiwiss.fu-berlin.de suhl bizer TriG
  | SerializationNQuads | - 0x20 | - | N-Quads extends over N-Triples in that it adds an optional context node.
  | SerializationUser | - 0x0 | - | The user type can be used to introduce unknown RDF serializations by name