syndication/rdf
model.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 <syndication/rdf/statement.h>
00034 #include <boost/shared_ptr.hpp>
00035 #include <syndication/ksyndication_export.h>
00036
00037 #include <QtCore/QString>
00038
00039 template <class T> class QList;
00040
00041 namespace Syndication {
00042 namespace RDF {
00043
00050 class SYNDICATION_EXPORT Model
00051 {
00052 friend class ::Syndication::RDF::Document;
00053 friend class ::Syndication::RDF::Document::Private;
00054 friend class ::Syndication::RDF::Resource;
00055 friend class ::Syndication::RDF::Resource::ResourcePrivate;
00056 friend class ::Syndication::RDF::Statement;
00057 friend class ::Syndication::RDF::Statement::StatementPrivate;
00058
00059 public:
00060
00065 Model();
00066
00075 Model(const Model& other);
00076
00080 virtual ~Model();
00081
00089 Model& operator=(const Model& other);
00090
00100 bool operator==(const Model& other) const;
00101
00111 virtual ResourcePtr createResource(const QString& uri=QString());
00112
00122 virtual PropertyPtr createProperty(const QString& uri);
00123
00133 virtual SequencePtr createSequence(const QString& uri=QString());
00134
00141 virtual LiteralPtr createLiteral(const QString& text);
00142
00152 virtual StatementPtr addStatement(ResourcePtr subject,
00153 PropertyPtr predicate,
00154 NodePtr object);
00155
00163 virtual void removeStatement(ResourcePtr subject,
00164 PropertyPtr predicate,
00165 NodePtr object);
00166
00172 virtual void removeStatement(StatementPtr statement);
00173
00177 virtual bool isEmpty() const;
00178
00185 virtual QList<ResourcePtr> resourcesWithType(ResourcePtr type) const;
00186
00191 virtual QList<StatementPtr> statements() const;
00192
00200 virtual NodePtr nodeByID(uint id) const;
00201
00209 virtual ResourcePtr resourceByID(uint id) const;
00210
00218 virtual PropertyPtr propertyByID(uint id) const;
00219
00227 virtual LiteralPtr literalByID(uint id) const;
00228
00233 virtual bool resourceHasProperty(const Resource* resource,
00234 PropertyPtr property) const;
00235
00240 virtual StatementPtr resourceProperty(const Resource* resource,
00241 PropertyPtr property) const;
00242
00247 virtual QList<StatementPtr> resourceProperties(const Resource* resource,
00248 PropertyPtr property) const;
00249
00250
00257 virtual QString debugInfo() const;
00258
00259 private:
00260 class ModelPrivate;
00261 boost::shared_ptr<ModelPrivate> d;
00262 };
00263
00264
00265 }
00266 }
00267
00268 #endif // SYNDICATION_RDF_MODEL_H