Nepomuk
Nepomuk::ResourceManager Class Reference
The ResourceManager is the central KMetaData configuration point. More...
#include <Nepomuk/ResourceManager>

Signals | |
void | error (const QString &uri, int errorCode) |
void | resourceModified (const QString &uri) |
Public Member Functions | |
KDE_DEPRECATED QList< Resource > | allResourcesOfType (const QString &type) |
QList< Resource > | allResourcesOfType (const QUrl &type) |
KDE_DEPRECATED QList< Resource > | allResourcesWithProperty (const QString &uri, const Variant &v) |
QList< Resource > | allResourcesWithProperty (const QUrl &uri, const Variant &v) |
KDE_DEPRECATED Resource | createResourceFromUri (const QString &uri) |
QUrl | generateUniqueUri (const QString &label) |
KDE_DEPRECATED QString | generateUniqueUri () |
int | init () |
bool | initialized () const |
Soprano::Model * | mainModel () |
void | notifyError (const QString &uri, int errorCode) |
void | removeResource (const QString &uri) |
void | setOverrideMainModel (Soprano::Model *model) |
Static Public Member Functions | |
static ResourceManager * | instance () |
Detailed Description
The ResourceManager is the central KMetaData configuration point.
Definition at line 50 of file resourcemanager.h.
Member Function Documentation
Retrieve a list of all resources of the specified type.
This includes Resources that are not synced yet so it might not represent exactly the state as in the RDF store.
KDE_DEPRECATED QList<Resource> Nepomuk::ResourceManager::allResourcesWithProperty | ( | const QString & | uri, | |
const Variant & | v | |||
) |
- Deprecated:
- Use allResourcesWithProperty( const QString& type )
QList<Resource> Nepomuk::ResourceManager::allResourcesWithProperty | ( | const QUrl & | uri, | |
const Variant & | v | |||
) |
Retrieve a list of all resources that have property uri defined with a value of v.
This includes Resources that are not synced yet so it might not represent exactly the state as in the RDF store.
- Parameters:
-
uri The URI identifying the property. If this URI does not include a namespace the default namespace is prepended. v The value all returned resources should have set as properts uri.
- Deprecated:
- Use the Resource constructor directly.
void Nepomuk::ResourceManager::error | ( | const QString & | uri, | |
int | errorCode | |||
) | [signal] |
Whenever a problem occurs (like for example failed resource syncing) this signal is emitted.
- Parameters:
-
uri The resource related to the error. errorCode The type of the error (Resource::ErrorCode)
Generates a unique URI that is not used in the store yet.
This method ca be used to generate URIs for virtual types such as Tag.
- Parameters:
-
label A label that the algorithm should use to try to create a more readable URI.
- Returns:
- A new unique URI which can be used to define a new resource.
- Since:
- 4.2
KDE_DEPRECATED QString Nepomuk::ResourceManager::generateUniqueUri | ( | ) |
Generates a unique URI that is not used in the store yet. This method ca be used to generate URIs for virtual types such as Tag.
int Nepomuk::ResourceManager::init | ( | ) |
Initialize the Nepomuk framework.
This method will initialize the communication with the local Nepomuk-KDE services, ie. the data repository.
When using multiple threads make sure to call this method in the main thread before doing anything else.
- Returns:
- 0 if all necessary components could be found and -1 otherwise.
bool Nepomuk::ResourceManager::initialized | ( | ) | const |
- Returns:
- true if init() has been called successfully, ie. the KMetaData system is connected to the local RDF repository service and ready to work.
static ResourceManager* Nepomuk::ResourceManager::instance | ( | ) | [static] |
Soprano::Model* Nepomuk::ResourceManager::mainModel | ( | ) |
Retrieve the main data storage model.
void Nepomuk::ResourceManager::notifyError | ( | const QString & | uri, | |
int | errorCode | |||
) |
void Nepomuk::ResourceManager::removeResource | ( | const QString & | uri | ) |
Remove the resource denoted by uri completely.
This method is just a wrapper around Resource::remove. The result is the same.
void Nepomuk::ResourceManager::resourceModified | ( | const QString & | uri | ) | [signal] |
This signal gets emitted whenever a Resource changes due to a sync procedure.
Be aware that modifying resources locally via the Resource::setProperty method does not result in a resourceModified signal being emitted.
- Parameters:
-
uri The URI of the modified resource.
void Nepomuk::ResourceManager::setOverrideMainModel | ( | Soprano::Model * | model | ) |
The documentation for this class was generated from the following file: