• 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
syncresourceidentifier.h
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2010 Vishesh Handa <handa.vish@gmail.com>
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 
23 #ifndef NEPOMUK_RESOURCEIDENTIFIER_H
24 #define NEPOMUK_RESOURCEIDENTIFIER_H
25 
26 #include <QtCore/QMultiHash>
27 #include <QtCore/QSet>
28 #include <KUrl>
29 
30 #include "syncresource.h"
31 
32 namespace Soprano {
33  class Statement;
34  class Graph;
35  class Model;
36 }
37 
38 namespace Nepomuk2 {
39 
40  class Resource;
41 
42  namespace Sync {
43 
44  class SyncResource;
45  class ResourceHash;
46 
56  class ResourceIdentifier
57  {
58  public:
59  ResourceIdentifier( Soprano::Model * model );
60  virtual ~ResourceIdentifier();
61 
62  //
63  // Processing
64  //
65  void identifyAll();
66 
67  bool identify( const KUrl & uri );
68 
72  void identify( const KUrl::List & uriList );
73 
74  void addSyncResource( const SyncResource & res );
75 
76  //
77  // Getting the info
78  //
79 
83  QHash<QUrl, QUrl> mappings() const;
84 
85  SyncResource simpleResource( const KUrl & uri );
86 
87  ResourceHash resourceHash() const;
88 
89  virtual bool isIdentifyingProperty( const QUrl & uri ) = 0;
90 
91  protected:
97  virtual KUrl duplicateMatch( const KUrl & uri, const QSet<KUrl> & matchedUris );
98 
104  virtual bool runIdentification( const KUrl& uri );
105 
110  void manualIdentification( const KUrl & oldUri, const KUrl & newUri );
111 
112  protected:
113  Soprano::Model * m_model;
114 
119  QHash<QUrl, QUrl> m_hash;
120 
121  QSet<KUrl> m_notIdentified;
122 
124  ResourceHash m_resourceHash;
125 
131  QSet<KUrl> m_beingIdentified;
132  };
133  }
134 }
135 
136 #endif // NEPOMUK_RESOURCEIDENTIFIER_H
Nepomuk2::Sync::ResourceIdentifier::m_resourceHash
ResourceHash m_resourceHash
Used to store all the identification statements.
Definition: syncresourceidentifier.h:124
Nepomuk2::Sync::ResourceIdentifier::mappings
QHash< QUrl, QUrl > mappings() const
Returns mappings of the identified uri.
Definition: syncresourceidentifier.cpp:279
Nepomuk2::Sync::ResourceIdentifier::m_notIdentified
QSet< KUrl > m_notIdentified
Definition: syncresourceidentifier.h:121
Nepomuk2::Sync::ResourceIdentifier::m_model
Soprano::Model * m_model
Definition: syncresourceidentifier.h:113
Nepomuk2::Sync::ResourceIdentifier::m_beingIdentified
QSet< KUrl > m_beingIdentified
This contains all the urls that are being identified, at any moment.
Definition: syncresourceidentifier.h:131
Nepomuk2::Sync::ResourceIdentifier::~ResourceIdentifier
virtual ~ResourceIdentifier()
Definition: syncresourceidentifier.cpp:56
QHash
Nepomuk2::Sync::ResourceIdentifier::m_hash
QHash< QUrl, QUrl > m_hash
The main identification hash which maps external ResourceUris with the internal ones.
Definition: syncresourceidentifier.h:119
Nepomuk2::Sync::ResourceIdentifier::identifyAll
void identifyAll()
Definition: syncresourceidentifier.cpp:80
Nepomuk2::Sync::ResourceIdentifier::resourceHash
ResourceHash resourceHash() const
Definition: syncresourceidentifier.cpp:294
Nepomuk2::Sync::ResourceIdentifier::ResourceIdentifier
ResourceIdentifier(Soprano::Model *model)
Definition: syncresourceidentifier.cpp:51
Nepomuk2::Sync::ResourceIdentifier::manualIdentification
void manualIdentification(const KUrl &oldUri, const KUrl &newUri)
Sets oldUri -> newUri in the mappings.
Definition: syncresourceidentifier.cpp:308
Nepomuk2::Sync::ResourceIdentifier::identify
bool identify(const KUrl &uri)
Definition: syncresourceidentifier.cpp:86
Nepomuk2::Sync::ResourceIdentifier::addSyncResource
void addSyncResource(const SyncResource &res)
Definition: syncresourceidentifier.cpp:62
Nepomuk2::Sync::ResourceIdentifier::duplicateMatch
virtual KUrl duplicateMatch(const KUrl &uri, const QSet< KUrl > &matchedUris)
Called during identification if there is more than one match for one resource.
Definition: syncresourceidentifier.cpp:299
Nepomuk2::Sync::ResourceIdentifier::runIdentification
virtual bool runIdentification(const KUrl &uri)
This function returns true if identification was successful, and false if it was not.
Definition: syncresourceidentifier.cpp:113
Nepomuk2::Sync::ResourceIdentifier::isIdentifyingProperty
virtual bool isIdentifyingProperty(const QUrl &uri)=0
Nepomuk2::Sync::ResourceIdentifier
This class is used to identify already existing resources from a set of properties and objects...
Definition: syncresourceidentifier.h:56
Nepomuk2::Sync::ResourceIdentifier::simpleResource
SyncResource simpleResource(const KUrl &uri)
Definition: syncresourceidentifier.cpp:284
syncresource.h
Nepomuk2::Sync::SyncResource
A SyncResource is a convenient way of storing a set of properties and objects for a common subject...
Definition: syncresource.h:53
Nepomuk2::Sync::ResourceHash
A SyncResource is a convenient way of representing a list of Soprano::Statements or a Soprano::Graph...
Definition: syncresource.h:109
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