syndication/rdf
model.h
00001 /* 00002 * This file is part of the syndication library 00003 * 00004 * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 #ifndef SYNDICATION_RDF_MODEL_H 00023 #define SYNDICATION_RDF_MODEL_H 00024 00025 #include <syndication/rdf/document.h> 00026 #include <syndication/rdf/resource.h> 00027 #include <syndication/rdf/statement.h> 00028 00029 #include <syndication/rdf/literal.h> 00030 #include <syndication/rdf/node.h> 00031 #include <syndication/rdf/property.h> 00032 #include <syndication/rdf/sequence.h> 00033 #include <boost/shared_ptr.hpp> 00034 #include <syndication/ksyndication_export.h> 00035 00036 #include <QtCore/QString> 00037 00038 template <class T> class QList; 00039 00040 namespace Syndication { 00041 namespace RDF { 00042 00049 class SYNDICATION_EXPORT Model 00050 { 00051 friend class ::Syndication::RDF::Document; 00052 friend class ::Syndication::RDF::Document::Private; 00053 friend class ::Syndication::RDF::Resource; 00054 friend class ::Syndication::RDF::Resource::ResourcePrivate; 00055 friend class ::Syndication::RDF::Statement; 00056 friend class ::Syndication::RDF::Statement::StatementPrivate; 00057 00058 public: 00059 00064 Model(); 00065 00074 Model(const Model& other); 00075 00079 virtual ~Model(); 00080 00088 Model& operator=(const Model& other); 00089 00099 bool operator==(const Model& other) const; 00100 00110 virtual ResourcePtr createResource(const QString& uri=QString()); 00111 00121 virtual PropertyPtr createProperty(const QString& uri); 00122 00132 virtual SequencePtr createSequence(const QString& uri=QString()); 00133 00140 virtual LiteralPtr createLiteral(const QString& text); 00141 00151 virtual StatementPtr addStatement(ResourcePtr subject, 00152 PropertyPtr predicate, 00153 NodePtr object); 00154 00162 virtual void removeStatement(ResourcePtr subject, 00163 PropertyPtr predicate, 00164 NodePtr object); 00165 00171 virtual void removeStatement(StatementPtr statement); 00172 00176 virtual bool isEmpty() const; 00177 00184 virtual QList<ResourcePtr> resourcesWithType(ResourcePtr type) const; 00185 00190 virtual QList<StatementPtr> statements() const; 00191 00199 virtual NodePtr nodeByID(uint id) const; 00200 00208 virtual ResourcePtr resourceByID(uint id) const; 00209 00217 virtual PropertyPtr propertyByID(uint id) const; 00218 00226 virtual LiteralPtr literalByID(uint id) const; 00227 //@cond PRIVATE 00232 virtual bool resourceHasProperty(const Resource* resource, 00233 PropertyPtr property) const; 00234 00239 virtual StatementPtr resourceProperty(const Resource* resource, 00240 PropertyPtr property) const; 00241 00246 virtual QList<StatementPtr> resourceProperties(const Resource* resource, 00247 PropertyPtr property) const; 00248 00249 //@endcond 00256 virtual QString debugInfo() const; 00257 00258 private: 00259 class ModelPrivate; 00260 boost::shared_ptr<ModelPrivate> d; 00261 }; 00262 00263 00264 } // namespace RDF 00265 } // namespace Syndication 00266 00267 #endif // SYNDICATION_RDF_MODEL_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:52 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:08:52 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.