delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / nepomuk / services / ontologyloader / graphretriever.h
blobb75767c5c64d684240fa43fc5c17f47396748aea
1 /* This file is part of the KDE semantic clipboard
2 Copyright (C) 2008 Tobias Wolf <twolf@access.unizh.ch>
3 Copyright (C) 2008 Sebastian Trueg <trueg@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef _NEPOMUK_GRAPHRETRIEVER_H_
22 #define _NEPOMUK_GRAPHRETRIEVER_H_
24 #include <KJob>
26 class QString;
27 class QUrl;
29 namespace Soprano {
30 class Model;
31 class StatementIterator;
33 namespace KIO {
34 class Job;
37 namespace Nepomuk
40 /**
41 * \class GraphRetriever graphretriever.h <nepomuk/graphretriever.h>
43 * \brief Utility class for retrieving RDF graphs from Web locations.
45 * GraphRetriever allows retrieval of multiple RDF graph fragments from
46 * the Web using HTTP GET. Target HTTP servers should support the RDF+XML
47 * request MIME type for this to work.
49 * Clients can queue multiple get requests and must follow the last get
50 * request with a call to either model() or serialization().
52 * \author Tobias Wolf <twolf@access.unizh.ch>
54 class GraphRetriever : public KJob
56 Q_OBJECT
58 public:
59 /**
60 * Custom and default constructor.
62 * @param parent The parent QObject.
64 GraphRetriever( QObject* parent = 0 );
66 /**
67 * Default destructor.
69 ~GraphRetriever();
71 static GraphRetriever* retrieve( const QUrl& uri );
73 void setUrl( const QUrl& url );
75 QUrl url() const;
77 /**
78 * Adds a get request for the given URL.
80 * @param url An URL specifying the location of a graph fragment to get.
81 * @return True if the get request was accepted, false otherwise.
83 void start();
85 /**
86 * Returns a new Soprano model constructed from the retrieved graph fragments. The
87 * client takes over ownership of the returned model.
89 * @return A new Soprano model constructed from the merged fragments.
91 Soprano::Model* model() const;
93 Soprano::StatementIterator statements() const;
95 private Q_SLOTS:
96 /**
97 * @internal
99 void httpRequestFinished( KJob* );
101 private:
102 class Private;
103 Private* const d;
108 #endif