static function deleteGraph($graph, $endpoint) { //FIXME Not sparql for 4store $s = new FourStore_Store($endpoint); $r = $s->delete($graph); if (!$r) { $msg = "Query delete Graph"; throw new Exception($msg); } }
// addTripleToGraph($userGraph, makeTriple($s, $p, $o)); // if (substr($s, 0, strlen($autoGraphURL)) == $autoGraphURL) // { // $newS = str_replace($autoGraphURL, $userGraphURL, $s); // addTripleToGraph($userGraph, makeTriple($newS, 'a' , 'http://signage.ecs.soton.ac.uk/ontologies/location#Space')); // addTripleToGraph($userGraph, makeTriple($newS, 'http://purl.org/ontomedia/core/expression#is-shadow-of' , $s)); // addTripleToGraph($userGraph, makeTriple($newS, 'http://www.w3.org/2000/01/rdf-schema#label' ,$o)); // // } // else // { // addTripleToGraph($userGraph, makeTriple($s, $p, $o)); // } // } } $results['Deleting Graph'] = $sWrite->delete($userGraphURL); $allTriples = ""; foreach ($userGraph as $triple) { $allTriples .= makeTurtleFromTriple($triple) . "\n"; } $results['Adding All Triples'] = $sWrite->add($userGraphURL, $allTriples); header('Location: ' . $continueURL); exit(0); print '<' . '?xml version="1.1" encoding="iso-8859-1"?>' . "\n"; print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n"; function addTripleToGraph(&$graph, $triple) { $graph[md5($triple['s'] . $triple['p']) . $triple['o']] = $triple; } function deleteTripleFromGraph(&$graph, $triple) {