• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • Nepomuk2
  • DataManagementModel
Public Slots | Public Member Functions | List of all members
Nepomuk2::DataManagementModel Class Reference

#include <datamanagementmodel.h>

Inherits FilterModel.

Public Slots

void clearCache ()
 
QUrl nepomukGraph ()
 
TypeCache * typeCache ()
 
Basic API
void addProperty (const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const QString &app)
 
void setProperty (const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const QString &app)
 
void removeProperty (const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const QString &app)
 
void removeProperties (const QList< QUrl > &resources, const QList< QUrl > &properties, const QString &app)
 
QUrl createResource (const QList< QUrl > &types, const QString &label, const QString &description, const QString &app)
 
void removeResources (const QList< QUrl > &resources, Nepomuk2::RemovalFlags flags, const QString &app)
 
Advanced API
void removeDataByApplication (const QList< QUrl > &resources, RemovalFlags flags, const QString &app)
 
void removeDataByApplication (RemovalFlags flags, const QString &app)
 
QHash< QUrl, QUrl > storeResources (const SimpleResourceGraph &resources, const QString &app, Nepomuk2::StoreIdentificationMode identificationMode=Nepomuk2::IdentifyNew, Nepomuk2::StoreResourcesFlags flags=Nepomuk2::NoStoreResourcesFlags, const QHash< QUrl, QVariant > &additionalMetadata=(QHash< QUrl, QVariant >()))
 
QHash< QUrl, QUrl > storeResources (const SimpleResourceGraph &resources, const QString &app, bool discardable, Nepomuk2::StoreIdentificationMode identificationMode=Nepomuk2::IdentifyNew, Nepomuk2::StoreResourcesFlags flags=Nepomuk2::NoStoreResourcesFlags)
 
void mergeResources (const QList< QUrl > &resources, const QString &app)
 
void importResources (const QUrl &url, const QString &app, Soprano::RdfSerialization serialization, const QString &userSerialization=QString(), Nepomuk2::StoreIdentificationMode identificationMode=Nepomuk2::IdentifyNew, Nepomuk2::StoreResourcesFlags flags=Nepomuk2::NoStoreResourcesFlags, const QHash< QUrl, QVariant > &additionalMetadata=(QHash< QUrl, QVariant >()))
 
SimpleResourceGraph describeResources (const QList< QUrl > &resources, DescribeResourcesFlags flags=NoDescribeResourcesFlags, const QList< QUrl > &targetParties=QList< QUrl >())
 
QString exportResources (const QList< QUrl > &resources, Soprano::RdfSerialization serialization, const QString &userSerialization=QString(), DescribeResourcesFlags flags=NoDescribeResourcesFlags, const QList< QUrl > &targetParties=QList< QUrl >())
 

Public Member Functions

 DataManagementModel (ClassAndPropertyTree *tree, Soprano::Model *model, QObject *parent=0)
 
 ~DataManagementModel ()
 
ResourceWatcherManager * resourceWatcherManager () const
 

Detailed Description

Definition at line 39 of file datamanagementmodel.h.

Constructor & Destructor Documentation

Nepomuk2::DataManagementModel::DataManagementModel ( Nepomuk2::ClassAndPropertyTree *  tree,
Soprano::Model *  model,
QObject *  parent = 0 
)

Definition at line 211 of file datamanagementmodel.cpp.

Nepomuk2::DataManagementModel::~DataManagementModel ( )

Definition at line 268 of file datamanagementmodel.cpp.

Member Function Documentation

void Nepomuk2::DataManagementModel::addProperty ( const QList< QUrl > &  resources,
const QUrl &  property,
const QVariantList &  values,
const QString &  app 
)
slot

Add property with values to each resource from resources.

Existing values will not be touched. If a cardinality is breached an error will be thrown.

Definition at line 321 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::clearCache ( )
slot

Clear the internal cache present in the model.

Definition at line 247 of file datamanagementmodel.cpp.

QUrl Nepomuk2::DataManagementModel::createResource ( const QList< QUrl > &  types,
const QString &  label,
const QString &  description,
const QString &  app 
)
slot

Create a new resource with several types.

Definition at line 814 of file datamanagementmodel.cpp.

Nepomuk2::SimpleResourceGraph Nepomuk2::DataManagementModel::describeResources ( const QList< QUrl > &  resources,
DescribeResourcesFlags  flags = NoDescribeResourcesFlags,
const QList< QUrl > &  targetParties = QList<QUrl>() 
)
slot

Describe a set of resources, i.e.

retrieve all their properties.

Parameters
resourcesThe resource URIs of the resources to describe. Non-existing resources are ignored.
flagsOptional flags to modify the data which is returned.
targetPartiesThis optional list can be used to specify the parties (nao:Party) which should receive the returned data. This will result in a filtering of the result according to configured permissions. Only data which is set as being public or readable by the specified parties is returned.

Definition at line 1711 of file datamanagementmodel.cpp.

QString Nepomuk2::DataManagementModel::exportResources ( const QList< QUrl > &  resources,
Soprano::RdfSerialization  serialization,
const QString &  userSerialization = QString(),
DescribeResourcesFlags  flags = NoDescribeResourcesFlags,
const QList< QUrl > &  targetParties = QList<QUrl>() 
)
slot

Export a set of resources, i.e.

retrieve their properties.

Parameters
resourcesThe resource URIs of the resources to describe. Non-existing resources are ignored.
serializationThe RDF serialization used for the result.
userSerializationIf serialization is Soprano::SerializationUser this value is used. See Soprano::Parser for details.
flagsOptional flags to modify the data which is returned.
targetPartiesThis optional list can be used to specify the parties (nao:Party) which should receive the returned data. This will result in a filtering of the result according to configured permissions. Only data which is set as being public or readable by the specified parties is returned.
Returns
A serialized representation of the requested resources.
See also
describeResources

Definition at line 1925 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::importResources ( const QUrl &  url,
const QString &  app,
Soprano::RdfSerialization  serialization,
const QString &  userSerialization = QString(),
Nepomuk2::StoreIdentificationMode  identificationMode = Nepomuk2::IdentifyNew,
Nepomuk2::StoreResourcesFlags  flags = Nepomuk2::NoStoreResourcesFlags,
const QHash< QUrl, QVariant > &  additionalMetadata = (QHash<QUrl, QVariant>()) 
)
slot

Import an RDF graph from a URL.

Parameters
urlThe url from which the graph should be loaded. This does not have to be local.
serializationThe RDF serialization used for the file. If Soprano::SerializationUnknown a crude automatic detection based on file extension is used.
userSerializationIf serialization is Soprano::SerializationUser this value is used. See Soprano::Parser for details.
identificationModeThis method can try hard to avoid duplicate resources by looking for already existing duplicates based on nrl:DefiningProperty. By default it only looks for duplicates of resources that do not have a resource URI (SimpleResource::uri()) defined. This behaviour can be changed with this parameter.
flagsAdditional flags to change the behaviour of the method.
additionalMetadataAdditional metadata for the added resources. This can include such details as the creator of the data or details on the method of data recovery. One typical usecase is that the file indexer uses (rdf:type, nrl:DiscardableInstanceBase) to state that the provided information can be recreated at any time. Only built-in types such as int, string, or url are supported.
appThe calling application

Definition at line 1558 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::mergeResources ( const QList< QUrl > &  resources,
const QString &  app 
)
slot

Merges all the resources into one.

Properties from the first resource in resources take precedence over all other resources present in resources

Definition at line 1608 of file datamanagementmodel.cpp.

QUrl DataManagementModel::nepomukGraph ( )
slot

Definition at line 2608 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::removeDataByApplication ( const QList< QUrl > &  resources,
RemovalFlags  flags,
const QString &  app 
)
slot

Remove all information about resources from the database which have been created by a specific application.

Parameters
resourcesThe URIs of the resources to be removed.
appThe application for which data should be removed.
forceForce deletion of the resource and all sub-resources. If false sub-resources will be kept if they are still referenced by other resources.

Definition at line 948 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::removeDataByApplication ( RemovalFlags  flags,
const QString &  app 
)
slot

Remove all information from the database which has been created by a specific application.

Parameters
appThe application for which data should be removed.
forceForce deletion of the resource and all sub-resources. If false sub-resources will be kept if they are still referenced by resources that have been created by other applications.

Definition at line 1143 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::removeProperties ( const QList< QUrl > &  resources,
const QList< QUrl > &  properties,
const QString &  app 
)
slot

Remove all statements involving any proerty from properties from all resources in resources.

Definition at line 713 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::removeProperty ( const QList< QUrl > &  resources,
const QUrl &  property,
const QVariantList &  values,
const QString &  app 
)
slot

Remove the property property with values from each resource in resources.

Definition at line 617 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::removeResources ( const QList< QUrl > &  resources,
Nepomuk2::RemovalFlags  flags,
const QString &  app 
)
slot

Remove resources from the database.

Parameters
resourcesThe URIs of the resources to be removed.
appThe calling application.
forceForce deletion of the resource and all sub-resources. If false sub-resources will be kept if they are still referenced by other resources.

Definition at line 907 of file datamanagementmodel.cpp.

Nepomuk2::ResourceWatcherManager * Nepomuk2::DataManagementModel::resourceWatcherManager ( ) const

used by the unit tests

Definition at line 2598 of file datamanagementmodel.cpp.

void Nepomuk2::DataManagementModel::setProperty ( const QList< QUrl > &  resources,
const QUrl &  property,
const QVariantList &  values,
const QString &  app 
)
slot

Set, ie.

overwrite properties. Set property with values for each resource from resources. Existing values will be replaced.

Definition at line 465 of file datamanagementmodel.cpp.

QHash< QUrl, QUrl > DataManagementModel::storeResources ( const SimpleResourceGraph &  resources,
const QString &  app,
Nepomuk2::StoreIdentificationMode  identificationMode = Nepomuk2::IdentifyNew,
Nepomuk2::StoreResourcesFlags  flags = Nepomuk2::NoStoreResourcesFlags,
const QHash< QUrl, QVariant > &  additionalMetadata = (QHash<QUrl, QVariant>()) 
)
slot
Parameters
resourcesThe resources to be merged. Blank nodes will be converted into new URIs (unless the corresponding resource already exists).
identificationModeThis method can try hard to avoid duplicate resources by looking for already existing duplicates based on nrl:DefiningProperty. By default it only looks for duplicates of resources that do not have a resource URI (SimpleResource::uri()) defined. This behaviour can be changed with this parameter.
flagsAdditional flags to change the behaviour of the method.
additionalMetadataAdditional metadata for the added resources. This can include such details as the creator of the data or details on the method of data recovery. One typical usecase is that the file indexer uses (rdf:type, nrl:DiscardableInstanceBase) to state that the provided information can be recreated at any time. Only built-in types such as int, string, or url are supported.
Note
Due to performance concerns, currently only (rdf:type, nrl:DiscardableInstanceBase) is considered as additionalMetadata. The rest is ignored.
Parameters
appThe calling application

Definition at line 1285 of file datamanagementmodel.cpp.

QHash<QUrl,QUrl> Nepomuk2::DataManagementModel::storeResources ( const SimpleResourceGraph &  resources,
const QString &  app,
bool  discardable,
Nepomuk2::StoreIdentificationMode  identificationMode = Nepomuk2::IdentifyNew,
Nepomuk2::StoreResourcesFlags  flags = Nepomuk2::NoStoreResourcesFlags 
)
slot
Parameters
resourcesThe resources to be merged. Blank nodes will be converted into new URIs (unless the corresponding resource already exists).
identificationModeThis method can try hard to avoid duplicate resources by looking for already existing duplicates based on nrl:DefiningProperty. By default it only looks for duplicates of resources that do not have a resource URI (SimpleResource::uri()) defined. This behaviour can be changed with this parameter.
flagsAdditional flags to change the behaviour of the method.
discardableIndicates if the data being stored is discardable. This is typically used in the file indexer so that the rdf:type nrl:DiscardableInstanceBase is applied.
appThe calling application
TypeCache * DataManagementModel::typeCache ( )
slot

Definition at line 2603 of file datamanagementmodel.cpp.


The documentation for this class was generated from the following files:
  • datamanagementmodel.h
  • datamanagementmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal