public function EasyRdf_Graph::isA

Check if a resource is of the specified type

Parameters

string $resource The resource to check the type of:

string $type The type to check (e.g. foaf:Person):

Return value

boolean True if resource is of specified type

File

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

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function isA($resource, $type) {
  $this
    ->checkResourceParam($resource, true);
  $type = EasyRdf_Namespace::expand($type);
  foreach ($this
    ->all($resource, 'rdf:type', 'resource') as $t) {
    if ($t
      ->getUri() == $type) {
      return true;
    }
  }
  return false;
}