# class ResourceManager

###

Module | nepomuk
Namespace | Nepomuk
Class | ResourceManager
Inherits | QObject

\class ResourceManager resourcemanager.h Nepomuk/ResourceManager

The ResourceManager is the central %KMetaData configuration point.

Author Sebastian Trueg <trueg@kde.org>

### methods

- ResourceManager ( )

  returns ctor
  Not implemented

- ResourceManager ( )

  returns dtor
  Not implemented

- allResourcesOfType (type)

  returns QList<Nepomuk::Resource>

  Argument | Type | Default
  --- | --- | ---
  type | QUrl |

  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.

- allResourcesOfType (type)

  returns QList<Nepomuk::Resource>

  Argument | Type | Default
  --- | --- | ---
  type | QString |

  Deprecated Use allResourcesOfType( const QString& type )

- allResourcesWithProperty (uri, v)

  returns QList<Nepomuk::Resource>

  Argument | Type | Default
  --- | --- | ---
  uri | QUrl |
  v | Nepomuk.Variant |

  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.

  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.

- allResourcesWithProperty (uri, v)

  returns QList<Nepomuk::Resource>

  Argument | Type | Default
  --- | --- | ---
  uri | QString |
  v | Nepomuk.Variant |

  Deprecated Use allResourcesWithProperty( const QString& type )

- createResourceFromUri (uri)

  returns Nepomuk.Resource

  Argument | Type | Default
  --- | --- | ---
  uri | QString |

  Deprecated Use the Resource constructor directly.

  Creates a Resource object representing the data referenced by uri. The result is the same as from using the Resource.Resource( const QString&, const QString& ) constructor with an empty type.

  Returns The Resource representing the data at uri or an invalid Resource object if the local NEPOMUK RDF store does not contain an object with URI uri.

- error (uri, errorCode)

  returns Nothing
  SIGNAL ("error (const QString&, int)")

  Argument | Type | Default
  --- | --- | ---
  uri | QString |
  errorCode | int |

  Whenever a problem occurs (like for example failed resource syncing) this signal is emitted.

  uri - The resource related to the error.

  errorCode - The type of the error (Resource.ErrorCode)

- generateUniqueUri ( )

  returns QString

  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.

- init ( )

  returns int

  Initialize the KMetaData framework. This method will initialize the communication with the local Nepomuk-KDE services, ie. the RDF repository.

  Calling init() manually is optional now. In the future we might introduce options that make calling it useful.

  Returns 0 if all necessary components could be found and -1 otherwise.

  FIXME: introduce error codes and human readable translated error messages.

- initialized ( )

  returns bool

  Returns true if init() has been called successfully, ie. the KMetaData system is connected to the local RDF repository service and ready to work.

- instance ( )

  returns Nepomuk.ResourceManager
  static

- mainModel ( )

  returns Soprano.Model

  Retrieve the main data storage model.

- notifyError (uri, errorCode)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  uri | QString |
  errorCode | int |

  Internal Non-public API. Used by Resource to signalize errors.

- removeResource (uri)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  uri | QString |

  Remove the resource denoted by uri completely.

  This method is just a wrapper around Resource.remove. The result is the same.

- resourceModified (uri)

  returns Nothing
  SIGNAL ("resourceModified (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  uri | QString |

  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.

  uri - The URI of the modified resource.

  NOT IMPLEMENTED YET

- setOverrideMainModel (model)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  model | Soprano.Model |

  Override the main model used for all storage. By default the main model used is the Nepomuk server main model.

  The - model to use instead of the Nepomuk server or 0 to reset.

  \since 4.1