EasyRdf API Documentation
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.

Constants

DEFAULT_GRAPH

Use to reference default graph of triplestore

Methods

__construct(string $uri)

Create a new SPARQL Graph Store client

string getUri()

Get the URI of the graph store

EasyRdf_Graph get(string $uriRef)

Fetch a named graph from the graph store

EasyRdf_Graph getDefault()

Fetch default graph from the graph store

EasyRdf_Http_Response replace(EasyRdf_Graph|string $graph, string $uriRef = null, string $format = 'ntriples')

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

EasyRdf_Http_Response replaceDefault(EasyRdf_Graph|string $graph, string $format = 'ntriples')

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

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

Add data to a graph in the graph store

object insertIntoDefault(EasyRdf_Graph|string $graph, string $format = 'ntriples')

Add data to default graph of the graph store

EasyRdf_Http_Response delete(string $uriRef)

Delete named graph content from the graph store

EasyRdf_Http_Response deleteDefault()

Delete default graph content from the graph store

string __toString()

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

Details

at line 62
public __construct(string $uri)

Create a new SPARQL Graph Store client

Parameters

string $uri The address of the graph store endpoint

at line 72
public string getUri()

Get the URI of the graph store

Return Value

string The URI of the graph store

at line 85
public EasyRdf_Graph 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

EasyRdf_Graph The graph requested

at line 106
public EasyRdf_Graph getDefault()

Fetch default graph from the graph store

Return Value

EasyRdf_Graph

at line 176
public EasyRdf_Http_Response replace(EasyRdf_Graph|string $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

EasyRdf_Graph|string $graph Data
string $uriRef The URI of graph to be replaced
string $format The format of the data to send to the graph store

Return Value

EasyRdf_Http_Response The response from the graph store

at line 194
public EasyRdf_Http_Response replaceDefault(EasyRdf_Graph|string $graph, string $format = 'ntriples')

Replace the contents of default 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 $format parameter can be given to specify the serialisation used to send the graph data to the graph store.

Parameters

EasyRdf_Graph|string $graph Data
string $format The format of the data to send to the graph store

Return Value

EasyRdf_Http_Response The response from the graph store

at line 215
public object insert(EasyRdf_Graph|string $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

EasyRdf_Graph|string $graph Data
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 233
public object insertIntoDefault(EasyRdf_Graph|string $graph, string $format = 'ntriples')

Add data to default graph of 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 $format parameter can be given to specify the serialisation used to send the graph data to the graph store.

Parameters

EasyRdf_Graph|string $graph Data
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 248
public EasyRdf_Http_Response delete(string $uriRef)

Delete named graph content 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

EasyRdf_Http_Response The response from the graph store

Exceptions

EasyRdf_Exception

at line 278
public EasyRdf_Http_Response deleteDefault()

Delete default graph content from the graph store

Return Value

EasyRdf_Http_Response

Exceptions

EasyRdf_Exception

at line 302
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