delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / nepomuk / services / ontologyloader / ontologymanagermodel.h
blobf351f19a438b231fd4fa8218b540f5fd88259f81
1 /* This file is part of the KDE Project
2 Copyright (c) 2008 Sebastian Trueg <trueg@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef _NEPOMUK_ONTOLOGY_MANAGER_MODEL_H_
20 #define _NEPOMUK_ONTOLOGY_MANAGER_MODEL_H_
22 #include <Soprano/FilterModel>
24 namespace Nepomuk {
25 /**
26 * \class OntologyManagerModel ontologymanagermodel.h ontologymanagermodel.h
28 * \brief Filter model to manage NRL ontologies.
30 * Can be used to manage ontologies stored in a model. The ontologies
31 * are stored in NRL graphs.
33 * \author Sebastian Trueg <trueg@kde.org>
35 class OntologyManagerModel : public Soprano::FilterModel
37 Q_OBJECT
39 public:
40 /**
41 * Create a new model.
43 OntologyManagerModel( Soprano::Model* parentModel = 0, QObject* parent = 0 );
45 /**
46 * Destructor
48 ~OntologyManagerModel();
50 /**
51 * Reimplemented from FilterModel. The API is not affected.
53 void setParentModel( Soprano::Model* parentModel );
55 /**
56 * Update an ontology.
58 * \param data The actual statements defining the ontology. These statements have to
59 * either already define the proper NRL graphs or not define graphs at all. In the
60 * latter case the graphs will be created.
61 * \param ns The namespace of the ontology. If this is left invalid it will be
62 * determined from the data.
64 * \return \p true if the data was valid and the ontology was successfully updated.
65 * \false otherwise.
67 bool updateOntology( Soprano::StatementIterator data, const QUrl& ns = QUrl() );
69 /**
70 * Remove an ontology from the model.
72 * \param ns The namespace of the ontology.
74 * \return \p true if the ontology was found and successfully removed.
75 * \p false in case the ontology was not found or an error occurred.
77 bool removeOntology( const QUrl& ns );
79 /**
80 * Determine the modification time of a stored ontology. The
81 * modification time of an ontology is the time it was stored into
82 * the model.
84 * \param uri The namespace of the ontology.
86 * \return The modification time of the ontology identified by \p uri
87 * or an invalid QDateTime if the ontology was not found.
89 QDateTime ontoModificationDate( const QUrl& uri );
91 /**
92 * Tries to find the ontology \p uri in the local Nepomuk store.
93 * \return The context (named graph) storing the ontology's statements
94 * or an invalid URI if the ontology could not be found.
96 QUrl findOntologyContext( const QUrl& uri );
98 private:
99 class Private;
100 Private* const d;
104 #endif