Skip to content

Remote Stores and Endpoints

semsol edited this page Mar 11, 2011 · 3 revisions

ARC provides a RemoteStore component (starting with revision 2008-07-04 and based on Morten Frederiksen's excellent RemoteEndpointPlugin) which makes it possible to work with SPARQL (and SPARQL+) endpoints (almost) as if they were local stores (please see "Using ARC's RDF Store" for general methods and options).

Setup

A remote store is instantiated like a local store, but with a remote_store_endpoint configuration parameter instead of database settings:

/* ARC2 static class inclusion */ 
include_once('path/to/arc/ARC2.php');

/* configuration */ 
$config = array(
  /* remote endpoint */
  'remote_store_endpoint' => 'http://example.com/sparql',
);

/* instantiation */
$store = ARC2::getRemoteStore($config);

Running Queries

$q = 'SELECT ...';
$rows = $store->query($q, 'rows');
...

Unsupported methods

A couple of the usual store methods are not available while working with remote endpoints:

  • hasSetting(), getSetting(), setSetting()
  • reset()
  • drop()
  • dump() (you can use DUMP as non-standard SPARQL query, if supported)
  • createBackup()
  • renameTo()
  • replicateTo()
  • consolidation methods