Client
class Client
Class for making SPARQL queries using the SPARQL 1.1 Protocol
Methods
Create a new SPARQL endpoint client
Get the URI of the SPARQL query endpoint
Get the URI of the SPARQL update endpoint
No description
Count the number of triples in a SPARQL 1.1 endpoint
Get a list of named graphs from a SPARQL 1.1 endpoint
No description
No description
No description
No description
No description
Adds missing prefix-definitions to the query
Build http-client object, execute request and return a response
Parse HTTP-response object into a meaningful result-object.
Proxy function to allow usage of our Client as well as Zend\Http v2.
Details
at line 70
__construct(string $queryUri, string $updateUri = null)
Create a new SPARQL endpoint client
If the query and update endpoints are the same, then you only need to give a single URI.
at line 91
string
getQueryUri()
Get the URI of the SPARQL query endpoint
at line 100
string
getUpdateUri()
Get the URI of the SPARQL update endpoint
at line 109
getUri()
at line 126
Result|Graph
query(string $query)
Make a query to the SPARQL endpoint
SELECT and ASK queries will return an object of type EasyRdf\Sparql\Result.
CONSTRUCT and DESCRIBE queries will return an object of type EasyRdf\Graph.
at line 142
int
countTriples(string $condition = '?s ?p ?o')
Count the number of triples in a SPARQL 1.1 endpoint
Performs a SELECT query to estriblish the total number of triples.
Counts total number of triples by default but a conditional triple pattern can be given to count of a subset of all triples.
at line 162
Resource[]
listNamedGraphs(string $limit = null)
Get a list of named graphs from a SPARQL 1.1 endpoint
Performs a SELECT query to get a list of the named graphs
at line 188
Response
update(string $query)
Make an update request to the SPARQL endpoint
Successful responses will return the HTTP response object
Unsuccessful responses will throw an exception
at line 193
insert($data, $graphUri = null)
at line 208
protected
updateData($operation, $data, $graphUri = null)
at line 222
clear($graphUri, $silent = false)
at line 241
protected
request($type, $query)
at line 258
protected
convertToTriples($data)
at line 280
protected string
preprocessQuery(string $query)
Adds missing prefix-definitions to the query
Overriding classes may execute arbitrary query-alteration here
at line 304
protected Response|Response
executeQuery(string $processed_query, string $type)
Build http-client object, execute request and return a response
at line 387
protected Graph|Result
parseResponseToQuery(Response|Response $response)
Parse HTTP-response object into a meaningful result-object.
Can be overridden to do custom processing
at line 409
protected
setHeaders($client, $name, $value)
Proxy function to allow usage of our Client as well as Zend\Http v2.
Zend\Http\Client only accepts an array as first parameter, but our Client wants a name-value pair.