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 <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
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
00256 virtual QString debugInfo() const;
00257
00258 private:
00259 class ModelPrivate;
00260 boost::shared_ptr<ModelPrivate> d;
00261 };
00262
00263
00264 }
00265 }
00266
00267 #endif // SYNDICATION_RDF_MODEL_H