glibrdf

GLib wrapper for the Redland RDF library
git clone https://code.djc.id.au/git/glibrdf/
commit 37728add7668f57c661c5feb9c984f8d5716c8c5
parent 41b4fae3988d4a29d3189aeb36f1d16c922244ea
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sat, 21 Jul 2012 20:55:02 +1000

renamed to glibrdf

Diffstat:
A.gitignore | 2++
AMakefile | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Aglibrdf.c | 4++++
Aglibrdf.h | 10++++++++++
Aglibrdf.pc.in | 9+++++++++
Aglibrdf.vapi | 903+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Draptor.vapi | 106-------------------------------------------------------------------------------
Dredland.deps | 2--
Dredland.vapi | 819-------------------------------------------------------------------------------
9 files changed, 981 insertions(+), 927 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,2 @@
+/glibrdf.pc
+/libglibrdf.so*
diff --git a/Makefile b/Makefile
@@ -0,0 +1,53 @@
+
+PREFIX ?= /usr
+LIBDIR ?= $(PREFIX)/lib64
+INCLUDEDIR ?= $(PREFIX)/include
+VAPIDIR ?= $(PREFIX)/share/vala/vapi
+
+NAME = glibrdf
+MAJOR_VERSION = 0
+EXTRA_VERSION = .0.0
+SONAME = lib$(NAME).so.$(MAJOR_VERSION)
+LIB = $(SONAME)$(EXTRA_VERSION)
+REQUIRES = glib-2.0 gobject-2.0 raptor2 redland
+
+CC = gcc
+CFLAGS ?= -g -O -Wall
+CFLAGS += -fPIC -std=c99 $(shell pkg-config --cflags $(REQUIRES))
+LD = gcc
+LDFLAGS ?= -Wl,--as-needed -Wl,-O1
+LIBS = $(shell pkg-config --libs $(REQUIRES))
+
+OBJECTS = glibrdf.o
+
+.PHONY: all
+all: $(LIB) $(NAME).pc
+
+$(LIB): $(OBJECTS)
+	gcc -shared -Wl,-soname,$(SONAME) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+%.pc: %.pc.in
+	sed -e 's!@LIBDIR@!$(LIBDIR)!g' \
+	    -e 's!@INCLUDEDIR@!$(INCLUDEDIR)!g' \
+	    -e 's!@VERSION@!$(VERSION)!g' \
+	    -e 's!@REQUIRES@!$(REQUIRES)!g' \
+	    $< >$@
+
+glibrdf.o: glibrdf.h
+
+.PHONY: clean
+clean:
+	rm -f $(LIB) $(OBJECTS) $(NAME).pc
+
+.PHONY: install
+install:
+	install -m 0755 -d $(DESTDIR)$(VAPIDIR)
+	install -m 0644 $(NAME).vapi $(DESTDIR)$(VAPIDIR)
+	install -m 0755 -d $(DESTDIR)$(INCLUDEDIR)
+	install -m 0644 glibrdf.h $(DESTDIR)$(INCLUDEDIR)
+	install -m 0755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
+	install -m 0644 $(NAME).pc $(DESTDIR)$(LIBDIR)/pkgconfig
+	install -m 0755 -d $(DESTDIR)$(LIBDIR)
+	install -m 0755 $(LIB) $(DESTDIR)$(LIBDIR)
+	ldconfig -n $(DESTDIR)$(LIBDIR)
+	ln -s $(LIB) $(DESTDIR)$(LIBDIR)/lib$(NAME).so
diff --git a/glibrdf.c b/glibrdf.c
@@ -0,0 +1,4 @@
+
+#include "glibrdf.h"
+
+/* nothing here yet... */
diff --git a/glibrdf.h b/glibrdf.h
@@ -0,0 +1,10 @@
+
+#ifndef _GLIBRDF_H
+#define _GLIBRDF_H
+
+#include <glib-object.h>
+#include <librdf.h>
+
+/* nothing here yet... */
+
+#endif
diff --git a/glibrdf.pc.in b/glibrdf.pc.in
@@ -0,0 +1,9 @@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: glibrdf
+Description: GLib wrapper for Redland RDF library
+Requires: @REQUIRES@
+Version: @VERSION@
+Libs: -L${libdir} -lglibrdf
+Cflags: -I${includedir}
diff --git a/glibrdf.vapi b/glibrdf.vapi
@@ -0,0 +1,903 @@
+/*  glibrdf.vapi
+ *
+ *  Copyright 2012 Dan Callaghan <djc@djc.id.au>
+ *
+ *  Derived from:
+ *    redland.vapi
+ *      Copyright 2011 Sam Thursfield <ssssam@gmail.com>
+ *    raptor.vapi
+ *      Copyright (C) 2008  Nokia
+ *      Author: Jürg Billeter <j@bitron.ch>
+ *      Updated by Sam Thursfield 2011
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+using GLib;
+
+[CCode (cheader_filename = "librdf.h")]
+namespace Rdf {
+	/***************************************************************************
+	 * World
+	 */
+
+	[Compact]
+	[CCode (cname = "librdf_world", free_function = "librdf_free_world")]
+	public class World {
+		static const string FEATURE_GENID_BASE;
+		static const string FEATURE_GENID_COUNTER;
+
+		[CCode (cname = "librdf_new_world")]
+		public World();
+		[CCode (cname = "librdf_world_open")]
+		public void open();
+
+		/* Missing: set_rasqal, get_rasqal */
+
+		/* Missing: init_mutex (internal) */
+
+		[CCode (cname = "librdf_world_set_error")]
+		public void set_error ([CCode (delegate_target_pos = 0.9)] LogLevelFunc error_handler);
+		[CCode (cname = "librdf_world_set_warning")]
+		public void set_warning ([CCode (delegate_target_pos = 0.9)] LogLevelFunc warning_handler);
+		[CCode (cname = "librdf_world_set_logger")]
+		public void set_logger ([CCode (delegate_target_pos = 0.9)] LogFunc log_handler);
+		[CCode (cname = "librdf_world_set_digest")]
+		public void set_digest (string name);
+
+		[CCode (cname = "librdf_world_get_feature")]
+		public unowned Rdf.Node get_feature (Uri feature);
+		[CCode (cname = "librdf_world_set_feature")]
+		public unowned Rdf.Node set_feature (Uri feature, Node feature_value);
+
+		/* These have shorter names because we can't provide convenience
+		 * macros, unlike the C api
+		 */
+		[CCode (cname = "librdf_get_concept_resource_by_index")]
+		public unowned Node concept (Concept idx);
+		[CCode (cname = "librdf_get_concept_uri_by_index")]
+		public unowned Uri concept_uri (Concept idx);
+
+		[CCode (cname = "librdf_get_concept_ms_namespace")]
+		public unowned Uri ms_namespace ();
+		[CCode (cname = "librdf_get_concept_schema_namespace")]
+		public unowned Uri schema_namespace ();
+
+		/* Parser API, but in Vala's object model they make more sense here */
+		/*[CCode (cname = "librdf_parser_register_factory")]
+		public void register_parser_factory (string name, string label, string mime_type, string uri_string, ParserFactory factory);*/
+		[CCode (cname = "librdf_parser_enumerate")]
+		public bool enumerate_parser (uint counter, out unowned string name, out unowned string label);
+		[CCode (cname = "librdf_parser_check_name")]
+		public bool check_parser_name (string name);
+	}
+
+	/***************************************************************************
+	 * Concepts
+	 */
+
+	[CCode (cprefix="LIBRDF_CONCEPT_")]
+	public enum Concept {
+		MS_Alt,
+		MS_Bag,
+		MS_Property,
+		MS_Seq,
+		MS_Statement,
+		MS_object,
+		MS_predicate,
+		MS_subject,
+		MS_type,
+		MS_value,
+		MS_li,
+
+		MS_RDF,
+		MS_Description,
+
+		MS_aboutEach,
+		MS_aboutEachPrefix,
+
+		RS_nodeID,
+		RS_List,
+		RS_first,
+		RS_rest,
+		RS_nil,
+		RS_XMLLiteral,
+
+		/* RDF Schema concepts defined in prose at
+		*   http://www.w3.org/TR/2000/CR-rdf-schema-20000327/
+		* and in RDF Schema form at 
+		*   http://www.w3.org/2000/01/rdf-schema
+		*/
+		S_Class,
+		S_ConstraintProperty,
+		S_ConstraintResource,
+		S_Container,
+		S_ContainerMembershipProperty,
+		S_Literal,
+		S_Resource,
+		S_comment,
+		S_domain,
+		S_isDefinedBy,
+		S_label,
+		S_range,
+		S_seeAlso,
+		S_subClassOf,
+		S_subPropertyOf,
+
+		FIRST_S_ID,
+		LAST
+	}
+
+
+	/***************************************************************************
+	 * Iterator
+	 */
+
+	[Compact]
+	[CCode (cname = "librdf_iterator",
+	        free_function = "librdf_free_iterator")]
+	public class Iterator {
+		[Flags]
+		public enum GetMethod {
+			GET_OBJECT,
+			GET_CONTEXT,
+			GET_KEY,
+			GET_VALUE
+		}
+
+		[CCode (cname = "librdf_new_empty_iterator")]
+		public Iterator.empty (World world);
+
+		/*[CCode (cname = "librdf_iterator_map_handler")]
+		public Delegate void *MapHandler ([CCode delegate_target_pos = 1.9], Iterator iterator, void *item);*/
+		/* typedef void (*librdf_iterator_map_free_context_handler)(void *map_context); */
+
+		/* void librdf_new_iterator ((librdf_world *world, void *context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); */
+
+		[CCode (cname = "librdf_iterator_end")]
+		public bool end ();
+		[CCode (cname = "librdf_iterator_next")]
+		public int next ();
+		[CCode (cname = "librdf_iterator_get_object")]
+		public unowned Node get_object ();
+		[CCode (cname = "librdf_iterator_get_context")]
+		public unowned Node get_context ();
+		[CCode (cname = "librdf_iterator_get_key")]
+		public unowned void *get_key ();
+		[CCode (cname = "librdf_iterator_get_value")]
+		public unowned void *get_value ();
+
+		/*REDLAND_API
+		int librdf_iterator_add_map(librdf_iterator* iterator, librdf_iterator_map_handler map_function, librdf_iterator_map_free_context_handler free_context, void *map_context);*/
+	}
+
+
+	/***************************************************************************
+	 * Log
+	 */
+
+	[CCode (cprefix = "LIBRDF_LOG_", cname = "librdf_log_level")]
+	public enum LogLevel {
+		NONE,
+		DEBUG,
+		INFO,
+		WARN,
+		ERROR,
+		FATAL,
+		LAST
+	}
+
+	[CCode (cname = "LIBRDF_FROM_")]
+	public enum LogFacility {
+		CONCEPTS,
+		DIGEST,
+		FILES,
+		HASH,
+		INIT,
+		ITERATOR,
+		LIST,
+		MODEL,
+		NODE,
+		PARSER,
+		QUERY,
+		SERIALIZER,
+		STATEMENT,
+		STORAGE,
+		STREAM,
+		URI,
+		UTF8,
+		MEMORY,
+		NONE,
+		LAST
+	}
+
+	[Compact]
+	[CCode (cname = "librdf_log_message")]
+	public class LogMessage {
+		public int code;
+		public LogLevel level;
+		public LogFacility facility;
+		public string message;
+		public Raptor.Locator? locator;
+
+		[CCode (cname = "librdf_log_message_code")]
+		public int get_code ();
+		[CCode (cname = "librdf_log_message_level")]
+		public LogLevel get_level ();
+		[CCode (cname = "librdf_log_message_facility")]
+		public LogFacility get_facility ();
+		[CCode (cname = "librdf_log_message_message")]
+		public string get_message ();
+		[CCode (cname = "librdf_log_message_locator")]
+		public Raptor.Locator? get_locator ();
+	}
+
+	[CCode (cname = "librdf_log_level_func", instance_pos = 0)]
+	public delegate int LogLevelFunc (string message, va_list arguments);
+	[CCode (cname = "librdf_log_func", instance_pos = 0)]
+	public delegate int LogFunc (LogMessage message);
+
+	/***************************************************************************
+	 * Model (graph)
+	 */
+
+	/*REDLAND_API
+	int librdf_model_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label);*/
+
+	[Compact]
+	[CCode (cname = "librdf_model",
+	        copy_function = "librdf_new_model_from_model",
+	        free_function = "librdf_free_model")]
+	public class Model {
+		[CCode (cname = "librdf_new_model")]
+		public Model (World world, Storage storage, string? options_string);
+		/*[CCode (cname = "librdf_new_model_with_options")]
+		public Model.with_options (World world, Storage storage, Hash options);*/
+
+		[CCode (cname = "librdf_model_size")]
+		public int size ();
+
+		[CCode (cname = "librdf_model_add")]
+		public int add (Node subject, Node predicate, Node object);
+		[CCode (cname = "librdf_model_add_string_literal_statement")]
+		public int add_string_literal_statement (Node subject, Node predicate, string literal, string? xml_language, bool is_wf_xml);
+		[CCode (cname = "librdf_model_add_typed_literal_statement")]
+		public int add_typed_literal_statement (Node subject, Node predicate, string literal, string? xml_language, Uri datatype_uri);
+		[CCode (cname = "librdf_model_add_statement")]
+		public int add_statement (Statement statement);
+		[CCode (cname = "librdf_model_add_statements")]
+		public int add_statements (Stream statement_stream);
+
+		[CCode (cname = "librdf_model_remove_statement")]
+		public int remove_statement (Statement statement);
+
+		[CCode (cname = "librdf_model_contains_statement")]
+		public bool contains_statement (Statement statement);
+		[CCode (cname = "librdf_model_has_arc_in")]
+		public bool has_arc_in (Node node, Node property);
+		[Ccode (cname = "librdf_model_has_arc_out")]
+		public bool has_arc_out (Node node, Node property);
+
+		[CCode (cname = "librdf_model_as_stream")]
+		public Stream as_stream ();
+
+		[CCode (cname = "librdf_model_find_statements")]
+		public Stream? find_statements (Statement statement);
+
+		[CCode (cname = "LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL")]
+		public static const string FIND_OPTION_MATCH_SUBSTRICT_LITERAL;
+
+		/* [CCode (cname = "librdf_model_find_statements_with_options")]
+		public Stream? find_statements_with_options (Statement statement, Node context_node, Hash options); */
+
+		[CCode (cname = "librdf_model_get_sources")]
+		public Iterator? get_sources (Node arc, Node target);
+		[CCode (cname = "librdf_model_get_arcs")]
+		public Iterator? get_arcs (Node source, Node target);
+		[CCode (cname = "librdf_model_get_targets")]
+		public Iterator? get_targets (Node source, Node arc);
+		[CCode (cname = "librdf_model_get_source")]
+		public Node get_source (Node arc, Node target);
+		[CCode (cname = "librdf_model_get_arc")]
+		public Node get_arc (Node source, Node target);
+		[CCode (cname = "librdf_model_get_target")]
+		public Node get_target (Node source, Node arc);
+
+		[CCode (cname = "librdf_model_get_arcs_in")]
+		public Iterator? get_arcs_in (Node node);
+		[CCode (cname = "librdf_model_get_arcs_out")]
+		public Iterator? get_arcs_out (Node node);
+
+		/* From the manual: "FIXME: not tested"
+		[CCode (cname = "librdf_model_add_submodel")]
+		public int add_submodel (Model submodel);
+		[CCode (cname = "librdf_model_remove_submodel")]
+		public int remove_submodel (Model submodel);
+		*/
+
+		[CCode (cname = "librdf_model_print")]
+		public void print (FileStream file_stream);
+
+		[CCode (cname = "librdf_model_context_add_statement")]
+		public int context_add_statement (Node? context, Statement statement);
+		[CCode (cname = "librdf_model_context_add_statements")]
+		public int context_add_statements (Node? context, Stream stream);
+		[CCode (cname = "librdf_model_context_remove_statement")]
+		public int context_remove_statement (Node? context, Statement statement);
+		[CCode (cname = "librdf_model_context_remove_statements")]
+		public int context_remove_statements (Node context);
+
+		[CCode (cname = "librdf_model_context_as_stream")]
+		public Stream? context_as_stream (Node context);
+		[CCode (cname = "librdf_model_contains_context")]
+		public bool contains_context (Node context);
+
+		/* query language */
+		/*REDLAND_API
+		librdf_query_results* librdf_model_query_execute(librdf_model* model, librdf_query* query);*/
+
+		[CCode (cname = "librdf_model_sync")]
+		public int sync ();
+		[CCode (cname = "librdf_model_get_storage")]
+		public unowned Storage get_storage ();
+		[CCode (cname = "librdf_model_load")]
+		public int load (Uri uri, string? name, string? mime_type, Uri? type_uri);
+		/*[CCode (cname = "librdf_model_to_counted_string")]
+		public string to_counted_string (librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri, size_t* string_length_p);*/
+		[CCode (cname = "librdf_model_to_string")]
+		public string? to_string (Uri? uri, string? name, string? mime_type, Uri? type_uri);
+
+		[CCode (cname = "librdf_model_find_statements_in_context")]
+		public Stream? find_statements_in_context (Statement statement, Node context_node);
+
+		[CCode (cname = "librdf_model_get_contexts")]
+		public Iterator? get_contexts ();
+
+		[CCode (cname = "librdf_model_transaction_start")]
+		public int transaction_start ();
+		[CCode (cname = "librdf_model_transaction_start_with_handle")]
+		public int transaction_start_with_handle (void *handle);
+		[CCode (cname = "librdf_model_transaction_commit")]
+		public int transaction_commit ();
+		[CCode (cname = "librdf_model_transaction_rollback")]
+		public int transaction_rollback ();
+		[CCode (cname = "librdf_model_transaction_get_handle")]
+		public void *transaction_get_handle ();
+
+		[CCode (cname = "LIBRDF_MODEL_FEATURE_CONTEXTS")]
+		public static const string FEATURE_CONTEXTS;
+
+		[CCode (cname = "librdf_model_get_feature")]
+		public unowned Node? get_feature (Uri feature);
+		[CCode (cname = "librdf_model_set_feature")]
+		public int set_feature (Uri feature, Node feature_value);
+	}
+
+	/***************************************************************************
+	 * Node
+	 */
+
+	[CCode (cname = "librdf_node_type", cprefix = "LIBRDF_NODE_TYPE_")]
+	public enum NodeType {
+		UNKNOWN,
+		RESOURCE,
+		LITERAL,
+		BLANK,
+		LAST
+	}
+
+	[Compact]
+	[CCode (cname = "librdf_node",
+	        copy_function = "librdf_new_node_from_node",
+	        free_function = "librdf_free_node")]
+	public class Node {
+		[CCode (cname = "librdf_new_node")]
+		public Node (World world);
+		[CCode (cname = "librdf_new_node_from_node")]
+		public Node.from_node (Node node);
+		[CCode (cname = "librdf_new_node_from_blank_identifier")]
+		public Node.from_blank_identifier (World world, string? identifier);
+		[CCode (cname = "librdf_new_node_from_uri_string")]
+		public Node.from_uri_string (World world, string uri_string);
+		[CCode (cname = "librdf_new_node_from_uri")]
+		public Node.from_uri (World world, Uri uri);
+		[CCode (cname = "librdf_new_node_from_uri_local_name")]
+		public Node.from_uri_local_name (World world, Uri uri, string local_name);
+		[CCode (cname = "librdf_new_node_from_normalised_uri_string")]
+		public Node.from_normalised_uri_string (World world, string uri_string, Uri source_uri,
+		                                        Uri base_uri);
+		[CCode (cname = "librdf_new_node_from_literal")]
+		public Node.from_literal (World world, string literal_string, string? xml_language,
+		                          bool is_wf_xml);
+		[CCode (cname = "librdf_new_node_from_typed_literal")]
+		public Node.from_typed_literal (World world, string literal_value, string? xml_language,
+		                                Uri? datatype_uri);
+		/* Missing: (because all other 'counted' variants are)
+		[CCode (cname = "librdf_new_node_from_typed_counted_literal")]
+		public Node.from_typed_counted_literal (World world, string literal_value,
+		                                        size_t value_len, string xml_language,
+		                                        size_t xml_language_len, Uri datatype_uri); */
+
+		[CCode (cname = "librdf_node_get_uri")]
+		public unowned Uri? get_uri ();
+		[CCode (cname = "librdf_node_get_type")]
+		public NodeType get_type ();
+		[CCode (cname = "librdf_node_get_literal_value")]
+		public unowned string? get_literal_value ();  /* (as UTF8) */
+		/* Missing (as all 'counted' variants):
+		[CCode (cname = "librdf_node_get_literal_value_as_counted_string")]
+		public string get_literal_value_as_counted_string (out size_t len_p); */
+		[CCode (cname = "librdf_node_get_literal_value_as_latin1")]
+		public uint8[]? get_literal_value_as_latin1 ();
+		[CCode (cname = "librdf_node_get_literal_value_language")]
+		public uint8[]? get_literal_value_language ();  /* ASCII result */
+		[CCode (cname = "librdf_node_get_literal_value_is_wf_xml")]
+		public bool get_literal_value_is_wf_xml ();
+		[CCode (cname = "librdf_node_get_literal_value_datatype_uri")]
+		public unowned Uri? get_literal_value_datatype_uri ();
+
+		[CCode (cname = "librdf_node_get_li_ordinal")]
+		public int get_li_ordinal ();
+		[CCode (cname = "librdf_node_get_blank_identifier")]
+		public unowned string get_blank_indentifier ();
+
+		[CCode (cname = "librdf_node_is_resource")]
+		public bool is_resource ();
+		[CCode (cname = "librdf_node_is_literal")]
+		public bool is_literal ();
+		[CCode (cname = "librdf_node_is_blank")]
+		public bool is_blank ();
+
+		/* Missing:
+		REDLAND_API
+		size_t librdf_node_encode(librdf_node* node, unsigned char *buffer, size_t length);
+		REDLAND_API
+		librdf_node* librdf_node_decode(librdf_world *world, size_t* size_p, unsigned char *buffer, size_t length);
+		*/
+
+		[CCode (cname = "librdf_node_to_string")]
+		public string? to_string ();
+
+		/* Missing:
+		REDLAND_API
+		unsigned char* librdf_node_to_counted_string(librdf_node* node, size_t* len_p);
+		*/
+
+		[CCode (cname = "librdf_node_print")]
+		public void print (FileStream file_stream);
+
+		[CCode (cname = "librdf_node_equals")]
+		public bool equals (Node other);
+	}
+
+	/***************************************************************************
+	 * Parser
+	 */
+
+	[Compact]
+	[CCode (cname = "librdf_parser_factory")]
+	public class ParserFactory {
+	}
+
+	[Compact]
+	[CCode (cname = "librdf_parser", free_function="librdf_free_parser")]
+	public class Parser {
+		[CCode (cname = "LIBRDF_PARSER_FEATURE_ERROR_COUNT")]
+		public static const string FEATURE_ERROR_COUNT;
+		[CCode (cname = "LIBRDF_PARSER_FEATURE_WARNING_COUNT")]
+		public static const string FEATURE_WARNING_COUNT;
+
+		[CCode (cname = "librdf_parser_guess_name2")]
+		// FIXME: correct param types?
+		public static unowned string guess_name (World world, string? mime_type, uint8 *content, uint8 *identifier);
+
+		[CCode (cname = "librdf_new_parser")]
+		public Parser (World world, string? name, string? mime_type, Uri? type_uri);
+		[CCode (cname = "librdf_new_parser_from_factory")]
+		public Parser.from_factory (World world, ParserFactory factory);
+
+		[CCode (cname = "librdf_parser_parse_as_stream")]
+		public Stream parse_as_stream (Uri uri, Uri? base_uri);
+		[CCode (cname = "librdf_parser_parse_into_model")]
+		public int parse_into_model (Uri uri, Uri? base_uri, Model model);
+		[CCode (cname = "librdf_parser_parse_string_as_stream")]
+		public Stream parse_string_as_string (string data, Uri? base_uri);
+		[CCode (cname = "librdf_parser_parse_string_into_model")]
+		public int parse_string_into_model (string data, Uri? base_uri, Model model);
+		[CCode (cname = "librdf_parser_parse_file_handle_as_stream")]
+		public Stream parse_file_as_stream (FileStream file_stream, int close_fh, Uri? base_uri);
+		[CCode (cname = "librdf_parser_parse_file_handle_into_model")]
+		public int parse_file_stream_into_model (FileStream file_stream, int close_fh,
+		                                         Uri? base_uri, Model model);
+
+		/*REDLAND_API
+		librdf_stream* librdf_parser_parse_counted_string_as_stream(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri);
+		*/
+		/*REDLAND_API
+		int librdf_parser_parse_counted_string_into_model(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model* model);
+		*/
+
+		[CCode (cname = "librdf_parser_set_uri_filter")]
+		public void set_uri_filter ([CCode (delegate_target_pos = 1.1)] UriFilterFunc filter);
+		/*REDLAND_API
+		librdf_uri_filter_func librdf_parser_get_uri_filter(librdf_parser* parser, void** user_data_p);
+		*/
+
+		[CCode (cname = "librdf_parser_get_feature")]
+		public unowned Node? get_feature (Uri feature);
+		[CCode (cname = "librdf_parser_set_feature")]
+		public int set_feature (Uri feature, Node feature_value);
+		[CCode (cname = "librdf_parser_get_accept_header")]
+		public unowned string? get_accept_header ();
+
+		[CCode (cname = "librdf_parser_get_namespaces_seen_prefix")]
+		public unowned string? get_namespaces_seen_prefix (int namespace_index);
+		[CCode (cname = "librdf_parser_get_namespaces_seen_uri")]
+		public unowned Uri? get_namespaces_seen_uri (int namespace_index);
+		[CCode (cname = "librdf_parser_get_namespaces_seen_count")]
+		public int get_namespaces_seen_count ();
+	}
+
+	/***************************************************************************
+	 * Statement (triple)
+	 */
+
+	[Compact]
+	[CCode (cname = "librdf_statement",
+	        copy_function = "librdf_new_statement_from_statement",
+	        free_function = "librdf_free_statement")]
+	public class Statement {
+		public enum Part {
+			SUBJECT,
+			PREDICATE,
+			OBJECT,
+			ALL
+		}
+
+		[CCode (cname = "librdf_new_statement")]
+		public Statement (World world);
+		[CCode (cname = "librdf_new_statement_from_nodes")]
+		public Statement.from_nodes (World world, owned Node? subject, owned Node? predicate, owned Node? object);
+
+		/* Static allocation stuff .. 
+		REDLAND_API
+		void librdf_statement_init(librdf_world *world, librdf_statement *statement);
+		REDLAND_API
+		void librdf_statement_clear(librdf_statement *statement);*/
+
+		[CCode (cname = "librdf_statement_get_subject")]
+		public unowned Node get_subject ();
+		[CCode (cname = "librdf_statement_set_subject")]
+		public void set_subject (Node node);
+
+		[CCode (cname = "librdf_statement_get_predicate")]
+		public unowned Node get_predicate ();
+		[CCode (cname = "librdf_statement_set_predicate")]
+		public void set_predicate (Node node);
+
+		[CCode (cname = "librdf_statement_get_object")]
+		public unowned Node get_object ();
+		[CCode (cname = "librdf_statement_set_object")]
+		public void set_object (Node node);
+
+		[CCode (cname = "librdf_statement_is_complete")]
+		public bool is_complete ();
+
+		/*REDLAND_API
+		unsigned char *librdf_statement_to_string(librdf_statement *statement);*/
+		[CCode (cname = "librdf_statement_print")]
+		public void print (FileStream file_stream);
+
+		[CCode (cname = "librdf_statement_equals")]
+		public int equals (Statement other);
+		[CCode (cname = "librdf_statement_match")]
+		public int match (Statement other);
+
+		/*REDLAND_API
+		size_t librdf_statement_encode(librdf_statement* statement, unsigned char *buffer, size_t length);
+		REDLAND_API
+		size_t librdf_statement_encode_parts(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields);
+		REDLAND_API
+		size_t librdf_statement_decode(librdf_statement* statement, unsigned char *buffer, size_t length);
+		REDLAND_API
+		size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length);*/
+	}
+
+	/***************************************************************************
+	 * Storage
+	 */
+
+	/*REDLAND_API
+	int librdf_storage_register_factory(librdf_world *world, const char *name, const char *label, void (*factory) (librdf_storage_factory*));*/
+
+	/*REDLAND_API
+	int librdf_storage_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label);*/
+
+	[Compact]
+	[CCode (cname = "librdf_storage",
+	        copy_function = "librdf_new_storage_from_storage",
+	        free_function = "librdf_free_storage")]
+	public class Storage {
+		[CCode (cname = "librdf_new_storage")]
+		public Storage (World world, string? storage_name, string? name, string? options_string);
+		/*[CCode (cname = "librdf_new_storage_with_options")]
+		public Storage (World world, string storage_name, string name, Hash options);*/
+		/*REDLAND_API
+		librdf_storage* librdf_new_storage_from_factory(librdf_world *world, librdf_storage_factory* factory, const char *name, librdf_hash* options);*/
+
+		/* "Indended to be internal to librdf storage modules"
+		REDLAND_API
+		void librdf_storage_add_reference(librdf_storage *storage);
+		REDLAND_API
+		void librdf_storage_remove_reference(librdf_storage *storage); 
+
+		REDLAND_API
+		void librdf_storage_set_instance(librdf_storage *storage, librdf_storage_instance instance);
+		REDLAND_API
+		librdf_storage_instance librdf_storage_get_instance(librdf_storage *storage);*/
+
+		[CCode (cname = "librdf_storage_get_world")]
+		public unowned World get_world ();
+
+		[CCode (cname = "librdf_storage_open")]
+		public int open (Model model);
+		[CCode (cname = "librdf_storage_close")]
+		public int close ();
+
+		[CCode (cname = "librdf_storage_size")]
+		public int size ();
+
+		[CCode (cname = "librdf_storage_add_statement")]
+		public int add_statement (Statement statement);
+		/*[CCode (cname = "librdf_storage_add_statements")]
+		public int add_statements (Stream statement_stream);*/
+		[CCode (cname = "librdf_storage_remove_statement")]
+		public int remove_statement (Statement statement);
+		[CCode (cname = "librdf_storage_contains_statement")]
+		public bool contains_statement (Statement statement);
+
+		/*REDLAND_API
+		librdf_stream* librdf_storage_serialise(librdf_storage* storage);
+		REDLAND_API
+		librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement);
+		REDLAND_API
+		librdf_stream* librdf_storage_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options);
+		REDLAND_API
+		librdf_iterator* librdf_storage_get_sources(librdf_storage *storage, librdf_node *arc, librdf_node *target);
+		REDLAND_API
+		librdf_iterator* librdf_storage_get_arcs(librdf_storage *storage, librdf_node *source, librdf_node *target);
+		REDLAND_API
+		librdf_iterator* librdf_storage_get_targets(librdf_storage *storage, librdf_node *source, librdf_node *arc);*/
+
+		/*REDLAND_API
+		librdf_iterator* librdf_storage_get_arcs_in(librdf_storage *storage, librdf_node *node);
+		REDLAND_API
+		librdf_iterator* librdf_storage_get_arcs_out(librdf_storage *storage, librdf_node *node);*/
+
+		[CCode (cname = "librdf_storage_has_arc_in")]
+		public int has_arc_in (Node node, Node property);
+		[CCode (cname = "librdf_storage_has_arc_out")]
+		public int has_arc_out (Node node, Node property);
+
+		[CCode (cname = "librdf_storage_context_add_statement")]
+		public int context_add_statement (Node context, Statement statement);
+		/*[CCode (cname = "librdf_storage_context_add_statements")]
+		public int context_add_statements (Node context, Stream stream);*/
+		[CCode (cname = "librdf_storage_context_remove_statement")]
+		public int context_remove_statement (Node context, Statement statement);
+		[CCode (cname = "librdf_storage_context_remove_statements")]
+		public int context_remove_statements (Node context);
+		/*REDLAND_API
+		librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context);
+		REDLAND_API REDLAND_DEPRECATED
+		librdf_stream* librdf_storage_context_serialise(librdf_storage* storage, librdf_node* context);*/
+  
+		/*REDLAND_API
+		int librdf_storage_supports_query(librdf_storage* storage, librdf_query *query);
+		REDLAND_API
+		librdf_query_results* librdf_storage_query_execute(librdf_storage* storage, librdf_query *query);*/
+
+		[CCode (cname = "librdf_storage_sync")]
+		public int sync ();
+
+		/*REDLAND_API
+		librdf_stream* librdf_storage_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node);
+
+		REDLAND_API
+		librdf_iterator* librdf_storage_get_contexts(librdf_storage* storage);*/
+
+		[CCode (cname = "librdf_storage_get_feature")]
+		public unowned Node? get_feature (Uri feature);
+		[CCode (cname = "librdf_storage_set_feature")]
+		public int set_feature (Uri feature, Node feature_value);
+
+		[CCode (cname = "librdf_storage_transaction_start")]
+		public int transaction_start ();
+		[CCode (cname = "librdf_storage_transaction_start_with_handle")]
+		public int transaction_start_with_handle (void *handle);
+		[CCode (cname = "librdf_storage_transaction_commit")]
+		public int transaction_commit ();
+		[CCode (cname = "librdf_storage_transaction_rollback")]
+		public int transaction_rollback ();
+		[CCode (cname = "librdf_storage_transaction_get_handle")]
+		public void *transaction_get_handle ();
+	}
+
+	/***************************************************************************
+	 * Stream
+	 */
+
+	/* typedef librdf_statement* (*librdf_stream_map_handler)(librdf_stream *stream, void *map_context, librdf_statement *item); */
+	/* typedef void (*librdf_stream_map_free_context_handler)(void *map_context); */
+
+	[Compact]
+	[CCode (cname = "librdf_stream",
+	        free_function = "librdf_free_stream")]
+	public class Stream {
+		[Flags]
+		[CCode (cprefix="LIBRDF_STREAM_GET_METHOD")]
+		public enum GetMethod {
+			GET_OBJECT,
+			GET_CONTEXT
+		}
+
+		/* REDLAND_API
+		librdf_stream* librdf_new_stream(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); */
+		[CCode (cname = "librdf_new_empty_stream")]
+		public Stream.empty (World world);
+		[CCode (cname = "librdf_new_stream_from_node_iterator")]
+		public Stream.from_node_iterator (Iterator iterator, Statement statement, Statement.Part field);
+
+		[CCode (cname = "librdf_stream_end")]
+		public bool end ();
+		[CCode (cname = "librdf_stream_next")]
+		public int next ();
+		[CCode (cname = "librdf_stream_get_object")]
+		public unowned Statement get_object ();
+		[CCode (cname = "librdf_stream_get_context")]
+		public void *get_context ();
+
+		/*REDLAND_API
+		int librdf_stream_add_map(librdf_stream* stream, librdf_stream_map_handler map_function, librdf_stream_map_free_context_handler free_context, void *map_context);*/
+
+		[CCode (cname = "librdf_stream_print")]
+		public void print (FileStream file_stream);
+	}
+
+	/***************************************************************************
+	 * Uri
+	 */
+
+	[CCode (cname = "librdf_uri_filter_func", instance_pos = 0)]
+	public delegate int UriFilterFunc (Uri uri);
+
+	[Compact]
+	[CCode (cname = "librdf_uri",
+	        copy_function = "librdf_new_uri_from_uri",
+	        free_function = "librdf_free_uri")]
+	public class Uri {
+		[CCode (cname = "librdf_new_uri")]
+		public Uri (World world, string uri_string);
+		[CCode (cname = "librdf_new_uri_from_uri")]
+		public Uri.from_uri (Uri old_uri);
+		[CCode (cname = "librdf_new_uri_from_uri_local_name")]
+		public Uri.from_uri_local_name (Uri old_uri, string local_name);
+		[CCode (cname = "librdf_new_uri_normalised_to_base")]
+		public Uri.normalised_to_base (string uri_string, Uri source_uri, Uri base_uri);
+		[CCode (cname = "librdf_new_uri_relative_to_base")]
+		public Uri.relative_to_base (Uri base_uri, string uri_string);
+		[CCode (cname = "librdf_new_uri_from_filename")]
+		public Uri.from_filename (World world, string filename);
+
+		/* FIXME: only present due to vala not using the free_function correctly */
+		[CCode (cname = "librdf_free_uri")]
+		public void free ();
+
+		[CCode (cname = "librdf_uri_as_string")]
+		public unowned string as_string();
+		/*[CCode (cname = "librdf_uri_as_counted_string")] (librdf_uri *uri, size_t *len_p); */
+		[CCode (cname = "librdf_uri_print")]
+		public void print (FileStream file_stream);
+		[CCode (cname = "librdf_uri_to_string")]
+		public string to_string ();
+		/*REDLAND_API
+		unsigned char* librdf_uri_to_counted_string (librdf_uri* uri, size_t* len_p);*/
+
+		[CCode (cname = "librdf_uri_equals")]
+		public bool equals (Uri other);
+		[CCode (cname = "librdf_uri_compare")]
+		public int compare (Uri other);
+		[CCode (cname = "librdf_uri_is_file_uri")]
+		public bool is_file_uri ();
+		[CCode (cname = "librdf_uri_to_filename")]
+		public string to_filename ();
+	}
+}
+
+[CCode (cheader_filename = "raptor.h")]
+namespace Raptor {
+	public enum IdentifierType {
+		RESOURCE,
+		ANONYMOUS,
+		PREDICATE,
+		ORDINAL,
+		LITERAL,
+		XML_LITERAL
+	}
+
+	[CCode (cname = "raptor_locator")]
+	public struct Locator {
+		public Raptor.Uri uri;
+		public string file;
+		public int line;
+		public int column;
+		public int byte;
+	}
+
+	extern void init ();
+
+	[Compact]
+	[CCode (cname = "raptor_parser", free_function = "raptor_free_parser")]
+	public class Parser {
+		[CCode (cname = "raptor_new_parser")]
+		public Parser (string name);
+		[CCode (cname = "raptor_set_statement_handler")]
+		public void set_statement_handler ([CCode (delegate_target_pos = 0.9)] StatementHandler handler);
+		[CCode (cname = "raptor_parse_file")]
+		public void parse_file (Uri? uri, Uri? base_uri);
+		[CCode (cname = "raptor_start_parse")]
+		public void start_parse (Uri uri);
+	}
+
+	[Compact]
+	[CCode (cname = "void")]
+	public class Term {
+		[CCode (cname = "raptor_statement_part_as_string")]
+		public string part_as_string (IdentifierType type, Uri? literal_datatype,
+		                              string? literal_language);
+	}
+
+	[Compact]
+	[CCode (cname = "raptor_statement")]
+	public class Statement {
+		public Term subject;
+		public IdentifierType subject_type;
+		public Term predicate;
+		public IdentifierType predicate_type;
+		public Term object;
+		public IdentifierType object_type;
+		public Uri? object_literal_datatype;
+		public string? object_literal_language;
+
+		[CCode (cname = "raptor_statement_compare")]
+		public int compare (Statement other);
+
+		[CCode (cname = "raptor_print_statement")]
+		public void print (FileStream stream);
+		[CCode (cname = "raptor_print_statement_as_ntriples")]
+		public void print_as_ntriples (FileStream stream);
+	}
+
+	[CCode (cname = "raptor_statement_handler", instance_pos = 0)]
+	public delegate void StatementHandler (Statement statement);
+
+	[Compact]
+	[CCode (cname = "raptor_uri", free_function = "raptor_free_uri")]
+	public class Uri {
+		[CCode (cname = "raptor_new_uri")]
+		public Uri (string uri_string);
+		public static string filename_to_uri_string (string filename);
+		public unowned string as_string ();
+	}
+}
diff --git a/raptor.vapi b/raptor.vapi
@@ -1,106 +0,0 @@
-/* raptor.vapi
- *
- * Copyright (C) 2008  Nokia
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- * 	Jürg Billeter <j@bitron.ch>
- */
-
-/* Valid for Raptor 1.4 */
-
-/* Updated by Sam Thursfield 2011
- * FIXME: merge this back into Vala, and maybe make it a bit more complete */
-
-using GLib;
-
-[CCode (cheader_filename = "raptor.h")]
-namespace Raptor {
-	public enum IdentifierType {
-		RESOURCE,
-		ANONYMOUS,
-		PREDICATE,
-		ORDINAL,
-		LITERAL,
-		XML_LITERAL
-	}
-
-	[CCode (cname = "raptor_locator")]
-	public struct Locator {
-		public Raptor.Uri uri;
-		public string file;
-		public int line;
-		public int column;
-		public int byte;
-	}
-
-	extern void init ();
-
-	[Compact]
-	[CCode (cname = "raptor_parser", free_function = "raptor_free_parser")]
-	public class Parser {
-		[CCode (cname = "raptor_new_parser")]
-		public Parser (string name);
-		[CCode (cname = "raptor_set_statement_handler")]
-		public void set_statement_handler ([CCode (delegate_target_pos = 0.9)] StatementHandler handler);
-		[CCode (cname = "raptor_parse_file")]
-		public void parse_file (Uri? uri, Uri? base_uri);
-		[CCode (cname = "raptor_start_parse")]
-		public void start_parse (Uri uri);
-	}
-
-	[Compact]
-	[CCode (cname = "void")]
-	public class Term {
-		[CCode (cname = "raptor_statement_part_as_string")]
-		public string part_as_string (IdentifierType type, Uri? literal_datatype,
-		                              string? literal_language);
-	}
-
-	[Compact]
-	[CCode (cname = "raptor_statement")]
-	public class Statement {
-		public Term subject;
-		public IdentifierType subject_type;
-		public Term predicate;
-		public IdentifierType predicate_type;
-		public Term object;
-		public IdentifierType object_type;
-		public Uri? object_literal_datatype;
-		public string? object_literal_language;
-
-		[CCode (cname = "raptor_statement_compare")]
-		public int compare (Statement other);
-
-		[CCode (cname = "raptor_print_statement")]
-		public void print (FileStream stream);
-		[CCode (cname = "raptor_print_statement_as_ntriples")]
-		public void print_as_ntriples (FileStream stream);
-	}
-
-	[CCode (cname = "raptor_statement_handler", instance_pos = 0)]
-	public delegate void StatementHandler (Statement statement);
-
-	[Compact]
-	[CCode (cname = "raptor_uri", free_function = "raptor_free_uri")]
-	public class Uri {
-		[CCode (cname = "raptor_new_uri")]
-		public Uri (string uri_string);
-		public static string filename_to_uri_string (string filename);
-		public unowned string as_string ();
-	}
-}
-
diff --git a/redland.deps b/redland.deps
@@ -1 +0,0 @@
-raptor
-\ No newline at end of file
diff --git a/redland.vapi b/redland.vapi
@@ -1,818 +0,0 @@
-/*  redland.vapi
- *
- *  Copyright 2011 Sam Thursfield <ssssam@gmail.com>
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-using GLib;
-
-[CCode (cheader_filename = "librdf.h")]
-namespace Rdf {
-	/***************************************************************************
-	 * World
-	 */
-
-	[Compact]
-	[CCode (cname = "librdf_world", free_function = "librdf_free_world")]
-	public class World {
-		static const string FEATURE_GENID_BASE;
-		static const string FEATURE_GENID_COUNTER;
-
-		[CCode (cname = "librdf_new_world")]
-		public World();
-		[CCode (cname = "librdf_world_open")]
-		public void open();
-
-		/* Missing: set_rasqal, get_rasqal */
-
-		/* Missing: init_mutex (internal) */
-
-		[CCode (cname = "librdf_world_set_error")]
-		public void set_error ([CCode (delegate_target_pos = 0.9)] LogLevelFunc error_handler);
-		[CCode (cname = "librdf_world_set_warning")]
-		public void set_warning ([CCode (delegate_target_pos = 0.9)] LogLevelFunc warning_handler);
-		[CCode (cname = "librdf_world_set_logger")]
-		public void set_logger ([CCode (delegate_target_pos = 0.9)] LogFunc log_handler);
-		[CCode (cname = "librdf_world_set_digest")]
-		public void set_digest (string name);
-
-		[CCode (cname = "librdf_world_get_feature")]
-		public unowned Rdf.Node get_feature (Uri feature);
-		[CCode (cname = "librdf_world_set_feature")]
-		public unowned Rdf.Node set_feature (Uri feature, Node feature_value);
-
-		/* These have shorter names because we can't provide convenience
-		 * macros, unlike the C api
-		 */
-		[CCode (cname = "librdf_get_concept_resource_by_index")]
-		public unowned Node concept (Concept idx);
-		[CCode (cname = "librdf_get_concept_uri_by_index")]
-		public unowned Uri concept_uri (Concept idx);
-
-		[CCode (cname = "librdf_get_concept_ms_namespace")]
-		public unowned Uri ms_namespace ();
-		[CCode (cname = "librdf_get_concept_schema_namespace")]
-		public unowned Uri schema_namespace ();
-
-		/* Parser API, but in Vala's object model they make more sense here */
-		/*[CCode (cname = "librdf_parser_register_factory")]
-		public void register_parser_factory (string name, string label, string mime_type, string uri_string, ParserFactory factory);*/
-		[CCode (cname = "librdf_parser_enumerate")]
-		public bool enumerate_parser (uint counter, out unowned string name, out unowned string label);
-		[CCode (cname = "librdf_parser_check_name")]
-		public bool check_parser_name (string name);
-	}
-
-	/***************************************************************************
-	 * Concepts
-	 */
-
-	[CCode (cprefix="LIBRDF_CONCEPT_")]
-	public enum Concept {
-		MS_Alt,
-		MS_Bag,
-		MS_Property,
-		MS_Seq,
-		MS_Statement,
-		MS_object,
-		MS_predicate,
-		MS_subject,
-		MS_type,
-		MS_value,
-		MS_li,
-
-		MS_RDF,
-		MS_Description,
-
-		MS_aboutEach,
-		MS_aboutEachPrefix,
-
-		RS_nodeID,
-		RS_List,
-		RS_first,
-		RS_rest,
-		RS_nil,
-		RS_XMLLiteral,
-
-		/* RDF Schema concepts defined in prose at
-		*   http://www.w3.org/TR/2000/CR-rdf-schema-20000327/
-		* and in RDF Schema form at 
-		*   http://www.w3.org/2000/01/rdf-schema
-		*/
-		S_Class,
-		S_ConstraintProperty,
-		S_ConstraintResource,
-		S_Container,
-		S_ContainerMembershipProperty,
-		S_Literal,
-		S_Resource,
-		S_comment,
-		S_domain,
-		S_isDefinedBy,
-		S_label,
-		S_range,
-		S_seeAlso,
-		S_subClassOf,
-		S_subPropertyOf,
-
-		FIRST_S_ID,
-		LAST
-	}
-
-
-	/***************************************************************************
-	 * Iterator
-	 */
-
-	[Compact]
-	[CCode (cname = "librdf_iterator",
-	        free_function = "librdf_free_iterator")]
-	public class Iterator {
-		[Flags]
-		public enum GetMethod {
-			GET_OBJECT,
-			GET_CONTEXT,
-			GET_KEY,
-			GET_VALUE
-		}
-
-		[CCode (cname = "librdf_new_empty_iterator")]
-		public Iterator.empty (World world);
-
-		/*[CCode (cname = "librdf_iterator_map_handler")]
-		public Delegate void *MapHandler ([CCode delegate_target_pos = 1.9], Iterator iterator, void *item);*/
-		/* typedef void (*librdf_iterator_map_free_context_handler)(void *map_context); */
-
-		/* void librdf_new_iterator ((librdf_world *world, void *context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); */
-
-		[CCode (cname = "librdf_iterator_end")]
-		public bool end ();
-		[CCode (cname = "librdf_iterator_next")]
-		public int next ();
-		[CCode (cname = "librdf_iterator_get_object")]
-		public unowned Node get_object ();
-		[CCode (cname = "librdf_iterator_get_context")]
-		public unowned Node get_context ();
-		[CCode (cname = "librdf_iterator_get_key")]
-		public unowned void *get_key ();
-		[CCode (cname = "librdf_iterator_get_value")]
-		public unowned void *get_value ();
-
-		/*REDLAND_API
-		int librdf_iterator_add_map(librdf_iterator* iterator, librdf_iterator_map_handler map_function, librdf_iterator_map_free_context_handler free_context, void *map_context);*/
-	}
-
-
-	/***************************************************************************
-	 * Log
-	 */
-
-	[CCode (cprefix = "LIBRDF_LOG_", cname = "librdf_log_level")]
-	public enum LogLevel {
-		NONE,
-		DEBUG,
-		INFO,
-		WARN,
-		ERROR,
-		FATAL,
-		LAST
-	}
-
-	[CCode (cname = "LIBRDF_FROM_")]
-	public enum LogFacility {
-		CONCEPTS,
-		DIGEST,
-		FILES,
-		HASH,
-		INIT,
-		ITERATOR,
-		LIST,
-		MODEL,
-		NODE,
-		PARSER,
-		QUERY,
-		SERIALIZER,
-		STATEMENT,
-		STORAGE,
-		STREAM,
-		URI,
-		UTF8,
-		MEMORY,
-		NONE,
-		LAST
-	}
-
-	[Compact]
-	[CCode (cname = "librdf_log_message")]
-	public class LogMessage {
-		public int code;
-		public LogLevel level;
-		public LogFacility facility;
-		public string message;
-		public Raptor.Locator? locator;
-
-		[CCode (cname = "librdf_log_message_code")]
-		public int get_code ();
-		[CCode (cname = "librdf_log_message_level")]
-		public LogLevel get_level ();
-		[CCode (cname = "librdf_log_message_facility")]
-		public LogFacility get_facility ();
-		[CCode (cname = "librdf_log_message_message")]
-		public string get_message ();
-		[CCode (cname = "librdf_log_message_locator")]
-		public Raptor.Locator? get_locator ();
-	}
-
-	[CCode (cname = "librdf_log_level_func", instance_pos = 0)]
-	public delegate int LogLevelFunc (string message, va_list arguments);
-	[CCode (cname = "librdf_log_func", instance_pos = 0)]
-	public delegate int LogFunc (LogMessage message);
-
-	/***************************************************************************
-	 * Model (graph)
-	 */
-
-	/*REDLAND_API
-	int librdf_model_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label);*/
-
-	[Compact]
-	[CCode (cname = "librdf_model",
-	        copy_function = "librdf_new_model_from_model",
-	        free_function = "librdf_free_model")]
-	public class Model {
-		[CCode (cname = "librdf_new_model")]
-		public Model (World world, Storage storage, string? options_string);
-		/*[CCode (cname = "librdf_new_model_with_options")]
-		public Model.with_options (World world, Storage storage, Hash options);*/
-
-		[CCode (cname = "librdf_model_size")]
-		public int size ();
-
-		[CCode (cname = "librdf_model_add")]
-		public int add (Node subject, Node predicate, Node object);
-		[CCode (cname = "librdf_model_add_string_literal_statement")]
-		public int add_string_literal_statement (Node subject, Node predicate, string literal, string? xml_language, bool is_wf_xml);
-		[CCode (cname = "librdf_model_add_typed_literal_statement")]
-		public int add_typed_literal_statement (Node subject, Node predicate, string literal, string? xml_language, Uri datatype_uri);
-		[CCode (cname = "librdf_model_add_statement")]
-		public int add_statement (Statement statement);
-		[CCode (cname = "librdf_model_add_statements")]
-		public int add_statements (Stream statement_stream);
-
-		[CCode (cname = "librdf_model_remove_statement")]
-		public int remove_statement (Statement statement);
-
-		[CCode (cname = "librdf_model_contains_statement")]
-		public bool contains_statement (Statement statement);
-		[CCode (cname = "librdf_model_has_arc_in")]
-		public bool has_arc_in (Node node, Node property);
-		[Ccode (cname = "librdf_model_has_arc_out")]
-		public bool has_arc_out (Node node, Node property);
-
-		[CCode (cname = "librdf_model_as_stream")]
-		public Stream as_stream ();
-
-		[CCode (cname = "librdf_model_find_statements")]
-		public Stream? find_statements (Statement statement);
-
-		[CCode (cname = "LIBRDF_MODEL_FIND_OPTION_MATCH_SUBSTRING_LITERAL")]
-		public static const string FIND_OPTION_MATCH_SUBSTRICT_LITERAL;
-
-		/* [CCode (cname = "librdf_model_find_statements_with_options")]
-		public Stream? find_statements_with_options (Statement statement, Node context_node, Hash options); */
-
-		[CCode (cname = "librdf_model_get_sources")]
-		public Iterator? get_sources (Node arc, Node target);
-		[CCode (cname = "librdf_model_get_arcs")]
-		public Iterator? get_arcs (Node source, Node target);
-		[CCode (cname = "librdf_model_get_targets")]
-		public Iterator? get_targets (Node source, Node arc);
-		[CCode (cname = "librdf_model_get_source")]
-		public Node get_source (Node arc, Node target);
-		[CCode (cname = "librdf_model_get_arc")]
-		public Node get_arc (Node source, Node target);
-		[CCode (cname = "librdf_model_get_target")]
-		public Node get_target (Node source, Node arc);
-
-		[CCode (cname = "librdf_model_get_arcs_in")]
-		public Iterator? get_arcs_in (Node node);
-		[CCode (cname = "librdf_model_get_arcs_out")]
-		public Iterator? get_arcs_out (Node node);
-
-		/* From the manual: "FIXME: not tested"
-		[CCode (cname = "librdf_model_add_submodel")]
-		public int add_submodel (Model submodel);
-		[CCode (cname = "librdf_model_remove_submodel")]
-		public int remove_submodel (Model submodel);
-		*/
-
-		[CCode (cname = "librdf_model_print")]
-		public void print (FileStream file_stream);
-
-		[CCode (cname = "librdf_model_context_add_statement")]
-		public int context_add_statement (Node? context, Statement statement);
-		[CCode (cname = "librdf_model_context_add_statements")]
-		public int context_add_statements (Node? context, Stream stream);
-		[CCode (cname = "librdf_model_context_remove_statement")]
-		public int context_remove_statement (Node? context, Statement statement);
-		[CCode (cname = "librdf_model_context_remove_statements")]
-		public int context_remove_statements (Node context);
-
-		[CCode (cname = "librdf_model_context_as_stream")]
-		public Stream? context_as_stream (Node context);
-		[CCode (cname = "librdf_model_contains_context")]
-		public bool contains_context (Node context);
-
-		/* query language */
-		/*REDLAND_API
-		librdf_query_results* librdf_model_query_execute(librdf_model* model, librdf_query* query);*/
-
-		[CCode (cname = "librdf_model_sync")]
-		public int sync ();
-		[CCode (cname = "librdf_model_get_storage")]
-		public unowned Storage get_storage ();
-		[CCode (cname = "librdf_model_load")]
-		public int load (Uri uri, string? name, string? mime_type, Uri? type_uri);
-		/*[CCode (cname = "librdf_model_to_counted_string")]
-		public string to_counted_string (librdf_model* model, librdf_uri *uri, const char *name, const char *mime_type, librdf_uri *type_uri, size_t* string_length_p);*/
-		[CCode (cname = "librdf_model_to_string")]
-		public string? to_string (Uri? uri, string? name, string? mime_type, Uri? type_uri);
-
-		[CCode (cname = "librdf_model_find_statements_in_context")]
-		public Stream? find_statements_in_context (Statement statement, Node context_node);
-
-		[CCode (cname = "librdf_model_get_contexts")]
-		public Iterator? get_contexts ();
-
-		[CCode (cname = "librdf_model_transaction_start")]
-		public int transaction_start ();
-		[CCode (cname = "librdf_model_transaction_start_with_handle")]
-		public int transaction_start_with_handle (void *handle);
-		[CCode (cname = "librdf_model_transaction_commit")]
-		public int transaction_commit ();
-		[CCode (cname = "librdf_model_transaction_rollback")]
-		public int transaction_rollback ();
-		[CCode (cname = "librdf_model_transaction_get_handle")]
-		public void *transaction_get_handle ();
-
-		[CCode (cname = "LIBRDF_MODEL_FEATURE_CONTEXTS")]
-		public static const string FEATURE_CONTEXTS;
-
-		[CCode (cname = "librdf_model_get_feature")]
-		public unowned Node? get_feature (Uri feature);
-		[CCode (cname = "librdf_model_set_feature")]
-		public int set_feature (Uri feature, Node feature_value);
-	}
-
-	/***************************************************************************
-	 * Node
-	 */
-
-	[CCode (cname = "librdf_node_type", cprefix = "LIBRDF_NODE_TYPE_")]
-	public enum NodeType {
-		UNKNOWN,
-		RESOURCE,
-		LITERAL,
-		BLANK,
-		LAST
-	}
-
-	[Compact]
-	[CCode (cname = "librdf_node",
-	        copy_function = "librdf_new_node_from_node",
-	        free_function = "librdf_free_node")]
-	public class Node {
-		[CCode (cname = "librdf_new_node")]
-		public Node (World world);
-		[CCode (cname = "librdf_new_node_from_node")]
-		public Node.from_node (Node node);
-		[CCode (cname = "librdf_new_node_from_blank_identifier")]
-		public Node.from_blank_identifier (World world, string? identifier);
-		[CCode (cname = "librdf_new_node_from_uri_string")]
-		public Node.from_uri_string (World world, string uri_string);
-		[CCode (cname = "librdf_new_node_from_uri")]
-		public Node.from_uri (World world, Uri uri);
-		[CCode (cname = "librdf_new_node_from_uri_local_name")]
-		public Node.from_uri_local_name (World world, Uri uri, string local_name);
-		[CCode (cname = "librdf_new_node_from_normalised_uri_string")]
-		public Node.from_normalised_uri_string (World world, string uri_string, Uri source_uri,
-		                                        Uri base_uri);
-		[CCode (cname = "librdf_new_node_from_literal")]
-		public Node.from_literal (World world, string literal_string, string? xml_language,
-		                          bool is_wf_xml);
-		[CCode (cname = "librdf_new_node_from_typed_literal")]
-		public Node.from_typed_literal (World world, string literal_value, string? xml_language,
-		                                Uri? datatype_uri);
-		/* Missing: (because all other 'counted' variants are)
-		[CCode (cname = "librdf_new_node_from_typed_counted_literal")]
-		public Node.from_typed_counted_literal (World world, string literal_value,
-		                                        size_t value_len, string xml_language,
-		                                        size_t xml_language_len, Uri datatype_uri); */
-
-		[CCode (cname = "librdf_node_get_uri")]
-		public unowned Uri? get_uri ();
-		[CCode (cname = "librdf_node_get_type")]
-		public NodeType get_type ();
-		[CCode (cname = "librdf_node_get_literal_value")]
-		public unowned string? get_literal_value ();  /* (as UTF8) */
-		/* Missing (as all 'counted' variants):
-		[CCode (cname = "librdf_node_get_literal_value_as_counted_string")]
-		public string get_literal_value_as_counted_string (out size_t len_p); */
-		[CCode (cname = "librdf_node_get_literal_value_as_latin1")]
-		public uint8[]? get_literal_value_as_latin1 ();
-		[CCode (cname = "librdf_node_get_literal_value_language")]
-		public uint8[]? get_literal_value_language ();  /* ASCII result */
-		[CCode (cname = "librdf_node_get_literal_value_is_wf_xml")]
-		public bool get_literal_value_is_wf_xml ();
-		[CCode (cname = "librdf_node_get_literal_value_datatype_uri")]
-		public unowned Uri? get_literal_value_datatype_uri ();
-
-		[CCode (cname = "librdf_node_get_li_ordinal")]
-		public int get_li_ordinal ();
-		[CCode (cname = "librdf_node_get_blank_identifier")]
-		public unowned string get_blank_indentifier ();
-
-		[CCode (cname = "librdf_node_is_resource")]
-		public bool is_resource ();
-		[CCode (cname = "librdf_node_is_literal")]
-		public bool is_literal ();
-		[CCode (cname = "librdf_node_is_blank")]
-		public bool is_blank ();
-
-		/* Missing:
-		REDLAND_API
-		size_t librdf_node_encode(librdf_node* node, unsigned char *buffer, size_t length);
-		REDLAND_API
-		librdf_node* librdf_node_decode(librdf_world *world, size_t* size_p, unsigned char *buffer, size_t length);
-		*/
-
-		[CCode (cname = "librdf_node_to_string")]
-		public string? to_string ();
-
-		/* Missing:
-		REDLAND_API
-		unsigned char* librdf_node_to_counted_string(librdf_node* node, size_t* len_p);
-		*/
-
-		[CCode (cname = "librdf_node_print")]
-		public void print (FileStream file_stream);
-
-		[CCode (cname = "librdf_node_equals")]
-		public bool equals (Node other);
-	}
-
-	/***************************************************************************
-	 * Parser
-	 */
-
-	[Compact]
-	[CCode (cname = "librdf_parser_factory")]
-	public class ParserFactory {
-	}
-
-	[Compact]
-	[CCode (cname = "librdf_parser", free_function="librdf_free_parser")]
-	public class Parser {
-		[CCode (cname = "LIBRDF_PARSER_FEATURE_ERROR_COUNT")]
-		public static const string FEATURE_ERROR_COUNT;
-		[CCode (cname = "LIBRDF_PARSER_FEATURE_WARNING_COUNT")]
-		public static const string FEATURE_WARNING_COUNT;
-
-		[CCode (cname = "librdf_parser_guess_name2")]
-		// FIXME: correct param types?
-		public static unowned string guess_name (World world, string? mime_type, uint8 *content, uint8 *identifier);
-
-		[CCode (cname = "librdf_new_parser")]
-		public Parser (World world, string? name, string? mime_type, Uri? type_uri);
-		[CCode (cname = "librdf_new_parser_from_factory")]
-		public Parser.from_factory (World world, ParserFactory factory);
-
-		[CCode (cname = "librdf_parser_parse_as_stream")]
-		public Stream parse_as_stream (Uri uri, Uri? base_uri);
-		[CCode (cname = "librdf_parser_parse_into_model")]
-		public int parse_into_model (Uri uri, Uri? base_uri, Model model);
-		[CCode (cname = "librdf_parser_parse_string_as_stream")]
-		public Stream parse_string_as_string (string data, Uri? base_uri);
-		[CCode (cname = "librdf_parser_parse_string_into_model")]
-		public int parse_string_into_model (string data, Uri? base_uri, Model model);
-		[CCode (cname = "librdf_parser_parse_file_handle_as_stream")]
-		public Stream parse_file_as_stream (FileStream file_stream, int close_fh, Uri? base_uri);
-		[CCode (cname = "librdf_parser_parse_file_handle_into_model")]
-		public int parse_file_stream_into_model (FileStream file_stream, int close_fh,
-		                                         Uri? base_uri, Model model);
-
-		/*REDLAND_API
-		librdf_stream* librdf_parser_parse_counted_string_as_stream(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri);
-		*/
-		/*REDLAND_API
-		int librdf_parser_parse_counted_string_into_model(librdf_parser* parser, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model* model);
-		*/
-
-		[CCode (cname = "librdf_parser_set_uri_filter")]
-		public void set_uri_filter ([CCode (delegate_target_pos = 1.1)] UriFilterFunc filter);
-		/*REDLAND_API
-		librdf_uri_filter_func librdf_parser_get_uri_filter(librdf_parser* parser, void** user_data_p);
-		*/
-
-		[CCode (cname = "librdf_parser_get_feature")]
-		public unowned Node? get_feature (Uri feature);
-		[CCode (cname = "librdf_parser_set_feature")]
-		public int set_feature (Uri feature, Node feature_value);
-		[CCode (cname = "librdf_parser_get_accept_header")]
-		public unowned string? get_accept_header ();
-
-		[CCode (cname = "librdf_parser_get_namespaces_seen_prefix")]
-		public unowned string? get_namespaces_seen_prefix (int namespace_index);
-		[CCode (cname = "librdf_parser_get_namespaces_seen_uri")]
-		public unowned Uri? get_namespaces_seen_uri (int namespace_index);
-		[CCode (cname = "librdf_parser_get_namespaces_seen_count")]
-		public int get_namespaces_seen_count ();
-	}
-
-	/***************************************************************************
-	 * Statement (triple)
-	 */
-
-	[Compact]
-	[CCode (cname = "librdf_statement",
-	        copy_function = "librdf_new_statement_from_statement",
-	        free_function = "librdf_free_statement")]
-	public class Statement {
-		public enum Part {
-			SUBJECT,
-			PREDICATE,
-			OBJECT,
-			ALL
-		}
-
-		[CCode (cname = "librdf_new_statement")]
-		public Statement (World world);
-		[CCode (cname = "librdf_new_statement_from_nodes")]
-		public Statement.from_nodes (World world, owned Node? subject, owned Node? predicate, owned Node? object);
-
-		/* Static allocation stuff .. 
-		REDLAND_API
-		void librdf_statement_init(librdf_world *world, librdf_statement *statement);
-		REDLAND_API
-		void librdf_statement_clear(librdf_statement *statement);*/
-
-		[CCode (cname = "librdf_statement_get_subject")]
-		public unowned Node get_subject ();
-		[CCode (cname = "librdf_statement_set_subject")]
-		public void set_subject (Node node);
-
-		[CCode (cname = "librdf_statement_get_predicate")]
-		public unowned Node get_predicate ();
-		[CCode (cname = "librdf_statement_set_predicate")]
-		public void set_predicate (Node node);
-
-		[CCode (cname = "librdf_statement_get_object")]
-		public unowned Node get_object ();
-		[CCode (cname = "librdf_statement_set_object")]
-		public void set_object (Node node);
-
-		[CCode (cname = "librdf_statement_is_complete")]
-		public bool is_complete ();
-
-		/*REDLAND_API
-		unsigned char *librdf_statement_to_string(librdf_statement *statement);*/
-		[CCode (cname = "librdf_statement_print")]
-		public void print (FileStream file_stream);
-
-		[CCode (cname = "librdf_statement_equals")]
-		public int equals (Statement other);
-		[CCode (cname = "librdf_statement_match")]
-		public int match (Statement other);
-
-		/*REDLAND_API
-		size_t librdf_statement_encode(librdf_statement* statement, unsigned char *buffer, size_t length);
-		REDLAND_API
-		size_t librdf_statement_encode_parts(librdf_statement* statement, librdf_node* context_node, unsigned char *buffer, size_t length, librdf_statement_part fields);
-		REDLAND_API
-		size_t librdf_statement_decode(librdf_statement* statement, unsigned char *buffer, size_t length);
-		REDLAND_API
-		size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char *buffer, size_t length);*/
-	}
-
-	/***************************************************************************
-	 * Storage
-	 */
-
-	/*REDLAND_API
-	int librdf_storage_register_factory(librdf_world *world, const char *name, const char *label, void (*factory) (librdf_storage_factory*));*/
-
-	/*REDLAND_API
-	int librdf_storage_enumerate(librdf_world* world, const unsigned int counter, const char **name, const char **label);*/
-
-	[Compact]
-	[CCode (cname = "librdf_storage",
-	        copy_function = "librdf_new_storage_from_storage",
-	        free_function = "librdf_free_storage")]
-	public class Storage {
-		[CCode (cname = "librdf_new_storage")]
-		public Storage (World world, string? storage_name, string? name, string? options_string);
-		/*[CCode (cname = "librdf_new_storage_with_options")]
-		public Storage (World world, string storage_name, string name, Hash options);*/
-		/*REDLAND_API
-		librdf_storage* librdf_new_storage_from_factory(librdf_world *world, librdf_storage_factory* factory, const char *name, librdf_hash* options);*/
-
-		/* "Indended to be internal to librdf storage modules"
-		REDLAND_API
-		void librdf_storage_add_reference(librdf_storage *storage);
-		REDLAND_API
-		void librdf_storage_remove_reference(librdf_storage *storage); 
-
-		REDLAND_API
-		void librdf_storage_set_instance(librdf_storage *storage, librdf_storage_instance instance);
-		REDLAND_API
-		librdf_storage_instance librdf_storage_get_instance(librdf_storage *storage);*/
-
-		[CCode (cname = "librdf_storage_get_world")]
-		public unowned World get_world ();
-
-		[CCode (cname = "librdf_storage_open")]
-		public int open (Model model);
-		[CCode (cname = "librdf_storage_close")]
-		public int close ();
-
-		[CCode (cname = "librdf_storage_size")]
-		public int size ();
-
-		[CCode (cname = "librdf_storage_add_statement")]
-		public int add_statement (Statement statement);
-		/*[CCode (cname = "librdf_storage_add_statements")]
-		public int add_statements (Stream statement_stream);*/
-		[CCode (cname = "librdf_storage_remove_statement")]
-		public int remove_statement (Statement statement);
-		[CCode (cname = "librdf_storage_contains_statement")]
-		public bool contains_statement (Statement statement);
-
-		/*REDLAND_API
-		librdf_stream* librdf_storage_serialise(librdf_storage* storage);
-		REDLAND_API
-		librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement);
-		REDLAND_API
-		librdf_stream* librdf_storage_find_statements_with_options(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node, librdf_hash* options);
-		REDLAND_API
-		librdf_iterator* librdf_storage_get_sources(librdf_storage *storage, librdf_node *arc, librdf_node *target);
-		REDLAND_API
-		librdf_iterator* librdf_storage_get_arcs(librdf_storage *storage, librdf_node *source, librdf_node *target);
-		REDLAND_API
-		librdf_iterator* librdf_storage_get_targets(librdf_storage *storage, librdf_node *source, librdf_node *arc);*/
-
-		/*REDLAND_API
-		librdf_iterator* librdf_storage_get_arcs_in(librdf_storage *storage, librdf_node *node);
-		REDLAND_API
-		librdf_iterator* librdf_storage_get_arcs_out(librdf_storage *storage, librdf_node *node);*/
-
-		[CCode (cname = "librdf_storage_has_arc_in")]
-		public int has_arc_in (Node node, Node property);
-		[CCode (cname = "librdf_storage_has_arc_out")]
-		public int has_arc_out (Node node, Node property);
-
-		[CCode (cname = "librdf_storage_context_add_statement")]
-		public int context_add_statement (Node context, Statement statement);
-		/*[CCode (cname = "librdf_storage_context_add_statements")]
-		public int context_add_statements (Node context, Stream stream);*/
-		[CCode (cname = "librdf_storage_context_remove_statement")]
-		public int context_remove_statement (Node context, Statement statement);
-		[CCode (cname = "librdf_storage_context_remove_statements")]
-		public int context_remove_statements (Node context);
-		/*REDLAND_API
-		librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context);
-		REDLAND_API REDLAND_DEPRECATED
-		librdf_stream* librdf_storage_context_serialise(librdf_storage* storage, librdf_node* context);*/
-  
-		/*REDLAND_API
-		int librdf_storage_supports_query(librdf_storage* storage, librdf_query *query);
-		REDLAND_API
-		librdf_query_results* librdf_storage_query_execute(librdf_storage* storage, librdf_query *query);*/
-
-		[CCode (cname = "librdf_storage_sync")]
-		public int sync ();
-
-		/*REDLAND_API
-		librdf_stream* librdf_storage_find_statements_in_context(librdf_storage* storage, librdf_statement* statement, librdf_node* context_node);
-
-		REDLAND_API
-		librdf_iterator* librdf_storage_get_contexts(librdf_storage* storage);*/
-
-		[CCode (cname = "librdf_storage_get_feature")]
-		public unowned Node? get_feature (Uri feature);
-		[CCode (cname = "librdf_storage_set_feature")]
-		public int set_feature (Uri feature, Node feature_value);
-
-		[CCode (cname = "librdf_storage_transaction_start")]
-		public int transaction_start ();
-		[CCode (cname = "librdf_storage_transaction_start_with_handle")]
-		public int transaction_start_with_handle (void *handle);
-		[CCode (cname = "librdf_storage_transaction_commit")]
-		public int transaction_commit ();
-		[CCode (cname = "librdf_storage_transaction_rollback")]
-		public int transaction_rollback ();
-		[CCode (cname = "librdf_storage_transaction_get_handle")]
-		public void *transaction_get_handle ();
-	}
-
-	/***************************************************************************
-	 * Stream
-	 */
-
-	/* typedef librdf_statement* (*librdf_stream_map_handler)(librdf_stream *stream, void *map_context, librdf_statement *item); */
-	/* typedef void (*librdf_stream_map_free_context_handler)(void *map_context); */
-
-	[Compact]
-	[CCode (cname = "librdf_stream",
-	        free_function = "librdf_free_stream")]
-	public class Stream {
-		[Flags]
-		[CCode (cprefix="LIBRDF_STREAM_GET_METHOD")]
-		public enum GetMethod {
-			GET_OBJECT,
-			GET_CONTEXT
-		}
-
-		/* REDLAND_API
-		librdf_stream* librdf_new_stream(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); */
-		[CCode (cname = "librdf_new_empty_stream")]
-		public Stream.empty (World world);
-		[CCode (cname = "librdf_new_stream_from_node_iterator")]
-		public Stream.from_node_iterator (Iterator iterator, Statement statement, Statement.Part field);
-
-		[CCode (cname = "librdf_stream_end")]
-		public bool end ();
-		[CCode (cname = "librdf_stream_next")]
-		public int next ();
-		[CCode (cname = "librdf_stream_get_object")]
-		public unowned Statement get_object ();
-		[CCode (cname = "librdf_stream_get_context")]
-		public void *get_context ();
-
-		/*REDLAND_API
-		int librdf_stream_add_map(librdf_stream* stream, librdf_stream_map_handler map_function, librdf_stream_map_free_context_handler free_context, void *map_context);*/
-
-		[CCode (cname = "librdf_stream_print")]
-		public void print (FileStream file_stream);
-	}
-
-	/***************************************************************************
-	 * Uri
-	 */
-
-	[CCode (cname = "librdf_uri_filter_func", instance_pos = 0)]
-	public delegate int UriFilterFunc (Uri uri);
-
-	[Compact]
-	[CCode (cname = "librdf_uri",
-	        copy_function = "librdf_new_uri_from_uri",
-	        free_function = "librdf_free_uri")]
-	public class Uri {
-		[CCode (cname = "librdf_new_uri")]
-		public Uri (World world, string uri_string);
-		[CCode (cname = "librdf_new_uri_from_uri")]
-		public Uri.from_uri (Uri old_uri);
-		[CCode (cname = "librdf_new_uri_from_uri_local_name")]
-		public Uri.from_uri_local_name (Uri old_uri, string local_name);
-		[CCode (cname = "librdf_new_uri_normalised_to_base")]
-		public Uri.normalised_to_base (string uri_string, Uri source_uri, Uri base_uri);
-		[CCode (cname = "librdf_new_uri_relative_to_base")]
-		public Uri.relative_to_base (Uri base_uri, string uri_string);
-		[CCode (cname = "librdf_new_uri_from_filename")]
-		public Uri.from_filename (World world, string filename);
-
-		/* FIXME: only present due to vala not using the free_function correctly */
-		[CCode (cname = "librdf_free_uri")]
-		public void free ();
-
-		[CCode (cname = "librdf_uri_as_string")]
-		public unowned string as_string();
-		/*[CCode (cname = "librdf_uri_as_counted_string")] (librdf_uri *uri, size_t *len_p); */
-		[CCode (cname = "librdf_uri_print")]
-		public void print (FileStream file_stream);
-		[CCode (cname = "librdf_uri_to_string")]
-		public string to_string ();
-		/*REDLAND_API
-		unsigned char* librdf_uri_to_counted_string (librdf_uri* uri, size_t* len_p);*/
-
-		[CCode (cname = "librdf_uri_equals")]
-		public bool equals (Uri other);
-		[CCode (cname = "librdf_uri_compare")]
-		public int compare (Uri other);
-		[CCode (cname = "librdf_uri_is_file_uri")]
-		public bool is_file_uri ();
-		[CCode (cname = "librdf_uri_to_filename")]
-		public string to_filename ();
-	}
-}
-\ No newline at end of file