00001
00002
00003
00004 #ifndef DEV_W3_ORG__2001_BLINDFOLD_SRC_TRIPLESINK_H
00005 #define DEV_W3_ORG__2001_BLINDFOLD_SRC_TRIPLESINK_H
00006 #include "config.h"
00007
00008 #include "Triple.h"
00009 class TripleSource;
00010
00021 class TripleSink {
00022
00023 public:
00024
00025
00026 TripleSink();
00027 TripleSink(const TripleSink& other);
00028 const TripleSink& operator=(const TripleSink& other);
00029 bool operator==(const TripleSink& other) const;
00030 bool operator<(const TripleSink& other) const;
00031 size_t hash() const;
00032 friend std::ostream& operator<<(std::ostream& s, const TripleSink& me);
00033 std::ostream& print_to(std::ostream& stream) const;
00034 virtual ~TripleSink();
00035
00036
00037
00041 void add(Symbol subject, Symbol predicate, Symbol object)
00042 {
00043 add(Triple(subject, predicate, object));
00044 }
00045
00049 virtual void add(Triple triple) = 0;
00050
00054 virtual VariableScope* getScope() const;
00055
00056 virtual void mUnion(const TripleSource& source);
00057
00058 private:
00059
00060 };
00061
00062
00063
00068 inline void addCCC(TripleSink* sink,
00069 const char* subject,
00070 const char* predicate ,
00071 const char* object)
00072 {
00073 sink->add(Symbol::constant(subject),
00074 Symbol::constant(predicate),
00075 Symbol::constant(object));
00076 }
00077
00078 #if 0
00079
00084 Symbol symbolFor(char *utf8_text, TripleSink* sink);
00085 Symbol symbolFor(char *utf8_text, char *end, TripleSink* sink);
00086 Symbol symbolFor(std::string utf8_text, TripleSink* sink);
00087 Symbol symbolForAnonymous(char *utf8_text, TripleSink* sink);
00088 Symbol symbolForAnonymous(char *utf8_text, SymbolSpace* space);
00089 #endif
00090
00091 STANDARD_EXTERNAL(TripleSink)
00092
00093 #endif