Semantic MediaWiki and related extensions
|
Public Member Functions | |
getRepositoryClient () | |
select ( $vars, $where, $options=[], $extraNamespaces=[]) | |
ask ( $where, $extraNamespaces=[]) | |
delete ( $deletePattern, $where, $extraNamespaces=[]) | |
doQuery ( $sparql) | |
doUpdate ( $sparql) | |
doHttpPost ( $payload) | |
Public Attributes | |
const | QUERY_ENDPOINT = 1 |
const | UPDATE_ENDPOINT = 2 |
const | DATA_ENDPOINT = 4 |
GNU GPL v2+
SMW\SPARQLStore\RepositoryConnection::ask | ( | $where, | |
$extraNamespaces = [] |
|||
) |
The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.
$where | string WHERE part of the query, without surrounding { } |
$extraNamespaces | array (associative) of namespaceId => namespaceUri |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::delete | ( | $deletePattern, | |
$where, | |||
$extraNamespaces = [] |
|||
) |
The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.
$deletePattern | string CONSTRUCT pattern of tripples to delete |
$where | string condition for data to delete |
$extraNamespaces | array (associative) of namespaceId => namespaceUri |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector, and SMW\SPARQLStore\RepositoryConnectors\VirtuosoRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::doHttpPost | ( | $payload | ) |
Execute a HTTP-based SPARQL POST request according to http://www.w3.org/2009/sparql/docs/http-rdf-update/. The method throws exceptions based on GenericHttpDatabaseConnector::mapHttpRequestError(). If errors occur and this method does not throw anything, then an empty result with an error code is returned.
string | $payload | Turtle serialization of data to send |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector, and SMW\SPARQLStore\RepositoryConnectors\FourstoreRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::doQuery | ( | $sparql | ) |
Execute a SPARQL query and return an RepositoryResult object that contains the results. The method throws exceptions based on GenericHttpDatabaseConnector::mapHttpRequestError(). If errors occur and this method does not throw anything, then an empty result with an error code is returned.
string | $sparql | complete SPARQL query (SELECT or ASK) |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector, SMW\SPARQLStore\RepositoryConnectors\FourstoreRepositoryConnector, and SMW\SPARQLStore\RepositoryConnectors\FusekiRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::doUpdate | ( | $sparql | ) |
Execute a SPARQL update and return a boolean to indicate if the operations was successful. The method throws exceptions based on GenericHttpDatabaseConnector::mapHttpRequestError(). If errors occur and this method does not throw anything, then false is returned.
string | $sparql | complete SPARQL update query (INSERT or DELETE) |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector, SMW\SPARQLStore\RepositoryConnectors\VirtuosoRepositoryConnector, and SMW\SPARQLStore\RepositoryConnectors\FourstoreRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::getRepositoryClient | ( | ) |
The function returns connection details required for establishing an active repository connection.
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector.
SMW\SPARQLStore\RepositoryConnection::select | ( | $vars, | |
$where, | |||
$options = [] , |
|||
$extraNamespaces = [] |
|||
) |
The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.
$vars | mixed array or string, field name(s) to be retrieved, can be '*' |
$where | string WHERE part of the query, without surrounding { } |
$options | array (associative) of options, e.g. array( 'LIMIT' => '10' ) |
$extraNamespaces | array (associative) of namespaceId => namespaceUri |
Implemented in SMW\SPARQLStore\RepositoryConnectors\GenericRepositoryConnector.
const SMW\SPARQLStore\RepositoryConnection::DATA_ENDPOINT = 4 |
Flag denoting endpoints being capable of SPARQL HTTP graph management
const SMW\SPARQLStore\RepositoryConnection::QUERY_ENDPOINT = 1 |
Flag denoting endpoints being capable of querying
const SMW\SPARQLStore\RepositoryConnection::UPDATE_ENDPOINT = 2 |
Flag denoting endpoints being capable of updating