Exemple #1
0
 /**
  * Dumps of the InfModelB including ALL inferable triples.
  *
  * @access	public 
  * @return	string 
  */
 function toStringIncludingTriples()
 {
     $dump = $this->toString() . chr(13);
     $stateIt = new StatementIterator($this->find(null, null, null));
     while ($statement = $stateIt->next()) {
         $dump .= $statement->toString() . chr(13);
     }
     return $dump;
 }
Exemple #2
0
 /**
  * Adds another model to this MemModel.
  * Duplicate statements are not removed.
  * If you don't want duplicates, use unite().
  * If any statement of the model to be added to this model contains a blankNode
  * with an identifier already existing in this model, a new blankNode is generated.
  *
  * @param	object Model	$model
  * @access	public
  * @throws phpErrpr
  *
  */
 function addModel(&$model)
 {
     if (!is_a($model, 'Model')) {
         $errmsg = RDFAPI_ERROR . '(class: MemModel; method: addModel): Model expected.';
         trigger_error($errmsg, E_USER_ERROR);
     }
     $blankNodes_tmp = array();
     if (is_a($model, 'MemModel')) {
         require_once RDFAPI_INCLUDE_DIR . 'util/StatementIterator.php';
         $stateIt = new StatementIterator($model);
         while ($statement = $stateIt->next()) {
             $this->_addStatementFromAnotherModel($statement, $blankNodes_tmp);
         }
         $this->addParsedNamespaces($model->getParsedNamespaces());
     } elseif (is_a($model, 'DbModel')) {
         $memModel =& $model->getMemModel();
         foreach ($memModel->triples as $value) {
             $this->_addStatementFromAnotherModel($value, $blankNodes_tmp);
         }
     }
     $this->index($this->indexed);
 }