Synopsis
#include <liblod.h>
int
lod_set_model
(LODCONTEXT *context
, librdf_model *model
);
Description
lod_set_model
sets or resets the
librdf_model
object associated with
context
.
Any existing librdf_model
associated with the
context will be discarded, freeing it
(using librdf_free_model
) if it was automatically
allocated by liblod, as is the case when a context
is initially created.
If model
is NULL
,
a new librdf_model
will be
allocated and associated with context
. This object will
be automatically destroyed when it is no longer required.
If model
is not NULL
,
then the supplied librdf_model
will be associated with
context
. liblod will not automatically
destroy this librdf_model
object when it is is no longer
required, and it is the calling application's responsibility to do
so.
Caution
Do not destroy a librdf_model
object associated with a
context until after it has either been replaced (via another call to
lod_set_model
), or the context itself has been
destroyed (by lod_destroy
).
See also
liblod, lod_model, lod_create, lod_destroy, lod_errmsg, librdf_new_model_with_options, librdf_free_model.