 

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

class(Name,Id):-element(ownedMember,_,Id),
		att('xmi:type','uml:Class',Id,_),
		att(name,Name,Id,_).




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

stereotype(Name,Id):-element(ownedMember,_,Id),
			att('xmi:type','uml:Stereotype',Id,_),
			att(name,Name,Id,_).
 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PROPERTY 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


property(Name,Type,Is_Composite,false,Lower,Upper,false,IdF,Id):-  
		element(ownedEnd,IdF,Id),
		att('xmi:type','uml:Property',Id,_),
		att(name,Name,Id,_),
		(element(upperValue,Id,IdC),
		att(value,Upperval,IdC,_) ->
		Upper=Upperval;Upper=null), 
		(element(lowerValue,Id,IdC),
		att(value,Lowerval,IdC,_) ->
		Lower=Lowerval;Lower=null), 
		(att(aggregation,'none',Id,_) -> 
		Is_Composite=false;Is_Composite=true),
		att(type,Id_class,Id,_),
		element(ownedMember,_,Type),
		att('xmi:id',Id_class,Type,_).
		

 

property(Name,Type,false,Is_unique,'1','1',false,IdF,Id):-  
		element(ownedAttribute,IdF,Id),
		(element('xmi:Extension',Id,IdE),
		element(unique,IdE,IdU),
		att('xmi:value',true,IdU,_)->
		Is_unique=true;Is_unique=false),
		att(name,Name,Id,_),
		(att(type,TypeA,Id,_)->
		Type=TypeA;Type=null).

 

property(Name,Type,false,false,'1','1',true,IdP,Id):-
		element(ownedEnd,_,IdP),
		att('xmi:type','uml:Property',IdP,_), 		 
		element(qualifier,IdP,Id),
		att(name,Name,Id,_),
		(att(type,TypeA,Id,_)->
		Type=TypeA;Type=null).
		

			


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

association(Name,Id):-element(ownedMember,_,Id),
		att('xmi:type','uml:Association',Id,_),
		att(name,Name,Id,_).




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ASSOCIATIONENDS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

associationEnds(ownedEnd,IdA,IdC):- element(ownedEnd,IdA,IdC).


associationEnds(ownedAttribute,IdF,IdC):-element(ownedMember,_,IdF),
					element(ownedAttribute,IdF,IdC).
							
associationEnds(navigableOwnedEnd,IdF,IdC):-associationEnds(ownedEnd,IdF,IdC),
					att('isNavigable','true',IdC,_).


 
