Triples

## Triples Triples — Triple pattern or RDF triple. |

## Functions

rasqal_triple * | rasqal_new_triple ()
rasqal_triple * | rasqal_new_triple_from_triple ()
void | rasqal_free_triple ()
rasqal_literal * | rasqal_triple_get_origin ()
int | rasqal_triple_print ()
void | rasqal_triple_set_origin ()

## Types and Values

| rasqal_triple
enum | rasqal_triple_parts

## Description

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`).

## Functions

### rasqal_new_triple ()

    rasqal_triple *
    rasqal_new_triple (rasqal_literal *subject,
                       rasqal_literal *predicate,
                       rasqal_literal *object);

#### Returns

### rasqal_new_triple_from_triple ()

    rasqal_triple *
    rasqal_new_triple_from_triple (rasqal_triple *t);

#### Returns

### rasqal_free_triple ()

    void
    rasqal_free_triple (rasqal_triple *t);

### rasqal_triple_get_origin ()

    rasqal_literal *
    rasqal_triple_get_origin (rasqal_triple *t);

#### Returns

### rasqal_triple_print ()

    int
    rasqal_triple_print (rasqal_triple *t,
                         FILE *fh);

#### Returns

### rasqal_triple_set_origin ()

    void
    rasqal_triple_set_origin (rasqal_triple *t,
                              rasqal_literal *l);

## Types and Values

### rasqal_triple

    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.

#### Members

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. |

### enum rasqal_triple_parts

Flags for parts of a triple.

#### Members

RASQAL_TRIPLE_NONE | no parts |
RASQAL_TRIPLE_SUBJECT | Subject present in a triple. |
RASQAL_TRIPLE_PREDICATE | Predicate present in a triple. |
RASQAL_TRIPLE_OBJECT | Object present in a triple. |
RASQAL_TRIPLE_ORIGIN | Origin/graph present in a triple. |
RASQAL_TRIPLE_GRAPH | Alias for RASQAL_TRIPLE_ORIGIN |
RASQAL_TRIPLE_SPO | Subject, Predicate and Object present in a triple. |
RASQAL_TRIPLE_SPOG | Subject, Predicate, Object, Graph present in a triple. |