2
This file is part of the Nepomuk KDE project.
3
Copyright (C) 2010 Vishesh Handa <handa.vish@gmail.com>
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.
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.
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/>.
22
#ifndef IDENTIFICATIONSET_H
23
#define IDENTIFICATIONSET_H
25
#include <QtCore/QUrl>
26
#include <QtCore/QSet>
27
#include <QtCore/QMultiHash>
28
#include <QtCore/QTextStream>
29
#include <QtCore/QSharedDataPointer>
30
#include <Nepomuk/ResourceManager>
41
class IdentificationSet
45
IdentificationSet( const IdentificationSet & rhs );
46
virtual ~IdentificationSet();
49
* Loads the IdentificationSet present at the \p url
51
* \param url It must be a local file
53
static IdentificationSet fromUrl( const QUrl & url );
56
* Parses the contents of the text stream \p ts and returns a IdentificationSet.
58
static IdentificationSet fromTextStream( QTextStream& ts );
61
* Creates an IdentificationSet from the ChangeLog \p log. The model \p is queried
62
* for all the identification properties for each resource in the \p log.
64
* \param log The ChangeLog
65
* \param model The model which will be queried for all the identification properties.
66
* By default the Nepomuk mainModel is used.
67
* \param ignoreList The resources that shall be ignored ( not considered )
69
static IdentificationSet fromChangeLog(const ChangeLog& log, Soprano::Model* model = Nepomuk::ResourceManager::instance()->mainModel(), const QSet<QUrl> & ignoreList = QSet<QUrl>());
72
* Creates an IdentificationSet which only contains the properties for the Resource
73
* with resource uri \p resourceUri.
75
static IdentificationSet fromResource(const QUrl & resourceUri, Soprano::Model* model = Nepomuk::ResourceManager::instance()->mainModel(), const QSet<QUrl> & ignoreList = QSet<QUrl>());
78
* Creates an IdentificationSet for all the resources present in \p resList
80
static IdentificationSet fromResourceList( const QList<QUrl> resList, Soprano::Model* model = Nepomuk::ResourceManager::instance()->mainModel() );
83
* Creates an IdentificationSet which contains all the identification properties
84
* of all the resources present in the \p log. No model is queried to get these
85
* properties. Only the identification properties present in the ChangeLog are
88
* In order to test which properties are identifyable, the main model is queried.
90
static IdentificationSet fromOnlyChangeLog( const ChangeLog & log );
92
bool save( const QUrl & url ) const;
93
bool save( QTextStream & out ) const;
95
QList<Soprano::Statement> toList() const;
98
void mergeWith(const IdentificationSet & rhs);
100
IdentificationSet & operator=( const IdentificationSet & rhs );
101
IdentificationSet& operator<<(const IdentificationSet & rhs);
103
static void createIdentificationSet( const QSet< QUrl >& uniqueUris, const QUrl& outputUrl );
106
QSharedDataPointer<Private> d;
109
#endif // IDENTIFICATIONSET_H