public function testSelectSerializeAndDelete()
{
global $EndPoint4store, $modeDebug, $prefixSparql, $prefixTurtle, $graph1, $graph2;
$s = new Endpoint($EndPoint4store, false, $modeDebug);
$this->checkIfInitialState($s);
$r = $s->set($graph1, $prefixTurtle . "\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\t\t\t\t\ta:A b:Name \"Test2\"@en.\n\t\t\t\t\ta:A b:Name \"Test3\"@fr.\n\t\t\t\t\ta:A b:Name \"Test4\".\n\t\t\t\t\ta:A b:date \"2010-03-09T22:30:00Z\"^^xsd:dateTime .\n\t\t\t\t\t");
$q = $prefixSparql . "\n select * where {GRAPH <" . $graph1 . "> {a:A ?p ?o.}} ";
$triples = $s->query($q, 'rows');
$err = $s->getErrors();
if ($err) {
print_r($err);
$this->assertTrue(false);
}
for ($i = 0, $i_max = count($triples); $i < $i_max; $i++) {
$triples[$i]['s'] = "http://example.com/test/a/A";
$triples[$i]['s type'] = "uri";
}
//print_r($triples);
/* Serializer instantiation */
$ser = ARC2::getNTriplesSerializer();
/* Serialize a triples array */
$docd = $ser->getSerializedTriples($triples, 1);
$q = "DELETE DATA { \n\t\t\t\tGRAPH <" . $graph1 . "> { \n\t\t\t\t{$docd} \n \t\t}}";
//print_r($q);
$res = $s->query($q, 'raw');
$err = $s->getErrors();
if ($err) {
print_r($err);
$this->assertTrue(false);
}
$this->assertTrue($res);
$this->checkIfInitialState($s);
}