## section-service section-service |

## Functions

rasqal_service * | rasqal_new_service ()
void | rasqal_free_service ()
rasqal_query_results * | rasqal_service_execute ()
int | rasqal_service_set_format ()
int | rasqal_service_set_www ()

## Types and Values

typedef | rasqal_service

## Description

## Functions

### rasqal_new_service ()

    rasqal_service *
    rasqal_new_service (rasqal_world *world,
                        raptor_uri *service_uri,
                        const unsigned char *query_string,
                        raptor_sequence *data_graphs);

Constructor - create a new rasqal protocol service object.

Create a structure to execute a sparql protocol service at `service_uri` running the query `query_string` and returning a sparql result set.

All arguments are copied by the service object

#### Parameters

world | rasqal_world object |
service_uri | sparql protocol service URI |
query_string | query string (or NULL) |
data_graphs | sequence of rasqal_data_graph graphs for service |

#### Returns

a new rasqal_query object or NULL on failure

### rasqal_free_service ()

    void
    rasqal_free_service (rasqal_service *svc);

Destructor - destroy a rasqal_service object.

#### Parameters

svc | rasqal_service object |

### rasqal_service_execute ()

    rasqal_query_results *
    rasqal_service_execute (rasqal_service *svc);

Execute a rasqal sparql protocol service

#### Parameters

svc | rasqal service |

#### Returns

query results or NULL on failure

### rasqal_service_set_format ()

    int
    rasqal_service_set_format (rasqal_service *svc,
                               const char *format);

Set the MIME Type to use in HTTP Accept when executing the service

#### Parameters

svc | rasqal_service service object |
format | service mime type (or NULL) |

#### Returns

non 0 on failure

### rasqal_service_set_www ()

    int
    rasqal_service_set_www (rasqal_service *svc,
                            raptor_www *www);

Set the WWW object to use when executing the service

#### Parameters

svc | rasqal_service service object |
www | WWW object (or NULL) |

#### Returns

non 0 on failure

## Types and Values

### rasqal_service

    typedef struct rasqal_service_s rasqal_service;

Rasqal SPARQL Protocol Service