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

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • libnepomukcore
  • datamanagement
datamanagement.h
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2011 Sebastian Trueg <trueg@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) version 3, or any
9  later version accepted by the membership of KDE e.V. (or its
10  successor approved by the membership of KDE e.V.), which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef DATAMANAGEMENT_H
23 #define DATAMANAGEMENT_H
24 
25 #include <QtCore/QObject>
26 
27 #include <KComponentData>
28 #include <KGlobal>
29 
30 #include <Soprano/Global>
31 
32 #include "nepomuk_export.h"
33 
34 class KJob;
35 class KUrl;
36 
37 
38 namespace Nepomuk2 {
39  class DescribeResourcesJob;
40  class StoreResourcesJob;
41  class CreateResourceJob;
42  class SimpleResourceGraph;
43 
235  enum RemovalFlag {
237  NoRemovalFlags = 0,
238 
245  RemoveSubResoures = 1
246  };
247  Q_DECLARE_FLAGS(RemovalFlags, RemovalFlag)
248 
249 
260  NEPOMUK_EXPORT KJob* addProperty(const QList<QUrl>& resources,
261  const QUrl& property,
262  const QVariantList& values,
263  const KComponentData& component = KGlobal::mainComponent());
264 
277  NEPOMUK_EXPORT KJob* setProperty(const QList<QUrl>& resources,
278  const QUrl& property,
279  const QVariantList& values,
280  const KComponentData& component = KGlobal::mainComponent());
281 
293  NEPOMUK_EXPORT KJob* removeProperty(const QList<QUrl>& resources,
294  const QUrl& property,
295  const QVariantList& values,
296  const KComponentData& component = KGlobal::mainComponent());
297 
308  NEPOMUK_EXPORT KJob* removeProperties(const QList<QUrl>& resources,
309  const QList<QUrl>& properties,
310  const KComponentData& component = KGlobal::mainComponent());
311 
322  NEPOMUK_EXPORT CreateResourceJob* createResource(const QList<QUrl>& types,
323  const QString& label,
324  const QString& description,
325  const KComponentData& component = KGlobal::mainComponent());
326 
334  NEPOMUK_EXPORT KJob* removeResources(const QList<QUrl>& resources,
335  Nepomuk2::RemovalFlags flags = Nepomuk2::NoRemovalFlags,
336  const KComponentData& component = KGlobal::mainComponent());
338 
349  enum StoreIdentificationMode {
352  IdentifyNew = 0,
353 
356  IdentifyNone = 2
357  };
358 
362  enum StoreResourcesFlag {
364  NoStoreResourcesFlags = 0x0,
365 
369  OverwriteProperties = 0x1,
370 
373  LazyCardinalities = 0x2,
374 
380  OverwriteAllProperties = 0x4,
381 
385  MergeDuplicateResources = 0x8
386  };
387  Q_DECLARE_FLAGS(StoreResourcesFlags, StoreResourcesFlag)
388 
389 
394  enum DescribeResourcesFlag {
396  NoDescribeResourcesFlags = 0,
397 
399  ExcludeDiscardableData = 1,
400 
402  ExcludeRelatedResources = 2,
403 
406  AnonymizeNepomukUris = 4
407  };
408  Q_DECLARE_FLAGS(DescribeResourcesFlags, DescribeResourcesFlag)
409 
410 
422  NEPOMUK_EXPORT KJob* removeDataByApplication(const QList<QUrl>& resources,
423  Nepomuk2::RemovalFlags flags = Nepomuk2::NoRemovalFlags,
424  const KComponentData& component = KGlobal::mainComponent());
425 
436  NEPOMUK_EXPORT KJob* removeDataByApplication(Nepomuk2::RemovalFlags flags = Nepomuk2::NoRemovalFlags,
437  const KComponentData& component = KGlobal::mainComponent());
438 
448  NEPOMUK_EXPORT KJob* mergeResources(const QUrl& resource1,
449  const QUrl& resource2,
450  const KComponentData& component = KGlobal::mainComponent());
451 
460  NEPOMUK_EXPORT KJob* mergeResources(const QList<QUrl>& resources,
461  const KComponentData& component = KGlobal::mainComponent());
462 
485  NEPOMUK_EXPORT StoreResourcesJob* storeResources(const Nepomuk2::SimpleResourceGraph& resources,
486  Nepomuk2::StoreIdentificationMode identificationMode = Nepomuk2::IdentifyNew,
487  Nepomuk2::StoreResourcesFlags flags = Nepomuk2::NoStoreResourcesFlags,
488  const QHash<QUrl, QVariant>& additionalMetadata = QHash<QUrl, QVariant>(),
489  const KComponentData& component = KGlobal::mainComponent());
490 
516  NEPOMUK_EXPORT KJob* importResources(const KUrl& url,
517  Soprano::RdfSerialization serialization,
518  const QString& userSerialization = QString(),
519  StoreIdentificationMode identificationMode = IdentifyNew,
520  StoreResourcesFlags flags = NoStoreResourcesFlags,
521  const QHash<QUrl, QVariant>& additionalMetadata = QHash<QUrl, QVariant>(),
522  const KComponentData& component = KGlobal::mainComponent());
523 
554  NEPOMUK_EXPORT DescribeResourcesJob* describeResources(const QList<QUrl>& resources,
555  DescribeResourcesFlags flags = NoDescribeResourcesFlags,
556  const QList<QUrl>& targetParties = QList<QUrl>() );
558 
559 }
560 
561 Q_DECLARE_OPERATORS_FOR_FLAGS(Nepomuk2::RemovalFlags)
562 Q_DECLARE_OPERATORS_FOR_FLAGS(Nepomuk2::StoreResourcesFlags)
563 Q_DECLARE_OPERATORS_FOR_FLAGS(Nepomuk2::DescribeResourcesFlags)
564 
565 #endif
Nepomuk2::StoreIdentificationMode
StoreIdentificationMode
The identification mode used by storeResources().
Definition: datamanagement.h:349
Nepomuk2::MergeDuplicateResources
When this is enabled each SimpleResource will be checked to make sure a duplicate of it does not alre...
Definition: datamanagement.h:385
Nepomuk2::ExcludeRelatedResources
Exclude related resources, only include literal properties.
Definition: datamanagement.h:402
Nepomuk2::addProperty
KJob * addProperty(const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const KComponentData &component=KGlobal::mainComponent())
Add one or more property values to one or more resources.
Definition: datamanagement.cpp:36
Nepomuk2::ExcludeDiscardableData
Exclude discardable data, ie. data which can be re-generated.
Definition: datamanagement.h:399
Nepomuk2::importResources
KJob * importResources(const KUrl &url, Soprano::RdfSerialization serialization, const QString &userSerialization=QString(), StoreIdentificationMode identificationMode=IdentifyNew, StoreResourcesFlags flags=NoStoreResourcesFlags, const QHash< QUrl, QVariant > &additionalMetadata=QHash< QUrl, QVariant >(), const KComponentData &component=KGlobal::mainComponent())
Import an RDF graph from a URL.
Definition: datamanagement.cpp:154
Nepomuk2::removeProperty
KJob * removeProperty(const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const KComponentData &component=KGlobal::mainComponent())
Remove values of a property from one or more resources.
Definition: datamanagement.cpp:61
Nepomuk2::mergeResources
KJob * mergeResources(const QUrl &resource1, const QUrl &resource2, const KComponentData &component=KGlobal::mainComponent())
Merge two resources into one.
Definition: datamanagement.cpp:125
Nepomuk2::OverwriteProperties
By default storeResources() will only append data and fail if properties with cardinality 1 already h...
Definition: datamanagement.h:369
Nepomuk2::LazyCardinalities
When lazy cardinalities are enabled any value that would violate a cardinality restriction is simply ...
Definition: datamanagement.h:373
QHash
Nepomuk2::RemovalFlag
RemovalFlag
Flags to influence the behaviour of the data management methods removeResources() and removeDataByApp...
Definition: datamanagement.h:235
Nepomuk2::DescribeResourcesFlag
DescribeResourcesFlag
Flags to influence the result of describeResources().
Definition: datamanagement.h:394
Nepomuk2::describeResources
DescribeResourcesJob * describeResources(const QList< QUrl > &resources, DescribeResourcesFlags flags=NoDescribeResourcesFlags, const QList< QUrl > &targetParties=QList< QUrl >())
Retrieve all information about a set of resources.
Definition: datamanagement.cpp:171
Nepomuk2::AnonymizeNepomukUris
Replaces the resouce URIs which are specific to this instance of Nepomuk with blank nodes...
Definition: datamanagement.h:406
Nepomuk2::OverwriteAllProperties
By default storeResources will only append data and fail if properties with cardinality 1 already hav...
Definition: datamanagement.h:380
Nepomuk2::StoreResourcesFlag
StoreResourcesFlag
Flags to influence the behaviour of storeResources().
Definition: datamanagement.h:362
Nepomuk2::storeResources
StoreResourcesJob * storeResources(const Nepomuk2::SimpleResourceGraph &resources, Nepomuk2::StoreIdentificationMode identificationMode=Nepomuk2::IdentifyNew, Nepomuk2::StoreResourcesFlags flags=Nepomuk2::NoStoreResourcesFlags, const QHash< QUrl, QVariant > &additionalMetadata=QHash< QUrl, QVariant >(), const KComponentData &component=KGlobal::mainComponent())
Store many resources at once.
Definition: datamanagement.cpp:144
Nepomuk2::IdentifyNew
This is the default mode.
Definition: datamanagement.h:352
Nepomuk2::IdentifyNone
All resources are treated as new ones.
Definition: datamanagement.h:356
Nepomuk2::removeProperties
KJob * removeProperties(const QList< QUrl > &resources, const QList< QUrl > &properties, const KComponentData &component=KGlobal::mainComponent())
Remove one or more properties from one or more resources.
Definition: datamanagement.cpp:74
Nepomuk2::removeResources
KJob * removeResources(const QList< QUrl > &resources, Nepomuk2::RemovalFlags flags=Nepomuk2::NoRemovalFlags, const KComponentData &component=KGlobal::mainComponent())
Completely remove resources from the database.
Nepomuk2::setProperty
KJob * setProperty(const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const KComponentData &component=KGlobal::mainComponent())
Set the values of a property for one or more resources.
Definition: datamanagement.cpp:48
Nepomuk2::createResource
CreateResourceJob * createResource(const QList< QUrl > &types, const QString &label, const QString &description, const KComponentData &component=KGlobal::mainComponent())
Create a new resource.
Definition: datamanagement.cpp:85
Nepomuk2::NoStoreResourcesFlags
No flags - default behaviour.
Definition: datamanagement.h:364
Nepomuk2::RemoveSubResoures
Remove sub resources of the resources specified in the parameters.
Definition: datamanagement.h:245
Nepomuk2::NoDescribeResourcesFlags
No flags - default behaviour.
Definition: datamanagement.h:396
KJob
nepomuk_export.h
Nepomuk2::NoRemovalFlags
No flags - default behaviour.
Definition: datamanagement.h:237
Nepomuk2::removeDataByApplication
KJob * removeDataByApplication(const QList< QUrl > &resources, Nepomuk2::RemovalFlags flags=Nepomuk2::NoRemovalFlags, const KComponentData &component=KGlobal::mainComponent())
Remove all information about resources from the database which has been created by a specific applica...
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 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