def add_rel(self, source_id, target_id, rel):
        ''' Cache aware add_rel '''
        if (source_id, target_id) not in self.rel_cache:
            self.workbench.add_rel(source_id, target_id, rel)
            self.rel_cache.add((source_id, target_id))
def add_rel ( self , source_id , target_id , rel ) : if ( source_id , target_id ) not in self . rel_cache : self . workbench . add_rel ( source_id , target_id , rel ) self . rel_cache . add ( ( source_id , target_id ) )
Cache aware add_rel