diff options
Diffstat (limited to 'raul/RDFWriter.h')
-rw-r--r-- | raul/RDFWriter.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/raul/RDFWriter.h b/raul/RDFWriter.h index fbd81a5..9a5d5b3 100644 --- a/raul/RDFWriter.h +++ b/raul/RDFWriter.h @@ -29,13 +29,16 @@ namespace Raul { class RdfId { public: - enum Type { ANONYMOUS, RESOURCE }; + enum Type { NULL_ID, ANONYMOUS, RESOURCE }; RdfId(Type t, const std::string& s) : _type(t), _string(s) {} + RdfId() : _type(NULL_ID) {} Type type() const { return _type; } const std::string& to_string() const { return _string; } + operator bool() { return (_type != NULL_ID); } + private: Type _type; std::string _string; ///< URI or blank node ID, depending on _type @@ -53,6 +56,8 @@ public: void start_to_string() throw (std::logic_error); std::string finish() throw (std::logic_error); + RdfId blank_id(); + bool serialization_in_progress() { return (_serializer != NULL); } void write(const RdfId& subject, @@ -69,6 +74,8 @@ private: raptor_serializer* _serializer; unsigned char* _string_output; Namespaces _prefixes; + + size_t _next_blank_id; }; |