You are here

public function EasyRdf_Graph::typeAsResource in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php \EasyRdf_Graph::typeAsResource()

Get the resource type of the graph as a EasyRdf_Resource

If the graph has multiple types then the type returned may be arbitrary. This method will return null if the resource has no type.

Return value

object EasyRdf_Resource A type assocated with the resource

1 call to EasyRdf_Graph::typeAsResource()
EasyRdf_Graph::type in vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Get the resource type of the graph

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 1418

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function typeAsResource($resource = null) {
  $this
    ->checkResourceParam($resource, true);
  if ($resource) {
    return $this
      ->get($resource, 'rdf:type', 'resource');
  }
  return null;
}