lod_instance_exists

Check that the subject referred to by a liblod instance exists

Synopsis

#include <liblod.h>

int lod_instance_exists(LODINSTANCE *instance);

Description

lod_instance_exists checks that the subject of an instance exists in the associated context's model.

A liblod instance is a simple kind of query for any triples whose subject matches the URI provided to lod_resolve. There are various circumstances by which lod_resolve can successfully return an instance, but that the subject of the instance doesn't actually exist in the data held by the model.

Because an instance is a query against a model, a call to lod_instance_exists may have different results at different times. For example, it might initially return zero (false), but following a new call to lod_resolve (or manually adding triples to the associated librdf model), the next call might return non-zero (true).

Return value

If the subject of the instance does not exist in the context, lod_instance_exists returns zero.

Otherwise, lod_instance_exists returns a positive integer.

See also

liblod, lod_resolve.