Lines Matching refs:predicate
119 function removeTriples($subject=null, $predicate=null, $object=null, $graph=null) {
122 foreach(array('subject','predicate','object','graph') as $param) {
149 function fetchTriples($subject=null, $predicate=null, $object=null, $graph=null) {
154 foreach(array('subject','predicate','object','graph') as $param) {
176 $sql = "SELECT subject, predicate, object, graph FROM ".self::$readable." WHERE ". implode(" AND ", $filters).$scopeRestriction;
200 * @param predicate string
205 function addTriple($subject, $predicate, $object, $graph) {
206 return $this->addTriples(array(array('subject'=>$subject, 'predicate'=>$predicate, 'object'=>$object)), $graph);
211 * @param triples array contains all triples as arrays with subject, predicate and object keys
217 $sql = "INSERT INTO ".self::$writable."(subject, predicate, object, graph) VALUES(?, ?, ?, ?)";
225 $values = array($t['subject'],$t['predicate'],$t['object'],$graph);
303 'predicate'=>array('type'=>'variable','text'=>'__predicate'),
436 // the predicate is a literal
437 if($tp['predicate']['type'] == 'literal') {
439 $conditions[] = $this->_ci('predicate').' = '.$this->_ci(':'.$id);
440 $this->literals[$id] = $tp['predicate']['text'];
450 // subject equals predicate
451 if($this->_patternEquals($tp['subject'],$tp['predicate'])) {
452 $conditions[] = $this->_ci('subject').' = '.$this->_ci('predicate');
460 // predicate equals object
461 if($this->_patternEquals($tp['predicate'],$tp['object'])) {
462 $conditions[] = $this->_ci('predicate').' = '.$this->_ci('object');
481 // project the predicate if it's different from the subject
482 if(!$this->_patternEquals($tp['subject'], $tp['predicate'])) {
483 $list[] = 'predicate AS '.$this->_name($tp['predicate']);
486 // project the object if it's different from the subject and different from the predicate
487 if(!$this->_patternEquals($tp['subject'], $tp['object']) && !$this->_patternEquals($tp['predicate'],$tp['object'])) {
506 // the predicate is a variable
507 if($tp['predicate']['type'] == 'variable') {
508 $terms[] = $this->_name($tp['predicate']);