3 homepage: http://arc.semsol.org/
4 license: http://arc.semsol.org/license
6 class: ARC2 RDF Store INSERT Query Handler
7 author: Benjamin Nowack
8 version: 2007-09-11 (Fix: empty CONSTRUCT results were not caught, which led to a GET in LOAD
9 Tweak: INSERT CONSTRUCT will keep bnode ids unchanged)
12 ARC2::inc('StoreQueryHandler');
14 class ARC2_StoreInsertQueryHandler extends ARC2_StoreQueryHandler {
16 function __construct($a = '', &$caller) {/* caller has to be a store */
17 parent::__construct($a, $caller);
20 function ARC2_StoreInsertQueryHandler($a = '', &$caller) {
21 $this->__construct($a, $caller);
24 function __init() {/* db_con */
26 $this->store =& $this->caller;
31 function runQuery($infos, $keep_bnode_ids = 0) {
32 $this->infos = $infos;
33 $con = $this->store->getDBCon();
35 if (!$this->v('pattern', array(), $this->infos['query'])) {
36 return $this->store->insert($this->infos['query']['construct_triples'], $this->infos['query']['target_graph'], $keep_bnode_ids);
40 ARC2::inc('StoreConstructQueryHandler');
41 $h =& new ARC2_StoreConstructQueryHandler($this->a, $this->store);
42 if ($sub_r = $h->runQuery($this->infos)) {
43 return $this->store->insert($sub_r, $this->infos['query']['target_graph'], $keep_bnode_ids);
45 return array('t_count' => 0, 'load_time' => 0);