[redland-dev] Usage of Abbreviated RDFXML Serializer

Dave Beckett dave at dajobe.org
Tue Feb 23 18:43:51 CET 2010


On Tue, 23 Feb 2010, Lauri Aalto wrote:
> Generally, Raptor serializers are not designed for reuse. Some of them
> reset themselves to a reusable state when you call
> raptor_serialize_end() but the rdfxml-abbrev serializer is not one of
> them. So it's better you create a new serializer object for each
> serialization. The serializer delete/create overhead is negligible
> compared to what happens during the serialization itself.
>
> It's the same story with parsers. They are generally not designed for
> reuse. Some are able to parse many documents but in the generic case
> you need a new parser object for each document you are parsing.

Lauri's correct, however I'd like to fix that over the long term so
that you can create, start parse, parse, end, then start parse again.
The same for serializing.

It means somebody refactoring the init/reset code out of the parser
and serializer constructor/destructors and moving them around.  It's
not very hard work.

There's a related request (I can't find it in a bug) about this which
asks for the ability to 'flush' serializing, to remove large state
that may have built in for the abbreviated serializers.

That would need the same code, but in this
case means adding a new api call raptor_serializer_flush() or some
name like that.

This work is also related to one of the olders bugs:
   http://bugs.librdf.org/mantis/view.php?id=18

Dave



More information about the redland-dev mailing list