/**
  * Mine new relationships for given sid and returns all inforamtion about all realtiosnhips for given sid.
  * Also after mining new relatiosnhips are added into neo4j and triggers background calculation of datamathcing ratios for newsly mined relationships.
  *   
  * @param [type] $sid sid of the story for which mining should be performed.
  */
 public function MineRelationships($sid)
 {
     $relationshipDao = new RelationshipDAO();
     // get ids of relationships which were minded (not existed before) for given sid.
     $newRelsMined = $relationshipDao->mineRelationships($sid);
     //var_dump($newRelsMined);
     // if there were any new raltiosnihps mined, we need to add them to Neo4j and trigger background computation of datamatching ratios.
     if (isset($newRelsMined)) {
         // add those just mined relationships to neo4j
         $neo4JDAO = new Neo4JDAO();
         $neo4JDAO->addRelationshipsByRelIds($newRelsMined);
         // triger background execution of data matching ration calcualtion.
         $dataMatcher = new DataMatcher();
         $dataMatcher->calculateDataMatchingRatios($newRelsMined);
     }
     // get info to display in Relatiosnhips table of all relationships for given sid.
     $res = $relationshipDao->getAllRelationshipInfoBySid($sid);
     return $res;
 }