You are here

public function EasyRdf_Literal::toRdfPhp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php \EasyRdf_Literal::toRdfPhp()

Returns the properties of the literal as an associative array

For example: array('type' => 'literal', 'value' => 'string value')

Return value

array The properties of the literal

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php, line 282

Class

EasyRdf_Literal
Class that represents an RDF Literal

Code

public function toRdfPhp() {
  $array = array(
    'type' => 'literal',
    'value' => $this->value,
  );
  if ($this->datatype) {
    $array['datatype'] = $this->datatype;
  }
  if ($this->lang) {
    $array['lang'] = $this->lang;
  }
  return $array;
}