bridgepoint/ooaofooa.py
def mk_simple_association(m, r_simp):
    '''
    Create a pyxtuml association from a simple association in BridgePoint.
    '''
    r_rel = one(r_simp).R_REL[206]()

    r_form = one(r_simp).R_FORM[208]()
    r_part = one(r_simp).R_PART[207]()
    
    r_rgo = one(r_form).R_RGO[205]()
    r_rto = one(r_part).R_RTO[204]()
    
    if not r_form:
        logger.info('unformalized association R%s' % (r_rel.Numb))
        r_form = one(r_simp).R_PART[207](lambda sel: sel != r_part)
        r_rgo = one(r_form).R_RTO[204]()
        
    source_o_obj = one(r_rgo).R_OIR[203].O_OBJ[201]()
    target_o_obj = one(r_rto).R_OIR[203].O_OBJ[201]()
    source_ids, target_ids = _get_related_attributes(r_rgo, r_rto)

    if source_o_obj.Obj_ID != target_o_obj.Obj_ID:
        source_phrase = target_phrase = ''
    else:
        source_phrase = r_part.Txt_Phrs
        target_phrase = r_form.Txt_Phrs
            
    m.define_association(rel_id=r_rel.Numb, 
                         source_kind=source_o_obj.Key_Lett,
                         target_kind=target_o_obj.Key_Lett,
                         source_keys=source_ids,
                         target_keys=target_ids,
                         source_conditional=r_form.Cond,
                         target_conditional=r_part.Cond,
                         source_phrase=source_phrase,
                         target_phrase=target_phrase,
                         source_many=r_form.Mult,
                         target_many=r_part.Mult)
def mk_simple_association(m, r_simp):
    '''
    Create a pyxtuml association from a simple association in BridgePoint.
    '''
    r_rel = one(r_simp).R_REL[206]()

    r_form = one(r_simp).R_FORM[208]()
    r_part = one(r_simp).R_PART[207]()
    
    r_rgo = one(r_form).R_RGO[205]()
    r_rto = one(r_part).R_RTO[204]()
    
    if not r_form:
        logger.info('unformalized association R%s' % (r_rel.Numb))
        r_form = one(r_simp).R_PART[207](lambda sel: sel != r_part)
        r_rgo = one(r_form).R_RTO[204]()
        
    source_o_obj = one(r_rgo).R_OIR[203].O_OBJ[201]()
    target_o_obj = one(r_rto).R_OIR[203].O_OBJ[201]()
    source_ids, target_ids = _get_related_attributes(r_rgo, r_rto)

    if source_o_obj.Obj_ID != target_o_obj.Obj_ID:
        source_phrase = target_phrase = ''
    else:
        source_phrase = r_part.Txt_Phrs
        target_phrase = r_form.Txt_Phrs
            
    m.define_association(rel_id=r_rel.Numb, 
                         source_kind=source_o_obj.Key_Lett,
                         target_kind=target_o_obj.Key_Lett,
                         source_keys=source_ids,
                         target_keys=target_ids,
                         source_conditional=r_form.Cond,
                         target_conditional=r_part.Cond,
                         source_phrase=source_phrase,
                         target_phrase=target_phrase,
                         source_many=r_form.Mult,
                         target_many=r_part.Mult)
def mk_simple_association ( m , r_simp ) : r_rel = one ( r_simp ) . R_REL [ 206 ] ( ) r_form = one ( r_simp ) . R_FORM [ 208 ] ( ) r_part = one ( r_simp ) . R_PART [ 207 ] ( ) r_rgo = one ( r_form ) . R_RGO [ 205 ] ( ) r_rto = one ( r_part ) . R_RTO [ 204 ] ( ) if not r_form : logger . info ( 'unformalized association R%s' % ( r_rel . Numb ) ) r_form = one ( r_simp ) . R_PART [ 207 ] ( lambda sel : sel != r_part ) r_rgo = one ( r_form ) . R_RTO [ 204 ] ( ) source_o_obj = one ( r_rgo ) . R_OIR [ 203 ] . O_OBJ [ 201 ] ( ) target_o_obj = one ( r_rto ) . R_OIR [ 203 ] . O_OBJ [ 201 ] ( ) source_ids , target_ids = _get_related_attributes ( r_rgo , r_rto ) if source_o_obj . Obj_ID != target_o_obj . Obj_ID : source_phrase = target_phrase = '' else : source_phrase = r_part . Txt_Phrs target_phrase = r_form . Txt_Phrs m . define_association ( rel_id = r_rel . Numb , source_kind = source_o_obj . Key_Lett , target_kind = target_o_obj . Key_Lett , source_keys = source_ids , target_keys = target_ids , source_conditional = r_form . Cond , target_conditional = r_part . Cond , source_phrase = source_phrase , target_phrase = target_phrase , source_many = r_form . Mult , target_many = r_part . Mult )
Create a pyxtuml association from a simple association in BridgePoint.
Create a pyxtuml association from a simple association in BridgePoint .