Example #1
0
 /**
  * Removes a single Fragment from RDF Store by deleting all triples describing the Fragment URI
  * WARNING: As far as triples extracted from the RDFa representation of a given fragment are concerned,
  *          this method only removes the following:
  *			1) fragmentURI loomp:contains sommeURI .
  *			2) all triples: someURI someProperty someOtherURI  or   someURI someProperty someLiteral
  *		    If there are other triples further describing someOtherURI they will not be removed, becuase this
  * 		    requires the analysis of the entire RDF graph, i.e. the paths from someOtherURI to other fragmentURIs.
  *		    At this point I do not have sufficient test data to play with. --> future work
  *
  * @param Fragment	$fragment	Fragment Object
  */
 private function _removeFragment($fragment)
 {
     $it = $this->rdfModel->find(new Resource($fragment->getUri()), LOOMP::CONTAINS(), NULL)->getStatementIterator();
     $this->_removeResWithAllProps($fragment->getUri());
     // remove all triples describing a given resource which is not contained in any other fragment
     while ($it->hasNext()) {
         $s = $it->next();
         $obj = $s->getObject();
         if ($this->rdfModel->findCount(NULL, LOOMP::CONTAINS(), $obj) == 0) {
             $this->_removeResWithAllProps($obj->getURI());
         }
     }
 }