function runQuery($infos, $keep_bnode_ids = 0) { $this->infos = $infos; $con = $this->store->getDBCon(); /* insert */ if (!$this->v('pattern', array(), $this->infos['query'])) { return $this->store->insert($this->infos['query']['construct_triples'], $this->infos['query']['target_graph'], $keep_bnode_ids); } else { $keep_bnode_ids = 1; ARC2::inc('StoreConstructQueryHandler'); $h = new ARC2_StoreConstructQueryHandler($this->a, $this->store); if ($sub_r = $h->runQuery($this->infos)) { return $this->store->insert($sub_r, $this->infos['query']['target_graph'], $keep_bnode_ids); } return array('t_count' => 0, 'load_time' => 0); } }
function deleteConstructedGraph() { ARC2::inc('StoreConstructQueryHandler'); $h = new ARC2_StoreConstructQueryHandler($this->a, $this->store); $sub_r = $h->runQuery($this->infos); $triples = ARC2::getTriplesFromIndex($sub_r); $tgs = $this->infos['query']['target_graphs']; $this->infos = array('query' => array('construct_triples' => $triples, 'target_graphs' => $tgs)); return $this->deleteTriples(); }