Triples Source

Triples Source — Source of matches to a triple pattern.


typedef     rasqal_triples_match;
typedef     rasqal_triples_source;
void        rasqal_set_triples_source_factory
                                            (void (*register_fn) (rasqal_triples_source_factory *factory),
                                             void *user_data);


A factory that provides the raw triple matches for a triple pattern against some RDF graph. The rasqal_triples_source_factory must create use a new rasqal_triples_source that can be used to initialise and build a rasqal_triples_match for some rasqal_triple (subject, predicate, object, origin URI).



typedef struct rasqal_triples_match_s rasqal_triples_match;

Triples match structure as initialised by rasqal_triples_source method init_triples_match.


typedef struct rasqal_triples_source_s rasqal_triples_source;

Triples source as initialised by a rasqal_triples_source_factory.


typedef struct {
  void *user_data;
  size_t user_data_size;

  int (*new_triples_source)(rasqal_query* query, void *factory_user_data, void *user_data, rasqal_triples_source* rts);
} rasqal_triples_source_factory;

A factory that initialises rasqal_triples_source structures to returning matches to a triple pattern.

void *user_data; User data for triples_source_factory.
size_t user_data_size; Size Of user_data for new_triples_source.
new_triples_source () Create a new triples source - returns non-zero on failure < 0 is a 'no rdf data error', > 0 is an unspecified error..

rasqal_set_triples_source_factory ()

void        rasqal_set_triples_source_factory
                                            (void (*register_fn) (rasqal_triples_source_factory *factory),
                                             void *user_data);

Register the factory to return triple sources.

Registers the factory that returns triples sources. Note that there is only one of these per runtime.

The rasqal_triples_source_factory factory method new_triples_source is called with the user data for some query and rasqal_triples_source.

register_fn : registration function
user_data : user data for registration