00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef CUBI_UPDATE_BASE_H
00032 #define CUBI_UPDATE_BASE_H
00033
00034 #include "filter.h"
00035 #include "function.h"
00036 #include "global.h"
00037 #include "patternbase.h"
00038 #include "resourcevalue.h"
00039
00040 CUBI_BEGIN_NAMESPACE
00041
00042 class UpdateBaseData;
00043
00044 class UpdateBase
00045 {
00046
00047 public:
00048 UpdateBase(const UpdateBase &other);
00049 UpdateBase& operator=(const UpdateBase &other);
00050 bool operator==(const UpdateBase &other) const;
00051 bool operator!=(const UpdateBase &other) const;
00052 ~UpdateBase();
00053
00054 enum Type {
00055 InsertUpdate,
00056 DeleteUpdate
00057 };
00058
00059 Type type() const;
00060
00061 void addData(const PatternBase &pattern);
00062 void addData(const Value &s, const Value &p, const Value &o);
00063 QList<PatternBase> data() const;
00064
00065
00066 void addRestriction(const PatternBase &pattern);
00067 void addRestriction(const Value &s, const Value &p, const Value &o);
00068 void addRestriction(const Value &s, const ValueChain &chain, const Value &o);
00069 QList<PatternBase> restrictions() const;
00070
00071 Filter filter() const;
00072 void setFilter(const Filter &filter);
00073
00074 QString sparql(Options::SparqlOptions options = Options::DefaultSparqlOptions) const;
00075
00076 protected:
00077 UpdateBase(const ResourceValue &graph = ResourceValue());
00078 UpdateBase(UpdateBaseData *data);
00079
00080 QSharedDataPointer<UpdateBaseData> d;
00081 };
00082
00083 CUBI_END_NAMESPACE
00084
00085 #endif