Exemplo n.º 1
0
 /**
  * Adds colfusion relationship between two stories. Also addes neo4j relationship and nodes if needed. And trigres backgroun computatio of datamatching ratios.
  * @param [type] $user_id     id of the user who adds new relationships.
  * @param [type] $name        name of the relationship.
  * @param [type] $description short textual description for new relationship.
  * @param [type] $from        object containing info about From dataset sid and columns of the relationships from From dataset. TODO: create a class for that object.
  * @param [type] $to          object containing info about To dataset sid and columns of the relationships from To dataset. TODO: the class class as for From should be used.
  * @param [type] $confidence  confidence value for the relationship.
  * @param [type] $comment     shor textual comment for the relationship.
  */
 public function AddRelationship($user_id, $name, $description, $from, $to, $confidence, $comment)
 {
     // Add new relationshp in to colfusion
     $relationshipDao = new RelationshipDAO();
     $rel_id = $relationshipDao->addRelationship($user_id, $name, $description, $from, $to, $confidence, $comment);
     // add newly created relationshiop to neo4j.
     $neo4JDAO = new Neo4JDAO();
     $neo4JDAO->addRelationshipByRelId($rel_id);
     // triger background execution of data matching ration calcualtion.
     $dataMatcher = new DataMatcher();
     $dataMatcher->calculateDataMatchingRatios(array($rel_id));
 }