Soprano  2.8.0
Public Member Functions | Related Functions | List of all members
Soprano::Backend Class Reference

Soprano::Backend defines the interface for a Soprano backend plugin. More...

#include <Soprano/Backend>

+ Inheritance diagram for Soprano::Backend:

Public Member Functions

 Backend (const QString &name)
virtual ~Backend ()
virtual StorageModelcreateModel (const BackendSettings &settings=BackendSettings()) const =0
virtual bool deleteModelData (const BackendSettings &settings) const =0
virtual BackendFeatures supportedFeatures () const =0
virtual QStringList supportedUserFeatures () const
bool supportsFeatures (BackendFeatures feature, const QStringList &userFeatures=QStringList()) const
- Public Member Functions inherited from Soprano::Plugin
virtual ~Plugin ()
QString pluginName () const
virtual bool isAvailable () const
- Public Member Functions inherited from Soprano::Error::ErrorCache
virtual ~ErrorCache ()
virtual Error lastError () const

Related Functions

(Note that these are not member functions.)

SOPRANO_EXPORT ModelcreateModel (const BackendSettings &settings=BackendSettings())

Additional Inherited Members

- Protected Member Functions inherited from Soprano::Plugin
 Plugin (const QString &name)
- Protected Member Functions inherited from Soprano::Error::ErrorCache
 ErrorCache ()
void clearError () const
void setError (const Error &) const
void setError (const QString &errorMessage, int code=ErrorUnknown) const

Detailed Description

Soprano::Backend defines the interface for a Soprano backend plugin.

The Backend interface defines two important methods: createModel() and supportedFeatures(). It inherits from Error::ErrorCache for error handling and subclasses should use clearError() and setError() to report the status.

See Also
Writing Soprano Plugins
Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 263 of file backend.h.

Constructor & Destructor Documentation

Soprano::Backend::Backend ( const QString name)
virtual Soprano::Backend::~Backend ( )
virtual

Member Function Documentation

virtual StorageModel* Soprano::Backend::createModel ( const BackendSettings settings = BackendSettings()) const
pure virtual

Creates a new RDF model with options. The caller takes ownership and has to care about deletion.

Parameters
settingsThe 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. Invalid settings should result in an Error with value Error::ErrorInvalidArgument.
See Also
BackendSetting
virtual bool Soprano::Backend::deleteModelData ( const BackendSettings settings) const
pure virtual

Phyically delete all data for a specific model. For most backends this means deleting some files on the hard disk. With others it may mean to delete tables from an SQL database.

Parameters
settingsThe settings that were used to create the model which should be deleted. For most backends the Soprano::BackendOptionStorageDir setting is probably most important. If the settings do not provide enough information to uniquely identify the model to delete, the method should be terminated with an Error::ErrorInvalidArgument error.
Returns
true if the data was successfully removed, false otherwise. ErrorCache::lastError() may provide more detailed error information in the latter case.
Since
2.1
virtual BackendFeatures Soprano::Backend::supportedFeatures ( ) const
pure virtual

Each backend can support a set of features. Backends without any features do not make much sense. If the features include Soprano::BackendFeatureUser additional user features not defined in Backend::BackendFeature can be supported via supportedUserFeatures().

Returns
A combination of Soprano::BackendFeature values.
virtual QStringList Soprano::Backend::supportedUserFeatures ( ) const
virtual

A Backend can support additional features that are not defined in Backend::BackendFeature. These user defined features have string identifiers. If a backend supports additional features it has to include Soprano::BackendFeatureUser in supportedFeatures().

The default implementation returns an empty list.

Returns
the list of supported user features.
bool Soprano::Backend::supportsFeatures ( BackendFeatures  feature,
const QStringList userFeatures = QStringList() 
) const

Check if a backend supports certain features. If feature includes Soprano::BackendFeatureUser the list if userFeatures is also compared.

Returns
true if the backend does support the requested features, false otherwise.

Friends And Related Function Documentation

SOPRANO_EXPORT Model * createModel ( const BackendSettings settings = BackendSettings())
related

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

Parameters
settingsThe 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, BackendSetting

The documentation for this class was generated from the following files: