[redland-dev] Serializing a stream of statements

Dave Beckett dave at dajobe.org
Mon Jun 19 05:08:53 BST 2006


Alessio Carenini wrote on 2006-06-09:
> Is it possible to serialize only a stream of statements? For what I've
> understood, serializing is a model-only operation, so one way do to that
> should be create a new model, copy selected triples in it and then
> serialize the new model. Is it correct or are there better ways? I'm using
> Python bindings, but I think that the answer is not binding-dependant...

Redland could make this possible (since Raptor provides this alreayd)
but there isn't currently an API to do so.

The code in librdf_serializer_raptor_serialize_model_to_file_handle() or
nearby just contains a while loop operating over a stream of triples
from the model, sending them to raptor to do the work.

I guess the API would be something like:

librdf_serializer_serialize_stream_to_X(FILE *handle, librdf_uri*
base_uri, librdf_stream* stream)

where X would be to_file_handle, to_counted_string, to_iostream
(internally).

At the bindings level this would give you
librdf_serializer_serialize_stream_to_file
librdf_serializer_serialize_stream_to_string

I've added a feature request bug to track this:
http://bugs.librdf.org/mantis/view.php?id=92

Dave


More information about the redland-dev mailing list