protected function EasyRdf_Graph::classForResource

Work out the class to instantiate a resource as @ignore

2 calls to EasyRdf_Graph::classForResource()
EasyRdf_Graph::dumpResource in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Return a human readable view of a resource and its properties
EasyRdf_Graph::resource in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Get or create a resource stored in a graph

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 159

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

protected function classForResource($uri) {
  $resClass = 'EasyRdf_Resource';
  $rdfType = EasyRdf_Namespace::expand('rdf:type');
  if (isset($this->index[$uri][$rdfType])) {
    foreach ($this->index[$uri][$rdfType] as $type) {
      if ($type['type'] == 'uri' or $type['type'] == 'bnode') {
        $class = EasyRdf_TypeMapper::get($type['value']);
        if ($class != null) {
          $resClass = $class;
          break;
        }
      }
    }
  }
  return $resClass;
}