Redland RDF Library Manual | ||||
---|---|---|---|---|
Top | Description |
typedef librdf_world; librdf_world * librdf_new_world (void
); void librdf_free_world (librdf_world *world
); void librdf_world_open (librdf_world *world
); void librdf_world_set_rasqal (librdf_world *world
,rasqal_world *rasqal_world_ptr
); rasqal_world * librdf_world_get_rasqal (librdf_world *world
); raptor_world * librdf_world_get_raptor (librdf_world *world
); void librdf_world_set_raptor (librdf_world *world
,raptor_world *raptor_world_ptr
); void librdf_world_init_mutex (librdf_world *world
); void librdf_world_set_error (librdf_world *world
,void *user_data
,librdf_log_level_func error_handler
); void librdf_world_set_warning (librdf_world *world
,void *user_data
,librdf_log_level_func warning_handler
); void librdf_world_set_logger (librdf_world *world
,void *user_data
,librdf_log_func log_handler
); void librdf_world_set_digest (librdf_world *world
,const char *name
); void (*librdf_raptor_init_handler) (void *user_data
,raptor_world *raptor_world_ptr
); void librdf_world_set_raptor_init_handler (librdf_world *world
,void *user_data
,librdf_raptor_init_handler handler
); void (*librdf_rasqal_init_handler) (void *user_data
,rasqal_world *rasqal_world_ptr
); void librdf_world_set_rasqal_init_handler (librdf_world *world
,void *user_data
,librdf_rasqal_init_handler handler
); #define LIBRDF_WORLD_FEATURE_GENID_BASE #define LIBRDF_WORLD_FEATURE_GENID_COUNTER librdf_node * librdf_world_get_feature (librdf_world *world
,librdf_uri *feature
); int librdf_world_set_feature (librdf_world *world
,librdf_uri *feature
,librdf_node *value
); void librdf_init_world (char *digest_factory_name
,void *not_used2
); void librdf_destroy_world (void
);
The Redland librdf_world class handles startup and termination of the library and cleanup of all allocated resources.
librdf_world * librdf_new_world (void
);
Create a new Redland execution environment.
Once this constructor is called to build a librdf_world object
several functions may be called to set some parameters such as
librdf_world_set_error()
, librdf_world_set_warning()
,
librdf_world_set_logger()
, librdf_world_set_digest()
,
librdf_world_set_feature()
.
The world object needs initializing using librdf_world_open()
whether or not the above functions are called. It will be
automatically called by all object constructors in Redland 1.0.6
or later, but for earlier versions it MUST be called before using
any other part of Redland.
Returns : |
a new librdf_world or NULL on failure |
void librdf_free_world (librdf_world *world
);
Terminate the library and frees all allocated resources.
|
redland world object |
void librdf_world_open (librdf_world *world
);
Open a created redland world environment.
|
redland world object |
void librdf_world_set_rasqal (librdf_world *world
,rasqal_world *rasqal_world_ptr
);
Set the rasqal_world instance to be used with this librdf_world.
If no rasqal_world instance is set with this function,
librdf_world_open()
creates a new instance.
Ownership of the rasqal_world is not taken. If the rasqal library
instance is set with this function, librdf_free_world()
will not
free it.
|
librdf_world object |
|
rasqal_world object |
rasqal_world * librdf_world_get_rasqal (librdf_world *world
);
Get the rasqal_world instance used by this librdf_world.
|
librdf_world object |
Returns : |
rasqal_world object or NULL on failure (e.g. not initialized) |
raptor_world * librdf_world_get_raptor (librdf_world *world
);
Get the raptor_world instance used by this librdf_world.
|
librdf_world object |
Returns : |
raptor_world object or NULL on failure (e.g. not initialized) |
void librdf_world_set_raptor (librdf_world *world
,raptor_world *raptor_world_ptr
);
Set the raptor_world instance to be used with this librdf_world.
If no raptor_world instance is set with this function,
librdf_world_open()
creates a new instance.
Ownership of the raptor_world is not taken. If the raptor library
instance is set with this function, librdf_free_world()
will not
free it.
|
librdf_world object |
|
raptor_world object |
void librdf_world_init_mutex (librdf_world *world
);
INTERNAL - Create the world mutex.
|
redland world object |
void librdf_world_set_error (librdf_world *world
,void *user_data
,librdf_log_level_func error_handler
);
Set the world error handling function.
The function will receive callbacks when the world fails.
librdf_world_set_logger()
provides richer access to all log messages
and should be used in preference.
|
redland world object |
|
user data to pass to function |
|
pointer to the function |
void librdf_world_set_warning (librdf_world *world
,void *user_data
,librdf_log_level_func warning_handler
);
Set the world warning handling function.
The function will receive callbacks when the world gives a warning.
librdf_world_set_logger()
provides richer access to all log messages
and should be used in preference.
|
redland world object |
|
user data to pass to function |
|
pointer to the function |
void librdf_world_set_logger (librdf_world *world
,void *user_data
,librdf_log_func log_handler
);
Set the world log handling function.
The function will receive callbacks when redland generates a log message
|
redland world object |
|
user data to pass to function |
|
pointer to the function |
void librdf_world_set_digest (librdf_world *world
,const char *name
);
Set the default content digest name.
Sets the digest factory for various modules that need to make digests of their objects.
|
redland world object |
|
Digest factory name |
void (*librdf_raptor_init_handler) (void *user_data
,raptor_world *raptor_world_ptr
);
void librdf_world_set_raptor_init_handler (librdf_world *world
,void *user_data
,librdf_raptor_init_handler handler
);
Set the raptor initialization handler to be called if a new raptor_world is constructed.
|
librdf_world object |
|
user data |
|
handler to call |
void (*librdf_rasqal_init_handler) (void *user_data
,rasqal_world *rasqal_world_ptr
);
void librdf_world_set_rasqal_init_handler (librdf_world *world
,void *user_data
,librdf_rasqal_init_handler handler
);
Set the rasqal initialization handler to be called if a new rasqal_world is constructed.
|
librdf_world object |
|
user data |
|
handler to call |
#define LIBRDF_WORLD_FEATURE_GENID_BASE "http://feature.librdf.org/genid-base"
World feature to set the generated ID base.
Must be set before the world is opened with librdf_world_open()
.
#define LIBRDF_WORLD_FEATURE_GENID_COUNTER "http://feature.librdf.org/genid-counter"
World feature to set the generated ID counter.
Must be set before the world is opened with librdf_world_open()
.
librdf_node * librdf_world_get_feature (librdf_world *world
,librdf_uri *feature
);
Get the value of a world feature.
|
librdf_world object |
|
librdf_uri feature property |
Returns : |
new librdf_node feature value or NULL if no such feature exists or the value is empty. |
int librdf_world_set_feature (librdf_world *world
,librdf_uri *feature
,librdf_node *value
);
Set the value of a world feature.
|
librdf_world object |
|
librdf_uri feature property |
|
librdf_node feature property value |
Returns : |
non 0 on failure (negative if no such feature) |
void librdf_init_world (char *digest_factory_name
,void *not_used2
);
Initialise the library
deprecated
: Do not use.
Use librdf_new_world()
and librdf_world_open()
on librdf_world object
See librdf_world_set_digest()
for documentation on arguments.
|
Name of digest factory to use |
|
Not used |
void librdf_destroy_world (void
);
Terminate the library
deprecated
: Do not use.
Use librdf_free_world()
on librdf_world object
Terminates and frees the resources.