You are here

public function EasyRdf_GraphStore::get in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php \EasyRdf_GraphStore::get()

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

EasyRdf_Graph The graph requested

1 call to EasyRdf_GraphStore::get()
EasyRdf_GraphStore::getDefault in vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php
Fetch default graph from the graph store

File

vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php, line 85

Class

EasyRdf_GraphStore
A class for fetching, saving and deleting graphs to a Graph Store. Implementation of the SPARQL 1.1 Graph Store HTTP Protocol.

Code

public function get($uriRef) {
  if ($uriRef === self::DEFAULT_GRAPH) {
    $dataUrl = $this
      ->urlForGraph(self::DEFAULT_GRAPH);
    $graph = new EasyRdf_Graph();
  }
  else {
    $graphUri = $this->parsedUri
      ->resolve($uriRef)
      ->toString();
    $dataUrl = $this
      ->urlForGraph($graphUri);
    $graph = new EasyRdf_Graph($graphUri);
  }
  $graph
    ->load($dataUrl);
  return $graph;
}