public function EasyRdf_Graph::label

Get a human readable label for a resource

This method will check a number of properties for a resource (in the order: skos:prefLabel, rdfs:label, foaf:name, dc:title) and return an approriate first that is available. If no label is available then it will return null.

Return value

string A label for the resource.

File

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

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function label($resource = null, $lang = null) {
  $this
    ->checkResourceParam($resource, true);
  if ($resource) {
    return $this
      ->get($resource, 'skos:prefLabel|rdfs:label|foaf:name|dc:title|dc11:title', 'literal', $lang);
  }
  else {
    return null;
  }
}