• 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
  • services
  • storage
  • backup
statementgenerator.h
Go to the documentation of this file.
1 /*
2  * <one line to give the library's name and an idea of what it does.>
3  * Copyright 2013 Vishesh Handa <me@vhanda.in>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License or (at your option) version 3 or any later version
9  * accepted by the membership of KDE e.V. (or its successor approved
10  * by the membership of KDE e.V.), which shall act as a proxy
11  * defined in Section 14 of version 3 of the license.
12  *
13  * This program 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
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef NEPOMUK2_BACKUP_STATEMENTGENERATOR_H
24 #define NEPOMUK2_BACKUP_STATEMENTGENERATOR_H
25 
26 #include <KJob>
27 #include <Soprano/Model>
28 
29 namespace Nepomuk2 {
30 namespace Backup {
31 
36 class StatementGenerator : public KJob
37 {
38  Q_OBJECT
39 public:
40  StatementGenerator(Soprano::Model* model, const QString& inputFile,
41  const QString& outputFile, QObject* parent);
42 
43  virtual void start();
44 
45  enum Filter {
46  Filter_None,
47  Filter_TagsAndRatings
48  };
49 
50  void setFilter( Filter filter );
51 
52  void setResourceCount( int count ) { m_resourceCount = count; }
53  int statementCount() const { return m_statementCount; }
54 private slots:
55  void doJob();
56 
57 private:
58  Soprano::Model* m_model;
59 
60  QString m_inputFile;
61  QString m_outputFile;
62  Filter m_filter;
63 
64  QList<Soprano::Statement> fetchNonDiscardableStatements(const QUrl& uri);
65  QList<Soprano::Statement> fetchAllStatements(const QUrl& uri);
66  QList<Soprano::Statement> fetchProperties(const QUrl& uri, QStringList properties);
67 
68  bool hasType(const QUrl& uri, const QUrl& type);
69 
70  int m_resourceCount;
71  int m_statementCount;
72 };
73 }
74 }
75 
76 #endif // NEPOMUK2_BACKUP_STATEMENTGENERATOR_H
Nepomuk2::Backup::StatementGenerator
Takes a list of resource uris and generates all the statements related to those statements.
Definition: statementgenerator.h:36
Nepomuk2::Backup::StatementGenerator::StatementGenerator
StatementGenerator(Soprano::Model *model, const QString &inputFile, const QString &outputFile, QObject *parent)
Definition: statementgenerator.cpp:43
Nepomuk2::Backup::StatementGenerator::Filter_None
Definition: statementgenerator.h:46
QObject
Nepomuk2::Backup::StatementGenerator::start
virtual void start()
Definition: statementgenerator.cpp:54
Nepomuk2::Backup::StatementGenerator::Filter_TagsAndRatings
Definition: statementgenerator.h:47
Nepomuk2::Backup::StatementGenerator::statementCount
int statementCount() const
Definition: statementgenerator.h:53
Nepomuk2::Backup::StatementGenerator::Filter
Filter
Definition: statementgenerator.h:45
Nepomuk2::Backup::StatementGenerator::setFilter
void setFilter(Filter filter)
Definition: statementgenerator.cpp:59
Nepomuk2::Backup::StatementGenerator::setResourceCount
void setResourceCount(int count)
Definition: statementgenerator.h:52
KJob
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