Class

EasyRdf_GraphStore

class EasyRdf_GraphStore

A class for fetching, saving and deleting graphs to a Graph Store.

Implementation of the SPARQL 1.1 Graph Store HTTP Protocol.

Methods

__construct(string $uri)

Create a new SPARQL Graph Store client

string getUri()

Get the URI of the graph store

object get(string $uriRef)

Fetch a named graph from the graph store

object replace(object $graph, string $uriRef = null, string $format = 'ntriples')

Replace the contents of a graph in the graph store with new data

object insert(object $graph, string $uriRef = null, string $format = 'ntriples')

Add data to a graph in the graph store

object delete(string $uriRef)

Delete a graph from the graph store

string __toString()

Magic method to return URI of the graph store when casted to string

Details

at line 57
public __construct(string $uri)

Create a new SPARQL Graph Store client

Parameters

string $uri The address of the graph store endpoint

at line 67
public string getUri()

Get the URI of the graph store

Return Value

string The URI of the graph store

at line 80
public object get(string $uriRef)

Fetch a named graph from the graph store

The URI can either be a full absolute URI or a URI relative to the URI of the graph store.

Parameters

string $uriRef The URI of graph desired

Return Value

object EasyRdf_Graph The graph requested

at line 143
public object replace(object $graph, string $uriRef = null, string $format = 'ntriples')

Replace the contents of a graph in the graph store with new data

The $graph parameter is the EasyRdf_Graph object to be sent to the graph store. Alternatively it can be a string, already serialised.

The URI can either be a full absolute URI or a URI relative to the URI of the graph store.

The $format parameter can be given to specify the serialisation used to send the graph data to the graph store.

Parameters

object $graph EasyRdfGraph $graph The URI of graph desired
string $uriRef The URI of graph to be replaced
string $format The format of the data to send to the graph store

Return Value

object EasyRdfHttpResponse The response from the graph store

at line 164
public object insert(object $graph, string $uriRef = null, string $format = 'ntriples')

Add data to a graph in the graph store

The $graph parameter is the EasyRdf_Graph object to be sent to the graph store. Alternatively it can be a string, already serialised.

The URI can either be a full absolute URI or a URI relative to the URI of the graph store.

The $format parameter can be given to specify the serialisation used to send the graph data to the graph store.

Parameters

object $graph EasyRdfGraph $graph The URI of graph desired
string $uriRef The URI of graph to be added to
string $format The format of the data to send to the graph store

Return Value

object EasyRdfHttpResponse The response from the graph store

at line 177
public object delete(string $uriRef)

Delete a graph from the graph store

The URI can either be a full absolute URI or a URI relative to the URI of the graph store.

Parameters

string $uriRef The URI of graph to be added to

Return Value

object EasyRdfHttpResponse The response from the graph store

at line 211
public string __toString()

Magic method to return URI of the graph store when casted to string

Return Value

string The URI of the graph store