private boolean isSame(final Relation a,final Relation b){
  boolean sameSourceTarget=false;
  if (isSame(a.getSource(),b.getSource()) && isSame(a.getTarget(),b.getTarget())) {
    sameSourceTarget=true;
  }
 else   if (symmetric && isSame(a.getSource(),b.getTarget()) && isSame(a.getTarget(),b.getSource())) {
    sameSourceTarget=true;
  }
  return sameSourceTarget && isSame(a.getRelationshipType(),b.getRelationshipType()) && isSame(a.getRelationSubType(),b.getRelationSubType());
}

private boolean isSame ( final Relation a , final Relation b ) { boolean sameSourceTarget = false ; if ( isSame ( a . getSource ( ) , b . getSource ( ) ) && isSame ( a . getTarget ( ) , b . getTarget ( ) ) ) { sameSourceTarget = true ; } else if ( symmetric && isSame ( a . getSource ( ) , b . getTarget ( ) ) && isSame ( a . getTarget ( ) , b . getSource ( ) ) ) { sameSourceTarget = true ; } return sameSourceTarget && isSame ( a . getRelationshipType ( ) , b . getRelationshipType ( ) ) && isSame ( a . getRelationSubType ( ) , b . getRelationSubType ( ) ) ; }
checks if relations are the same .
