Get the resource type of the graph
The type will be a shortened URI as a string. If the graph has multiple types then the type returned may be arbitrary. This method will return null if the resource has no type.
string A type assocated with the resource (e.g. foaf:Document)
public function type($resource = null) {
$this
->checkResourceParam($resource, true);
if ($resource) {
$type = $this
->get($resource, 'rdf:type', 'resource');
if ($type) {
return EasyRdf_Namespace::shorten($type);
}
}
return null;
}