[redland-dev] high-level function for combining models?

Lauri Aalto laalto at gmail.com
Mon Jan 28 09:01:11 GMT 2008

On Jan 28, 2008 4:39 AM, Vincent Carey 525-2265
<stvjc at channing.harvard.edu> wrote:
> the closest thing i see in the API doc is librdf_model_add_submodel,
> but it is not clear what a submodel is.  my expectation is that
> after the addition, the model added is a submodel of the result of
> the addition, but before the addition we simply have two models.

Reading the source, it seems that submodels are just a list of
librdf_model objects owned by another librdf_model. As of now, they
are not usable or useful for anything other than having the submodels
be automatically freed when freeing the main model.

> the API doc indicates that this is not tested.  is it best at this
> time just to add statements from one model to another through iteration?

For performance reasons, I'd let it iterate on the lowest level
possible. Get a statement stream of the source model with
librdf_model_as_stream() and use librdf_model_add_statements() to add
the statement stream to the destionation model. This way the
underlying storage module can optimize for batch addition of


More information about the redland-dev mailing list