class 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

get(string $uriRef)

Fetch a named graph from the graph store

getDefault()

Fetch default graph from the graph store

sendGraph($method, $graph, $uriRef, $format)

Send some graph data to the graph store

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

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

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

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

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

Add data to a graph in the graph store

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

Add data to default graph of the graph store

delete(string $uriRef)

Delete named graph content from the graph store

deleteDefault()

Delete default graph content from the graph store

urlForGraph($url)

Work out the full URL for a graph store request.

string
__toString()

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

Details

at line 63
__construct(string $uri)

Create a new SPARQL Graph Store client

Parameters

string $uri The address of the graph store endpoint

at line 73
string getUri()

Get the URI of the graph store

Return Value

string The URI of the graph store

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

Graph The graph requested

at line 108
Graph getDefault()

Fetch default graph from the graph store

Return Value

Graph

at line 119
protected sendGraph($method, $graph, $uriRef, $format)

Send some graph data to the graph store

This method is used by insert() and replace()

Parameters

$method
$graph
$uriRef
$format

at line 179
Response replace(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

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

Response The response from the graph store

at line 198
Response replaceDefault(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

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

Return Value

Response The response from the graph store

at line 220
Response insert(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

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

Response The response from the graph store

at line 239
Response insertIntoDefault(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

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

Return Value

Response The response from the graph store

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

Response The response from the graph store

Exceptions

Exception

at line 284
Response deleteDefault()

Delete default graph content from the graph store

Return Value

Response

Exceptions

Exception

at line 293
protected urlForGraph($url)

Work out the full URL for a graph store request.

by checking if if it is a direct or indirect request.

Parameters

$url

at line 308
string __toString()

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

Return Value

string The URI of the graph store