Source for file IteratorFindQuadsMem.php
Documentation is available at IteratorFindQuadsMem.php
require_once RDFAPI_INCLUDE_DIR .
'dataset/Quad.php';
// ----------------------------------------------------------------------------------
// Class: IteratorFindQuadsMem
// ----------------------------------------------------------------------------------
* Implementation of a quad iterator.
* This Iterator should be used like:
* for($iterator = $dataset->findInNamedGraphs(null,null,null,null); $iterator->valid(); $iterator->next())
* $currentQuad=$it->current();
* @version $Id: fsource_dataset__datasetIteratorFindQuadsMem.php.html 442 2007-06-01 16:19:26Z cax $
* @author Daniel Westphal (http://d-westphal.de)
* key value in the current graph.
* boolean value, if the results should be returned as triples.
* If the current resource is valid.
* The current NamedGraph.
* The graphName Resource to search for.
* The subject Resource to search for.
* The predicate Resource to search for.
* The object Resource to search for.
* Iterator over all graphs of the RDF dataset.
* $subject, $predicate, and $object are used like find().
* $getSPO supports the strings 's', 'p', and 'o' to return
* either the subject, predicate, or object of the result statements.
$this->findSubject=
$subject;
$this->findPredicate=
$predicate;
$this->findObject=
$object;
$this->graphIterator=
&$graphIterator;
$this->returnAsTriples=
$returnAsTriples;
* Resets iterator list to start.
$this->graphIterator->rewind();
* Says if there are additional items left in the list.
* Moves Iterator to the next item in the list.
if($this->graphIterator->valid()===
false)
$currentGraph=
&$this->graphIterator->current();
$this->current=
$currentGraph->findFirstMatchingStatement($this->findSubject,$this->findPredicate,$this->findObject,++
$this->graphKey);
$this->graphIterator->next();
if($this->graphIterator->valid()===
false)
$currentGraph=
&$this->graphIterator->current();
$this->current=
$currentGraph->findFirstMatchingStatement($this->findSubject,$this->findPredicate,$this->findObject,++
$this->graphKey);
} while ($this->current==
null);
* Returns the current item.
if($this->returnAsTriples) return $this->current;
$currentGraph=
&$this->graphIterator->current();
return new Quad(new Resource($currentGraph->getGraphName()),$this->current->getSubject(),$this->current->getPredicate(),$this->current->getObject());
* Returns the key of the current item.
Documentation generated on Fri, 1 Jun 2007 16:49:37 +0200 by phpDocumentor 1.3.2