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/literal.h>
00026 #include <syndication/rdf/node.h>
00027 #include <syndication/rdf/property.h>
00028 #include <syndication/rdf/sequence.h>
00029 #include <syndication/rdf/statement.h>
00030 #include <boost/shared_ptr.hpp>
00031 #include <syndication/ksyndication_export.h>
00032
00033 #include <QtCore/QString>
00034
00035 template <class T> class QList;
00036
00037 namespace Syndication {
00038 namespace RDF {
00039
00046 class SYNDICATION_EXPORT Model
00047 {
00048 public:
00049
00054 Model();
00055
00064 Model(const Model& other);
00065
00069 virtual ~Model();
00070
00078 Model& operator=(const Model& other);
00079
00089 bool operator==(const Model& other) const;
00090
00100 virtual ResourcePtr createResource(const QString& uri=QString());
00101
00111 virtual PropertyPtr createProperty(const QString& uri);
00112
00122 virtual SequencePtr createSequence(const QString& uri=QString());
00123
00130 virtual LiteralPtr createLiteral(const QString& text);
00131
00141 virtual StatementPtr addStatement(ResourcePtr subject,
00142 PropertyPtr predicate,
00143 NodePtr object);
00144
00152 virtual void removeStatement(ResourcePtr subject,
00153 PropertyPtr predicate,
00154 NodePtr object);
00155
00161 virtual void removeStatement(StatementPtr statement);
00162
00166 virtual bool isEmpty() const;
00167
00174 virtual QList<ResourcePtr> resourcesWithType(ResourcePtr type) const;
00175
00180 virtual QList<StatementPtr> statements() const;
00181
00189 virtual NodePtr nodeByID(uint id) const;
00190
00198 virtual ResourcePtr resourceByID(uint id) const;
00199
00207 virtual PropertyPtr propertyByID(uint id) const;
00208
00216 virtual LiteralPtr literalByID(uint id) const;
00217
00222 virtual bool resourceHasProperty(const Resource* resource,
00223 PropertyPtr property) const;
00224
00229 virtual StatementPtr resourceProperty(const Resource* resource,
00230 PropertyPtr property) const;
00231
00236 virtual QList<StatementPtr> resourceProperties(const Resource* resource,
00237 PropertyPtr property) const;
00238
00239
00246 virtual QString debugInfo() const;
00247
00248 private:
00249 class ModelPrivate;
00250 boost::shared_ptr<ModelPrivate> d;
00251 };
00252
00253
00254 }
00255 }
00256
00257 #endif // SYNDICATION_RDF_MODEL_H