lod_fetch

Resolve a Linked Open Data URI

Synopsis

#include <liblod.h>

LODINSTANCE *lod_fetch(LODCONTEXT *context, const char *uri);

Description

lod_fetch attempts to resolve a Linked Open Data URI: that is, perform one or more HTTP requests in order to obtain data describing the subject identified by uri.

In contrast to lod_resolve, lod_fetch will not check for the presence of triples where uri is the subject within the model associated with context before attempting to fetch any data.

Return value

Upon success, lod_fetch returns a new LODINSTANCE, which should be later freed using lod_instance_destroy.

If an error occurs, or uri was not a subject of any triple in the data after the fetch completes, lod_fetch returns NULL.

Use lod_error to determine whether an error occurred, or whether the subject does not exist in the data. If an error does occur, you can use lod_errmsg to obtain a description of the error condition.

See also

liblod, lod_locate, lod_resolve, lod_create, lod_error, lod_errmsg, lod_instance_exists, lod_instance_stream, librdf_parser_create.