lod_set_world

Set a new librdf world to be used by a context

Synopsis

#include <liblod.h>

int lod_set_world(LODCONTEXT *context, librdf_world *world);

Description

lod_set_world sets or resets the librdf_world object associated with context.

Any existing librdf_world associated with the context will be discarded, freeing it (using librdf_free_world) if it was automatically allocated by liblod, as is the case when a context is initially created.

If world is NULL, a new librdf_world will be allocated and associated with context. This object will be automatically destroyed when it is no longer required.

If world is not NULL, then the supplied librdf_world will be associated with context. liblod will not automatically destroy this librdf_world object when it is is no longer required, and it is the calling application's responsibility to do so.

Note

Changing the librdf_world associated with context will also cause the associated librdf_storage and librdf_model to be discarded (and destroyed, if they were automatically allocated).

Caution

Do not destroy a librdf_world object associated with a context until after it has either been replaced (via another call to lod_set_world), or the context itself has been destroyed (by lod_destroy).

See also

liblod, lod_world, lod_create, lod_destroy, lod_errmsg, librdf_new_world, librdf_free_world.