Example #1
0
 /**
  * add a shown property, that is more complex.
  * provide own triples, they will wrapped in an optional and a projection var will be added.
  *
  * @param array                    $triples
  * @param Erfurt_Sparql_Query2_Var $var
  * @param boolean                  $hidden
  *
  * @return OntoWiki_Model_Instances
  */
 public function addShownPropertyCustom($triples, $var, $hidden = false)
 {
     //add
     $optional = new Erfurt_Sparql_Query2_OptionalGraphPattern();
     $optional->addElements($triples);
     $this->_valueQuery->getWhere()->addElement($optional);
     $this->_valueQuery->addProjectionVar($var);
     //save
     $this->_shownProperties['custom' . count($this->_shownProperties)] = array('uri' => null, 'name' => 'custom' . count($this->_shownProperties), 'inverse' => false, 'datatype' => null, 'varName' => $var->getName(), 'var' => $var, 'optionalpart' => $triples, 'filter' => array(), 'hidden' => $hidden);
     $this->_valuesUptodate = false;
     // getValues will not use the cache next time
     $this->_resultsUptodate = false;
     return $this;
 }