|  |  |  | Rasqal RDF Query Library Manual |  | 
|---|---|---|---|---|
            rasqal_triple;
enum        rasqal_triple_flags;
rasqal_triple* rasqal_new_triple            (rasqal_literal *subject,
                                             rasqal_literal *predicate,
                                             rasqal_literal *object);
rasqal_triple* rasqal_new_triple_from_triple
                                            (rasqal_triple *t);
void        rasqal_free_triple              (rasqal_triple *t);
rasqal_literal* rasqal_triple_get_origin    (rasqal_triple *t);
enum        rasqal_triple_parts;
void        rasqal_triple_print             (rasqal_triple *t,
                                             FILE *fh);
void        rasqal_triple_set_origin        (rasqal_triple *t,
                                             rasqal_literal *l);
An object for a triple pattern or an RDF triple in a query.  It
contains the three parts of an RDF triple - subject, predicate,
object as well as origin for matching triples in some graph (such as
with the SPARQL GRAPH).
typedef struct {
  rasqal_literal* subject;
  rasqal_literal* predicate;
  rasqal_literal* object;
  rasqal_literal* origin;
  unsigned int flags;
} rasqal_triple;
A triple pattern or RDF triple.
This is used as a triple pattern in queries and an RDF triple when generating RDF triples such as with SPARQL CONSTRUCT.
| rasqal_literal * subject; | Triple subject. | 
| rasqal_literal * predicate; | Triple predicate. | 
| rasqal_literal * object; | Triple object. | 
| rasqal_literal * origin; | Triple origin. | 
| unsigned int flags; | Or of enum rasqal_triple_flags bits. | 
typedef enum {
  /* Not used - was only used internally in the execution engine */
  RASQAL_TRIPLE_FLAGS_EXACT=1,
  /* Not used - this is now a property of a graph pattern */
  RASQAL_TRIPLE_FLAGS_OPTIONAL=2,
  RASQAL_TRIPLE_FLAGS_LAST=RASQAL_TRIPLE_FLAGS_OPTIONAL
} rasqal_triple_flags;
Flags for triple patterns.
rasqal_triple* rasqal_new_triple (rasqal_literal *subject, rasqal_literal *predicate, rasqal_literal *object);
Constructor - create a new rasqal_triple triple or triple pattern.
The triple origin can be set with rasqal_triple_set_origin().
| subject: | Triple subject. | 
| predicate: | Triple predicate. | 
| object: | Triple object. | 
| Returns : | a new rasqal_triple or NULL on failure. | 
rasqal_triple* rasqal_new_triple_from_triple (rasqal_triple *t);
Copy constructor - create a new rasqal_triple from an existing one.
| t: | Triple to copy. | 
| Returns : | a new rasqal_triple or NULL on failure. | 
void rasqal_free_triple (rasqal_triple *t);
Destructor - destroy a rasqal_triple object.
| t: | rasqal_triple object. | 
rasqal_literal* rasqal_triple_get_origin (rasqal_triple *t);
Get the origin field of a rasqal_triple.
| t: | The triple object. | 
| Returns : | The triple origin or NULL. | 
typedef enum {
  RASQAL_TRIPLE_SUBJECT  = 1,
  RASQAL_TRIPLE_PREDICATE= 2,
  RASQAL_TRIPLE_OBJECT   = 4,
  RASQAL_TRIPLE_ORIGIN   = 8
} rasqal_triple_parts;
Flags for parts of a triple.
void rasqal_triple_print (rasqal_triple *t, FILE *fh);
Print a Rasqal triple in a debug format.
The print debug format may change in any release.
| t: | rasqal_triple object. | 
| fh: | The FILE* handle to print to. | 
void rasqal_triple_set_origin (rasqal_triple *t, rasqal_literal *l);
Set the origin field of a rasqal_triple.
| t: | The triple object. | 
| l: | The rasqal_literal object to set as origin. |