 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ELEMENT2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%OWNEDMEMBER%%%%%%%%%%%%%%%%

element2(ownedMember,0,Id):-class_id(mm2,Id).

element2(ownedMember,0,Id):-stereotype_id(mm2,Id).

element2(ownedMember,0,Id):-association_id(mm2,Id).

%%%%%%%OWNEDATTRIBUTE%%%%%%%%%%%%%%%%

element2(ownedAttribute,IdC,Id):-associationEnds(mm2,ownedAttribute,IdC,Id),
			property_id(mm2,Id).



element2('xmi:Extension',IdC,IdE):- 
				 associationEnds(mm2,extensions,IdC,IdE).

element2(appliedStereotype,IdE,[IdS,1]):-	
				associationEnds(mm2,extensions,_,IdE),
				associationEnds(mm2,stereotype,IdE,IdS).
element2(ownedEnd,Id1,Id2):-
				associationEnds(mm2,ownedEnd,Id1,Id2).
				 
element2(lowerValue,Id2,[Id2,1]):-
				associationEnds(mm2,ownedEnd,_,Id2).

element2(upperValue,Id2,[Id2,2]):-
				associationEnds(mm2,ownedEnd,_,Id2).

element2(memberEnd,Id1,[Id2,0]):-
				associationEnds(mm2,ownedEnd,Id1,Id2).
				





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ATT2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%CLASS%%%%%%%%% 

att2(name,Name,Id,Id):-class_name(mm2,Id,Name).

att2('xmi:type','uml:Class',Id,Id):-class_id(mm2,Id).

att2('xmi:id',Id,Id,Id):-class_id(mm2,Id).


%%%%%%%%OWNEDMEMBER%%%%%%%%%

att2('xmi:Extender','Visual Paradigm for UML',IdE,IdE):-associationEnds(mm2,extensions,_,IdE).



%%%%%%%STEREOTYPE%%%%%%%%%%%%%%

att2(name,Name,Id,Id):-stereotype_name(mm2,Id,Name).

att2('xmi:value',Id,[Id,1],Id):-stereotype_id(mm2,Id).

att2('xmi:type','uml:Stereotype',Id,Id):-stereotype_id(mm2,Id).

att2('xmi:id',Id,Id,Id):-stereotype_id(mm2,Id).

%%%%%%%%%PROPERTY%%%%%%%%%%%%%%%%
 
att2(name,Name,Id,Id):-property_name(mm2,Id,Name).

att2(type,Type,Id,Id):-property_type(mm2,Id,Type).

att2('xmi:id',Id,Id,Id):-property_id(mm2,Id).

att2('xmi:type','uml:Property',Id,Id):-property_id(mm2,Id).
			 
att2(isNavigable,true,Id,Id):-property_id(mm2,Id).

att2(aggregation,composite,Id,Id):-property_isComposite(mm2,Id,true).

att2(aggregation,none,Id,Id):-	property_isComposite(mm2,Id,false).

att2(value,Lower,[Id,1],[Id,1]):-property_lower(mm2,Id,Lower).

att2(value,Upper,[Id,2],[Id,2]):-property_upper(mm2,Id,Upper).

att2('xmi:id',Id,[Id,1],[Id,1]):-property_id(Id,mm2).

att2('xmi:id',Id,[Id,2],[Id,2]):-property_id(Id,mm2).

att2('xmi:type','uml:LiteralString',[Id,1],[Id,1]):-property_id(mm2,Id).

att2('xmi:type','uml:LiteralString',[Id,2],[Id,2]):-property_id(mm2,Id).

%%%%%%ASSOCIATION%%%%%%%%%%%%%

att2(name,Name,Id,Id):-association_name(mm2,Id,Name).

att2('xmi:id',Id,Id,Id):-association_id(mm2,Id).

att2(association,IdA,Id,Id):-associationEnds(mm2,ownedEnd,IdA,Id).

att2('xmi:idref',Id,[Id,0],[Id,0]):- associationEnds(mm2,ownedEnd,_,Id).
					
att2('xmi:type','uml:Association',Id,Id):-association_id(mm2,Id).




