You are here

public function EasyRdf_Sparql_Client::insert in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php \EasyRdf_Sparql_Client::insert()

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php, line 182

Class

EasyRdf_Sparql_Client
Class for making SPARQL queries using the SPARQL 1.1 Protocol

Code

public function insert($data, $graphUri = null) {

  #$this->updateData('INSET',
  $query = 'INSERT DATA {';
  if ($graphUri) {
    $query .= "GRAPH <{$graphUri}> {";
  }
  $query .= $this
    ->convertToTriples($data);
  if ($graphUri) {
    $query .= "}";
  }
  $query .= '}';
  return $this
    ->update($query);
}