Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector Class Reference
Collaboration diagram for SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector:
Collaboration graph
[legend]

Public Member Functions

 delete ($deletePattern, $where, $extraNamespaces=array())
 
 insertDelete ($insertPattern, $deletePattern, $where, $extraNamespaces=array())
 
 insertData ($triples, $extraNamespaces=array())
 
 deleteData ($triples, $extraNamespaces=array())
 
 doUpdate ($sparql)
 
- Public Member Functions inherited from SMW\SPARQLStore\RepositoryConnectors\GenericHttpRepositoryConnector
 __construct (RepositoryClient $repositoryClient, HttpRequest $httpRequest)
 
 getRepositoryClient ()
 
 getDefaultGraph ()
 
 ping ($endpointType=self::EP_TYPE_QUERY)
 
 select ($vars, $where, $options=array(), $extraNamespaces=array())
 
 getSparqlForSelect ($vars, $where, $options=array(), $extraNamespaces=array())
 
 ask ($where, $extraNamespaces=array())
 
 getSparqlForAsk ($where, $extraNamespaces=array())
 
 selectCount ($variable, $where, $options=array(), $extraNamespaces=array())
 
 delete ($deletePattern, $where, $extraNamespaces=array())
 
 deleteContentByValue ($propertyName, $objectName, $extraNamespaces=array())
 
 deleteAll ()
 
 insertDelete ($insertPattern, $deletePattern, $where, $extraNamespaces=array())
 
 insertData ($triples, $extraNamespaces=array())
 
 deleteData ($triples, $extraNamespaces=array())
 
 doQuery ($sparql)
 
 doUpdate ($sparql)
 
 doHttpPost ($payload)
 
 setConnectionTimeoutInSeconds ($timeout=10)
 

Additional Inherited Members

- Static Public Member Functions inherited from SMW\SPARQLStore\RepositoryConnectors\GenericHttpRepositoryConnector
static getPrefixString ($extraNamespaces=array(), $forSparql=true)
 
- Public Attributes inherited from SMW\SPARQLStore\RepositoryConnectors\GenericHttpRepositoryConnector
const EP_TYPE_QUERY = 1
 
const EP_TYPE_UPDATE = 2
 
const EP_TYPE_DATA = 4
 
- Protected Member Functions inherited from SMW\SPARQLStore\RepositoryConnectors\GenericHttpRepositoryConnector
 mapHttpRequestError ($endpoint, $sparql)
 
- Protected Attributes inherited from SMW\SPARQLStore\RepositoryConnectors\GenericHttpRepositoryConnector
 $repositoryClient
 
 $httpRequest
 

Detailed Description

Virtuoso specific adjustments for GenericHttpDatabaseConnector

Specific modifications of the SPARQL database implementation for Virtuoso. In particular, Virtuoso does not support SPARQL Update but only the non-standard SPARUL protocol that requires different syntax for update queries. If future versions of Virtuoso support SPARQL Update, the standard SPARQL database connector should work properly.

Virtuoso uses the SPARQL query endpoint for updates as well. So both $smwgSparqlUpdateEndpoint and $smwgSparqlQueryEndpoint should be something like 'http://localhost:8890/sparql/'. $smwgSparqlDataEndpoint should be left empty.

A graph is always needed, i.e., $smwgSparqlDefaultGraph must be set to some graph name (URI).

Known limitations: (might be fixed in recent Virtuoso versions, please let us know)

GNU GPL v2+

Since
1.7.1
Author
Markus Krötzsch

Member Function Documentation

SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector::delete (   $deletePattern,
  $where,
  $extraNamespaces = array() 
)

DELETE wrapper. The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.

Parameters
$deletePatternstring CONSTRUCT pattern of tripples to delete
$wherestring condition for data to delete
$extraNamespacesarray (associative) of namespaceId => namespaceUri
Returns
boolean stating whether the operations succeeded

Implements SMW\SPARQLStore\RepositoryConnection.

SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector::deleteData (   $triples,
  $extraNamespaces = array() 
)

DELETE DATA wrapper. The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.

Parameters
$triplesstring of triples to delete
$extraNamespacesarray (associative) of namespaceId => namespaceUri
Returns
boolean stating whether the operations succeeded
SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector::doUpdate (   $sparql)

Execute a SPARQL update and return a boolean to indicate if the operations was successful.

Virtuoso expects SPARQL updates to be posted using the "query" parameter (rather than "update").

Parameters
$sparqlstring with the complete SPARQL update query (INSERT or DELETE)
Returns
boolean

Implements SMW\SPARQLStore\RepositoryConnection.

SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector::insertData (   $triples,
  $extraNamespaces = array() 
)

INSERT DATA wrapper. The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.

Parameters
$triplesstring of triples to insert
$extraNamespacesarray (associative) of namespaceId => namespaceUri
Returns
boolean stating whether the operations succeeded
SMW\SPARQLStore\RepositoryConnectors\VirtuosoHttpRepositoryConnector::insertDelete (   $insertPattern,
  $deletePattern,
  $where,
  $extraNamespaces = array() 
)

INSERT DELETE wrapper. The function declares the standard namespaces wiki, swivt, rdf, owl, rdfs, property, xsd, so these do not have to be included in $extraNamespaces.

Parameters
$insertPatternstring CONSTRUCT pattern of tripples to insert
$deletePatternstring CONSTRUCT pattern of tripples to delete
$wherestring condition for data to delete
$extraNamespacesarray (associative) of namespaceId => namespaceUri
Returns
boolean stating whether the operations succeeded

The documentation for this class was generated from the following file: