function test() { $s = new URI('http://dbpedia.org/resource/London'); $lang = 'en'; $store = new SPARQLToRDFTriple($s, $lang); $query = 'SELECT * WHERE {?s ?p ?o} Limit 10'; $subject = array('action' => 'classattribute', 'value' => null); $subject = array('action' => 'variable', 'value' => 's'); $predicate = array('action' => 'variable', 'value' => 'p'); $object = array('action' => 'variable', 'value' => 'o'); $r = $store->getRDFTriples($query, $subject, $predicate, $object); /* foreach ($r as $one){ echo $one->toNTriples(); } */ return $r; }
private function _http_retrieve_odbc_sparul_delete_language($languageProperties, $graphURI) { Timer::start('LiveUpdateDestination::_http_retrieve_odbc_sparul_delete_language'); $store = new SPARQLToRDFTriple($this->uri, $this->language); $languageTriples = $store->getRDFTripleForLangProperties($languageProperties); $this->log(DEBUG, 'retrieved triples to be deleted, language : ' . count($languageTriples)); $sparul = ""; foreach ($languageTriples as $triple) { $this->counterDelete += 1; $sparul .= ' ' . $this->subjectSPARULpattern; $sparul .= ' ' . $triple->getPredicate()->toSPARULPattern(); $sparul .= ' ' . $triple->getObject()->toSPARULPattern(); $sparul .= " .\n"; } $sparul = 'DELETE FROM <' . $graphURI . '> WHERE { ' . $sparul . ' }'; $this->_odbc_sparul_execute($sparul); Timer::stop('LiveUpdateDestination::_http_retrieve_odbc_sparul_delete_language'); }