%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  ENTITY-RELATIONSHIP-RELATIONAL TRANSFORMATION EXAMPLE
%  Author: Jesus Almendros and Luis Iribarne. March 2012.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



 

 
%COMPLETION MODEL A

mmA:keyAttribute(C) and mmA:key_name(C,N) and mmA:key_type(C,T):-mmA:attribute(C) and mmA:key(C,D) and equal(D,literal(type(_,true))) and mmA:name(C,N) and mmA:type(C,T).

mmA:nonkeyAttribute(C) and mmA:nonkey_name(C,N) and mmA:nonkey_type(C,T):-mmA:attribute(C) and mmA:key(C,D) and equal(D,literal(type(_,false))) and mmA:name(C,N) and mmA:type(C,T).

mmA:navigable_role(C) and mmA:inv_qualifier_name(C,N)
                  and mmA:inv_qualifier_type(C,T):-
            mmA:data(A) and mmA:role_of(A,C) and
            mmA:navigable(C,E) and equal(E,literal(type(_,true))) and mmA:has_role(C,D)
            and mmA:is_role(D,D2) and differentFrom(D2,C) and mmA:is(D2,D3) and
            mmA:name(D3,N) and mmA:type(D3,T).