Exemplo n.º 1
0
 /**
  * General method to search for triples.
  * NULL input for any parameter will match anything.
  * Example:  $result = $m->find( NULL, NULL, $node );
  * Finds all triples with $node as object.
  * Returns an empty MemModel if nothing is found.
  * To improve the search speed with big Models, call index(INDEX_TYPE) 
  * before seaching.
  *
  * It recursively searches in the statements and rules to find 
  * matching statements.
  *
  * @param	object Node	$subject
  * @param	object Node	$predicate
  * @param	object Node	$object
  * @return	object MemModel
  * @access	public
  * @throws	PhpError
  */
 function find($subject, $predicate, $object)
 {
     $searchStringIndex = array();
     $resultModel = new MemModel();
     //add all infered statements without duplicates to the result model
     foreach ($this->_infFind($subject, $predicate, $object, array()) as $statement) {
         $resultModel->addWithoutDuplicates($statement);
     }
     return $resultModel;
 }