redland(3)
πΈ NAME πΈ
hey bestie, welcome to the redland(3) page π β this is the manual for the Redland RDF Application Framework, aka the Resource Description Framework (RDF) Library. yes, the whole thing. grab a snack, we're going on a journey. π¦
β VERSION β
1.0.16 β that's the version, no cap. β¨
π SYNOPSIS π
like, here's how you even get at it:
#include <redland.h>
that's it. that's the whole vibe check. π
π DESCRIPTION π
okay so redland is a library that gives you support for the Resource Description Framework (RDF), and it's written in ANSI C with APIs in several other languages too. multilingual queen π
this manual page lists most of the redland public API functions, but ngl it does not claim to be a complete summary of the entire API. so if you need the complete API with full details of the function interface, go look at the HTML API documentation β either on the Redland web site at <http://librdf.org/> π or with the software release, in the docs/api directory. iykyk.
β¨ FUNCTIONS β¨
every single function defined by redland is defined with the "librdf_" prefix. so if you see something starting with librdf_, that's us. π
πͺ class world πͺ
the world is, like, the whole universe your RDF stuff lives in β you make one, you open it, you free it. main character energy fr fr. π
librdf_world* librdf_new_world(void)
void librdf_free_world(librdf_world* world)
void librdf_world_open(librdf_world* world)
void librdf_world_set_error(librdf_world* world, void* user_data, void (*error_fn)(void* user_data, const char* msg, ...))
void librdf_world_set_warning(librdf_world* world, void* user_data, void (*warning_fn)(void* user_data, const char* msg, ...))
void librdf_world_set_digest(librdf_world*, const char* name)
void librdf_world_set_uris_hash(librdf_world* world, librdf_hash* uris_hash)
const char* librdf_world_get_feature(librdf_world* world, librdf_uri* feature)
int librdf_world_set_feature(librdf_world* world, librdf_uri* feature, const char* value)
π¦ class iterator π¦
iterators are how you walk through stuff one item at a time without losing your mind. very demure, very mindful. π§
librdf_iterator* librdf_new_iterator(librdf_world* world, void* context, int (*is_end)(void*), void* (*get_next)(void*), void (*finished)(void*))
void librdf_free_iterator(librdf_iterator*)
int librdf_iterator_end(librdf_iterator* iterator)
int librdf_iterator_finished(librdf_iterator* iterator)
int librdf_iterator_next(librdf_iterator* iterator)
void* librdf_iterator_get_object(librdf_iterator* iterator)
void* librdf_iterator_get_context(librdf_iterator* iterator)
void* librdf_iterator_get_key(librdf_iterator* iterator)
void* librdf_iterator_get_value(librdf_iterator* iterator)
int librdf_iterator_add_map(librdf_iterator* iterator, void* (*fn)(void* context, void* item), void* context)
void* librdf_iterator_map_remove_duplicate_nodes(void* item, void* user_data)
π class digest π
digests = hashes. cryptographic-ish vibes. register a factory, make a digest, feed it bytes, get your digest out. slay. π₯
void librdf_digest_register_factory(librdf_world* world, const char* name, void (*factory) (librdf_digest_factory*))
librdf_digest_factory* librdf_get_digest_factory(librdf_world* world, const char* name)
librdf_digest* librdf_new_digest(librdf_world* world, char* name)
librdf_digest* librdf_new_digest_from_factory(librdf_world* world, librdf_digest_factory* factory)
void librdf_free_digest(librdf_digest* digest)
void librdf_digest_init(librdf_digest* digest)
void librdf_digest_update(librdf_digest* digest, unsigned char* buf, size_t length)
void librdf_digest_final(librdf_digest* digest)
void* librdf_digest_get_digest(librdf_digest* digest)
char* librdf_digest_to_string(librdf_digest* digest)
void librdf_digest_print(librdf_digest* digest, FILE* fh)
π class uri π
URIs! the absolute backbone of RDF, periodt. make them, copy them, turn them into strings, compare them, check if they're file URIs, normalise them against a base, and build them from filenames. so much going on and every bit of it iconic. π
librdf_uri* librdf_new_uri(librdf_world* world, const unsigned char * string)
librdf_uri* librdf_new_uri_from_uri(librdf_uri* uri)
librdf_uri* librdf_new_uri_from_uri_local_name(librdf_uri* uri, const unsigned char* local_name)
void librdf_free_uri(librdf_uri* uri)
unsigned char* librdf_uri_as_string(librdf_uri* uri)
unsigned char* librdf_uri_as_counted_string(librdf_uri* uri, size_t* len_p)
librdf_digest* librdf_uri_get_digest(librdf_uri* uri)
void librdf_uri_print>(librdf_uri* uri, FILE* fh)
unsigned char* librdf_uri_to_string(librdf_uri* uri)
unsigned char* librdf_uri_to_counted_string(librdf_uri* uri, size_t* len_p)
int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri)
int librdf_uri_is_file_uri(librdf_uri* uri)
const char* librdf_uri_to_filename(librdf_uri* uri)
librdf_uri* librdf_new_uri_normalised_to_base(const unsigned char* uri_string, librdf_uri* source_uri, librdf_uri* base_uri)
librdf_uri* librdf_new_uri_relative_to_base(librdf_uri* base_uri, const unsigned char* uri_string)
librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char* filename)
bestie, heads up: thatlibrdf_uri_print>line is literally how it's written here, stray>and all. i am simply reporting the lore. π
π«Ά class node π«Ά
nodes are the building blocks of RDF statements β URIs, literals, blank nodes. you can build them from uri strings, literals, typed literals, blank identifiers, other nodesβ¦ and then interrogate them about their whole life. obsessed. π
librdf_node* librdf_new_node(librdf_world* world)
librdf_node* librdf_new_node_from_uri_string(librdf_world* world, const char* string)
librdf_node* librdf_new_node_from_uri(librdf_world* world, librdf_uri* uri)
librdf_node* librdf_new_node_from_uri_local_name(librdf_world* world, librdf_uri* uri, const char* local_name)
librdf_node* librdf_new_node_from_normalised_uri_string(librdf_world* world, const char* uri_string, librdf_uri* source_uri, librdf_uri* base_uri)
librdf_node* librdf_new_node_from_literal(librdf_world* world, const char* string, const char* xml_language, int xml_space, int is_wf_xml)
librdf_node* librdf_new_node_from_typed_literal(librdf_world* world, const unsigned char* string, const char* xml_language, librdf_uri* datatype_uri)
librdf_node* librdf_new_node_from_blank_identifier(librdf_world* world, const unsigned char* identifier)
librdf_node* librdf_new_node_from_node(librdf_node* node)
void librdf_node_init(librdf_world* world, librdf_node* node)
void librdf_free_node(librdf_node* r)
librdf_uri* librdf_node_get_uri(librdf_node* node)
librdf_node_type librdf_node_get_type(librdf_node* node)
unsigned char* librdf_node_get_literal_value(librdf_node* node)
unsigned char* librdf_node_get_literal_value_as_counted_string(librdf_node* node, size_t* len_p)
char* librdf_node_get_literal_value_as_latin1(librdf_node* node)
char* librdf_node_get_literal_value_language(librdf_node* node)
int librdf_node_get_literal_value_is_wf_xml(librdf_node* node)
librdf_uri* librdf_node_get_literal_value_datatype_uri(librdf_node* node)
int librdf_node_get_li_ordinal(librdf_node* node)
unsigned char* librdf_node_get_blank_identifier(librdf_node* node)
int librdf_node_is_resource(librdf_node* node)
int librdf_node_is_literal(librdf_node* node)
int librdf_node_is_blank(librdf_node* node)
librdf_digest* librdf_node_get_digest(librdf_node* node)
size_t librdf_node_encode(librdf_node* node, unsigned char* buffer, size_t length)
size_t librdf_node_decode(librdf_node* node, unsigned char* buffer, size_t length)
unsigned char* librdf_node_to_string(librdf_node* node)
unsigned char* librdf_node_to_counted_string(librdf_node* node, size_t* len_p)
void librdf_node_print(librdf_node* node, FILE* fh)
int librdf_node_equals(librdf_node* first_node, librdf_node* second_node)
π§ class concepts π§
the library provides macros for all of the RDF and RDFS concepts β nodes and URIs. π« for example, "LIBRDF_MS_Alt" for the librdf_node for the rdf:Alt concept, and "LIBRDF_MS_Alt_URI" for the librdf_uri for the URI reference of rdf:Alt.
"LIBRDF_URI_RDF_MS" and "LIBRDF_URI_RDF_SCHEMA" give you the librdf_uri objects for the RDF and RDFS namespace URIs. and listen β they must be copied using librdf_new_uri_from_uri to be shared correctly. don't skip that step, fr fr. β οΈ
void librdf_get_concept_by_name(librdf_world* world, int is_ms, const char* name, librdf_uri **uri_p, librdf_node **node_p)
π class statement π
statements = subject + predicate + object. the classic trio. make them, copy them, build them from nodes, get and set each part, check if they're complete, stringify them, print them, compare them, match them against a partial statement, and encode/decode them (whole or in parts). it's giving thorough. π₯
librdf_statement* librdf_new_statement(librdf_world* world)
librdf_statement* librdf_new_statement_from_statement(librdf_statement* statement)
librdf_statement* librdf_new_statement_from_nodes(librdf_world* world, librdf_node* subject, librdf_node* predicate, librdf_node* object)
void librdf_statement_init(librdf_world* world, librdf_statement* statement)
void librdf_statement_clear(librdf_statement* statement)
void librdf_free_statement(librdf_statement* statement)
librdf_node* librdf_statement_get_subject(librdf_statement* statement)
void librdf_statement_set_subject(librdf_statement* statement, librdf_node* subject)
librdf_node* librdf_statement_get_predicate(librdf_statement* statement)
void librdf_statement_set_predicate(librdf_statement* statement, librdf_node* predicate)
librdf_node* librdf_statement_get_object(librdf_statement* statement)
void librdf_statement_set_object(librdf_statement* statement, librdf_node* object)
int librdf_statement_is_complete(librdf_statement* statement)
char* librdf_statement_to_string(librdf_statement* statement)
void librdf_statement_print(librdf_statement* statement, FILE* fh)
int librdf_statement_equals(librdf_statement* statement1, librdf_statement* statement2)
int librdf_statement_match(librdf_statement* statement, librdf_statement* partial_statement)
size_t librdf_statement_encode(librdf_statement* statement, unsigned char* buffer, size_t length)
size_t librdf_statement_encode_parts(librdf_statement* statement, unsigned char* buffer, size_t length, librdf_statement_part fields)
size_t librdf_statement_decode(librdf_statement* statement, unsigned char* buffer, size_t length)
size_t librdf_statement_decode_parts(librdf_statement* statement, librdf_node** context_node, unsigned char* buffer, size_t length)
and bestieβ¦ there's so much more coming. this was just part 1. π β¨
π class model π
bestie, this is the model squad β the actual RDF graph energy, all the statements living their truth. every single signature below is verbatim, no cap, i did not touch a single character β¨
librdf_model* librdf_new_model(librdf_world* world, librdf_storage* storage, char* options_string)β constructor era πlibrdf_model* librdf_new_model_with_options(librdf_world* world, librdf_storage* storage, librdf_hash* options)β the one where you hand over a hash instead πlibrdf_model* librdf_new_model_from_model(librdf_model* model)β copy the whole vibe πΈvoid librdf_free_model(librdf_model* model)β the goodbye π«Άint librdf_model_size(librdf_model* model)β how big is the fit πint librdf_model_add(librdf_model* model, librdf_node* subject, librdf_node* predicate, librdf_node* object)β subject, predicate, object, the holy trinity π₯int librdf_model_add_string_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, char* string, char* xml_language, int xml_space, int is_wf_xml)β string literal, with thexml_language,xml_spaceandis_wf_xmloptions β¨int librdf_model_add_typed_literal_statement(librdf_model* model, librdf_node* subject, librdf_node* predicate, const unsigned char* string, char* xml_language, librdf_uri* datatype_uri)β typed literal, so you get adatatype_uriinstead πint librdf_model_add_statement(librdf_model* model, librdf_statement* statement)β one whole statement, in it goes πint librdf_model_add_statements(librdf_model* model, librdf_stream* statement_stream)β the whole stream, she ate πint librdf_model_remove_statement(librdf_model* model, librdf_statement* statement)β begone π¦int librdf_model_contains_statement(librdf_model* model, librdf_statement* statement)β is she in there or not πint librdf_model_has_arc_in(librdf_model* model, librdf_node* node, librdf_node* property)β arc in check βint librdf_model_has_arc_out(librdf_model* model, librdf_node* node, librdf_node* property)β arc out check βlibrdf_stream* librdf_model_as_stream(librdf_model* model)β turn the whole thing into a stream πlibrdf_stream* librdf_model_find_statements(librdf_model* model, librdf_statement* statement)β the find squad πlibrdf_stream* librdf_model_find_statements_in_context(librdf_model* model, librdf_statement* statement, librdf_node* context_node)β find, but in a context, she's specific πlibrdf_stream* librdf_model_find_statements_with_options(librdf_model* model, librdf_statement* statement, librdf_node* context_node, librdf_hash* options)β find, context, and a hash ofoptions, main character πlibrdf_iterator* librdf_model_get_contexts(librdf_model* model)β all the contexts, as an iterator π§librdf_iterator* librdf_model_get_sources(librdf_model* model, librdf_node* arc, librdf_node* target)β sources, givenarc+targetπlibrdf_iterator* librdf_model_get_arcs(librdf_model* model, librdf_node* source, librdf_node* target)β arcs, givensource+targetπlibrdf_iterator* librdf_model_get_targets(librdf_model* model, librdf_node* source, librdf_node* arc)β targets, givensource+arcπΈlibrdf_node* librdf_model_get_source(librdf_model* model, librdf_node* arc, librdf_node* target)β same as above but a single node, not an iterator πlibrdf_node* librdf_model_get_arc(librdf_model* model, librdf_node* source, librdf_node* target)β single arc β¨librdf_node* librdf_model_get_target(librdf_model* model, librdf_node* source, librdf_node* arc)β single target πlibrdf_iterator* librdf_model_get_arcs_in(librdf_model* model, librdf_node* node)β arcs in, iterator style π¦librdf_iterator* librdf_model_get_arcs_out(librdf_model* model, librdf_node* node)β arcs out, iterator style π¦int librdf_model_add_submodel(librdf_model* model, librdf_model* sub_model)β model inside a model, inception fr fr πint librdf_model_remove_submodel(librdf_model* model, librdf_model* sub_model)β un-inception πvoid librdf_model_print(librdf_model* model, FILE* fh)β spill it tofhπ¨οΈint librdf_model_context_add_statement(librdf_model* model, librdf_node* context, librdf_statement* statement)β context + statement, added πint librdf_model_context_add_statements(librdf_model* model, librdf_node* context, librdf_stream* stream)β context + wholestreamπint librdf_model_context_remove_statement(librdf_model* model, librdf_node* context, librdf_statement* statement)β context + statement, removed πint librdf_model_context_remove_statements(librdf_model* model, librdf_node* context)β nuke that context's statements π₯librdf_stream* librdf_model_context_as_stream(librdf_model* model, librdf_node* context)β context, but as a stream πlibrdf_stream* librdf_model_query(librdf_model* model, librdf_query* query)β query time πlibrdf_stream* librdf_model_query_string(librdf_model* model, const char* name, librdf_uri* uri, const unsigned char* query_string)β query, but from aname,uriandquery_stringπvoid librdf_model_sync(librdf_model* model)β sync her π«Άlibrdf_storage* librdf_model_get_storage(librdf_model* model)β grab the storage underneath πlibrdf_node* librdf_model_get_feature(librdf_model* model, librdf_uri* feature) =item int librdf_model_set_feature(librdf_model* model, librdf_uri* feature, librdf_node* value)
bestie. that=itemin the middle? i know. π it is literally in the original like that βlibrdf_model_get_featureandlibrdf_model_set_featuregot glued together by a runaway manpage macro. i kept it character for character because that's the rule. get/set feature, both of them, that's the tea π
πΈ class storage πΈ
the storage layer β where the statements actually live. same deal, every signature exact, i'm just here for the commentary β¨
void librdf_storage_register_factory(const char* name, void (*factory)(librdf_storage_factory*))β register afactoryunder anameπlibrdf_storage* librdf_new_storage(librdf_world* world, char* storage_name, char* name, char* options_string)β new storage,storage_name+name+options_stringπlibrdf_storage* librdf_new_storage_with_options(librdf_world* world, char* storage_name, char* name, librdf_hash* options)β same but the options come as a hash πlibrdf_storage* librdf_new_storage_from_storage(librdf_storage* old_storage)β copy era πΈlibrdf_storage* librdf_new_storage_from_factory(librdf_world* world, librdf_storage_factory* factory, char* name, librdf_hash* options)β straight from afactoryπvoid librdf_free_storage(librdf_storage* storage)β bye bestie π«Άint librdf_storage_open(librdf_storage* storage, librdf_model* model)β open, with amodelin hand πint librdf_storage_close(librdf_storage* storage)β close it up πint librdf_storage_get(librdf_storage* storage, void* key, size_t key_len, void **value, size_t* value_len, unsigned int flags)β the raw get:key,key_len,value,value_len,flags, the whole buffet πint librdf_storage_size(librdf_storage* storage)β size check πint librdf_storage_add_statement(librdf_storage* storage, librdf_statement* statement)β add one πint librdf_storage_add_statements(librdf_storage* storage, librdf_stream* statement_stream)β add the wholestatement_streamπint librdf_storage_remove_statement(librdf_storage* storage, librdf_statement* statement)β remove one πint librdf_storage_contains_statement(librdf_storage* storage, librdf_statement* statement)β does she contain it πlibrdf_stream* librdf_storage_serialise(librdf_storage* storage)β serialise the whole storage into a stream β¨librdf_stream* librdf_storage_find_statements(librdf_storage* storage, librdf_statement* statement)β find squad, storage edition πlibrdf_iterator* librdf_storage_get_sources(librdf_storage* storage, librdf_node* arc, librdf_node* target)β sources fromarc+targetπ§librdf_iterator* librdf_storage_get_arcs(librdf_storage* storage, librdf_node* source, librdf_node* target)β arcs fromsource+targetπΈlibrdf_iterator* librdf_storage_get_targets(librdf_storage* storage, librdf_node* source, librdf_node* arc)β targets fromsource+arcπlibrdf_iterator* librdf_storage_get_arcs_in(librdf_storage* storage, librdf_node* node)β arcs in π¦librdf_iterator* librdf_storage_get_arcs_out(librdf_storage* storage, librdf_node* node)β arcs out π¦int librdf_storage_has_arc_in(librdf_storage* storage, librdf_node* node, librdf_node* property)β has arc in, yes or no βint librdf_storage_has_arc_out(librdf_storage* storage, librdf_node* node, librdf_node* property)β has arc out, yes or no βint librdf_storage_context_add_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement)β context + statement πint librdf_storage_context_add_statements(librdf_storage* storage, librdf_node* context, librdf_stream* stream)β context +streamπint librdf_storage_context_remove_statement(librdf_storage* storage, librdf_node* context, librdf_statement* statement)β context + statement, removed πint librdf_storage_context_remove_statements(librdf_storage* storage, librdf_node* context)β clear out the context π₯librdf_stream* librdf_storage_context_as_stream(librdf_storage* storage, librdf_node* context)β context as a stream πint librdf_storage_supports_query(librdf_storage* storage, librdf_query* query)β can she even π«Άlibrdf_stream* librdf_storage_query(librdf_storage* storage, librdf_query* query)β she can, and here's the stream πvoid librdf_storage_sync(librdf_storage* storage)β sync π§
π¦ class parser π¦
the parser girlies β she takes input and turns it into statements. every signature, untouched, i promise on my life π
void librdf_parser_register_factory(librdf_world* world, const char* name, const char* mime_type, const char* uri_string, void (*factory)(librdf_parser_factory*))β register a parserfactorybyname,mime_typeanduri_stringπlibrdf_parser* librdf_new_parser(librdf_world* world, const char* name, const char* mime_type, librdf_uri* type_uri)β new parser fromname,mime_type,type_uriβ¨librdf_parser* librdf_new_parser_from_factory(librdf_world* world, librdf_parser_factory* factory)β straight from thefactoryπvoid librdf_free_parser(librdf_parser* parser)β bye π«Άlibrdf_stream* librdf_parser_parse_as_stream(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri)β parse auriinto a stream, with abase_uriπint librdf_parser_parse_into_model(librdf_parser* parser, librdf_uri* uri, librdf_uri* base_uri, librdf_model* model)β parse thaturistraight into amodelπlibrdf_stream* librdf_parser_parse_string_as_stream(librdf_parser* parser, const unsigned char* string, librdf_uri* base_uri)β parse astringinto a stream πint librdf_parser_parse_string_into_model(librdf_parser* parser, const unsigned char* string, librdf_uri* base_uri, librdf_model* model)β parse thatstringinto amodelπΈvoid librdf_parser_set_error(librdf_parser* parser, void* user_data, void (*error_fn)(void* user_data, const char* msg, ...))β set the error handler:user_data+error_fnπ¨void librdf_parser_set_warning(librdf_parser* parser, void* user_data, void (*warning_fn)(void* user_data, const char* msg, ...))β set the warning handler:user_data+warning_fnβ οΈlibrdf_node* librdf_parser_get_feature(librdf_parser* parser, librdf_uri* feature)β get a feature πint librdf_parser_set_feature(librdf_parser* parser, librdf_uri* feature, librdf_node* value)β set a feature π
π class serializer π
the serializer bestie β she takes your model and writes it out all pretty. signatures verbatim, character for character, periodt π
librdf_serializer* librdf_new_serializer(librdf_world* world, const char *name, const char *mime_type, librdf_uri *type_uri)β new serializer fromname,mime_type,type_uriβ¨librdf_serializer* librdf_new_serializer_from_factory(librdf_world* world, librdf_serializer_factory *factory)β from thefactoryπvoid librdf_free_serializer(librdf_serializer *serializer)β bye girl π«Άint librdf_serializer_serialize_model(librdf_serializer* serializer, FILE* handle, librdf_uri* base_uri, librdf_model* model)β write themodelto ahandle, with abase_uriπint librdf_serializer_serialize_model_to_file(librdf_serializer* serializer, const char *name, librdf_uri* base_uri, librdf_model* model)β same but to a filenameπvoid librdf_serializer_set_error(librdf_serializer* serializer, void *user_data, void (*error_fn)(void *user_data, const char *msg, ...))β error handler:user_data+error_fnπ¨void librdf_serializer_set_warning(librdf_serializer* serializer, void *user_data, void (*warning_fn)(void *user_data, const char *msg, ...))β warning handler:user_data+warning_fnβ οΈlibrdf_node* librdf_serializer_get_feature(librdf_serializer* serializer, librdf_uri* feature)β get a feature πint librdf_serializer_set_feature(librdf_serializer* serializer, librdf_uri* feature, librdf_node* value)bβ set a featureint librdf_serializer_set_namespace(librdf_serializer* serializer, librdf_uri* uri, const char* prefix)β set a namespace:uri+prefixπ
okay so about that lonely littlebhanging off the end oflibrdf_serializer_set_featureβ¦ π it's in the original, bestie, it's a lil typo that has been living there rent free. i kept it. don't come for me, come for the manpage π
β class stream β
and finally the stream crew β she's the "here's your stuff, one at a time" girlie. all signatures exact, all vibes immaculate π¦
librdf_stream* librdf_new_stream(librdf_world* world, void* context, int (*end_of_stream)(void*), librdf_statement* (*next_statement)(void*), void (*finished)(void*))β new stream withcontext,end_of_stream,next_statementandfinishedcallbacks, the whole build-your-own setup β¨librdf_stream* librdf_new_stream_from_node_iterator(librdf_iterator* iterator, librdf_statement* statement, librdf_statement_part field)β build one from aniterator, astatementand afieldπvoid librdf_free_stream(librdf_stream* stream)β bye π«Άint librdf_stream_end(librdf_stream* stream)β are we at the end πint librdf_stream_next(librdf_stream* stream)β next π¦librdf_statement* librdf_stream_get_object(librdf_stream* stream)β grab the current object πvoid* librdf_stream_get_context(librdf_stream* stream)β grab the context πΈvoid librdf_stream_set_map(librdf_stream* stream, librdf_statement* (*map)(void* context, librdf_statement* statement), void* map_context)β set amapfunction plus amap_contextπΊοΈvoid librdf_stream_print(librdf_stream* stream, FILE* fh)β print the stream tofhπ¨οΈ
that's the whole function roster for these classes, bestie β nothing skipped, nothing merged, nothing invented. more coming in the next part, so don't wander off π
β¨ EXAMPLES β¨
okay bestie this is the whole vibe in one little program, no cap π here's a full working example, and yes you can literally copy-paste this:
#include <redland.h>
librdf_storage *storage;
librdf_model* model;
librdf_statement* statement;
librdf_world* world
world=librdf_new_world();
librdf_world_open(world);
storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'");
model=librdf_new_model(world, storage, NULL);
statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, "http://purl.org/net/dajobe/"), librdf_new_node_from_uri_string(world, "http://purl.org/dc/elements/1.1/creator"), librdf_new_node_from_literal(world, "Dave Beckett", NULL, 0));
librdf_model_add_statement(model, statement);
librdf_free_statement(statement);
librdf_model_print(model, stdout);
librdf_free_model(model);
librdf_free_storage(storage);
librdf_free_world(world);
so what's happening here, step by step? π you make a world, you open it, you build a "hashes" storage called "test" with the options hash-type='bdb',dir='.', you make a model on top of it, you build one statement out of three nodes (a URI subject, a URI predicate, and a literal object saying "Dave Beckett"), you add it, you free the statement, you print the model to stdout, and then you clean up model β storage β world, in that order. icon behavior, truly π«Ά
π SEE ALSO π
libraptor(3)libxml(4)
π HISTORY π
the redland RDF library was created by Dave Beckett back in June 2000 β a whole legend, fr fr π
π AUTHOR π
Dave Beckett <http://purl.org/net/dajobe/>
okay that's the whole page bestie, you're officially a redland girlie now π
this was redland 1.0.16, dated 28-Jun-2012, and it lives in the redland(3) section β go forth and build your triples, mwah π¦β¨
π¦ where this page comes from
- alpine 3.24: redland-doc 1.0.17-r3 Β· LGPL-2.1-or-later
- centos-stream 9: redland 1.0.17-29.el9 Β· LGPLv2+ or ASL 2.0
- centos-stream 9: redland 1.0.17-29.el9 Β· LGPLv2+ or ASL 2.0
- debian bookworm: librdf0 1.0.17-3
- debian trixie: librdf0t64 1.0.17-4+b1
- fedora 43: redland 1.0.17-40.fc43 Β· LGPL-2.1-or-later OR Apache-2.0
- fedora 43: redland 1.0.17-40.fc43 Β· LGPL-2.1-or-later OR Apache-2.0
- fedora 44: redland 1.0.17-41.fc44 Β· LGPL-2.1-or-later OR Apache-2.0
- fedora 44: redland 1.0.17-41.fc44 Β· LGPL-2.1-or-later OR Apache-2.0
- nixos 26.05: redland 1.0.17
- nixpkgs unstable: redland 1.0.17
- opensuse-leap 16.0: libredland-devel 1.0.17-bp160.1.10 Β· Apache-2.0 AND LGPL-2.1-or-later
- opensuse-leap 16.0: libredland-devel 1.0.17-bp160.1.10 Β· Apache-2.0 AND LGPL-2.1-or-later
- opensuse-leap 16.0: libredland-devel 1.0.17-bp160.1.10 Β· Apache-2.0 AND LGPL-2.1-or-later
- opensuse-leap 16.0: libredland-devel 1.0.17-bp160.1.10 Β· Apache-2.0 AND LGPL-2.1-or-later
- ubuntu jammy: librdf0 1.0.17-1.1ubuntu3
- ubuntu noble: librdf0t64 1.0.17-3.1ubuntu3
- ubuntu questing: librdf0t64 1.0.17-4ubuntu2
- ubuntu resolute: librdf0t64 1.0.17-8
- ubuntu stonking: librdf0t64 1.0.17-10 Β· LGPL-2.1-or-later OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms