You are here

public function EasyRdf_Resource::getLiteral in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php \EasyRdf_Resource::getLiteral()

Get a single literal value for a property of the resource

If multiple values are set for a property then the value returned may be arbitrary.

This method will return null if there is not literal value for the property.

Parameters

string|array $property The name of the property (e.g. foaf:name):

string $lang The language to filter by (e.g. en):

Return value

object EasyRdf_Literal Literal value associated with the property

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php, line 380

Class

EasyRdf_Resource
Class that represents an RDF resource

Code

public function getLiteral($property, $lang = null) {
  $this
    ->checkHasGraph();
  return $this->graph
    ->get($this->uri, $property, 'literal', $lang);
}