| Rasqal RDF Query Library Manual | ||||
|---|---|---|---|---|
rasqal_triple_meta;
rasqal_triples_match;
rasqal_triples_source;
rasqal_triples_source_factory;
void rasqal_set_triples_source_factory (rasqal_world *world,
void (register_fnrasqal_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 {
/* triple (subject, predicate, object) and origin */
rasqal_variable* bindings[4];
rasqal_triples_match *triples_match;
void *context;
rasqal_triple_parts parts;
/* non-0 if the associated triple pattern contains no variables */
int is_exact;
/* non-0 if the triple pattern has been fully executed */
int executed;
} rasqal_triple_meta;
Triple matching metadata for one triple pattern.
rasqal_variable * |
Variable bindings for this triple+origin to set. |
rasqal_triples_match * |
The matcher that is setting these bindings. |
void * |
Context data used by the matcher. |
rasqal_triple_parts |
Parts of the triple to match/bindings to set. |
int |
non-0 if all parts of the triple are given |
int |
non-0 if the triple pattern has been fully executed |
typedef struct {
void *user_data;
rasqal_triple_parts (*bind_match)(struct rasqal_triples_match_s* rtm, void *user_data, rasqal_variable *bindings[4], rasqal_triple_parts parts);
void (*next_match)(struct rasqal_triples_match_s* rtm, void *user_data);
int (*is_end)(struct rasqal_triples_match_s* rtm, void *user_data);
void (*finish)(struct rasqal_triples_match_s* rtm, void *user_data);
rasqal_world *world;
} rasqal_triples_match;
Triples match structure as initialised by rasqal_triples_source method init_triples_match.
void * |
User data pointer for factory methods. |
|
The [4]array (s,p,o,origin) bindings against the current triple match only touching triple parts given. Returns parts that were bound or 0 on failure. |
|
Move to next match. |
|
Check for end of triple match - return non-0 if is end. |
|
Finish triples match and destroy any allocated memory. |
rasqal_world * |
rasqal_world object |
typedef struct {
rasqal_query* query;
void *user_data;
int (*init_triples_match)(rasqal_triples_match* rtm, struct rasqal_triples_source_s* rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t);
int (*triple_present)(struct rasqal_triples_source_s* rts, void *user_data, rasqal_triple *t);
void (*free_triples_source)(void *user_data);
} rasqal_triples_source;
Triples source as initialised by a rasqal_triples_source_factory.
rasqal_query * |
Source for this query. |
void * |
Context user data passed into the factory methods. |
|
Factory method to initalise a new rasqal_triples_match. |
|
Factory method to return presence or absence of a complete triple. |
|
Factory method to deallocate resources. |
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 for triples_source_factory. |
size_t |
Size Of user_data for 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.. |
void rasqal_set_triples_source_factory (rasqal_world *world, void (register_fnrasqal_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.
|
rasqal_world object |
|
registration function |
|
user data for registration |