
 

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

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




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

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


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


property(mm,Id,[name(Name),type(Type),isComposite(Is_Composite),isUnique(false),lower(Lower),upper(Upper)]):-  
		element(ownedEnd,_,Id),
		att('xmi:type','uml:Property',Id,_),
		(att(name,NameAss,Id,_)->Name=NameAss;Name=''),
		(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(mm,Id,[name(Name),type(Type),isComposite(false),isUnique(Is_unique),lower('1'),upper('1')]):-  
		element(ownedAttribute,_,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(mm,Id,[name(Name),type(Type),isComposite(false),isUnique(false),lower('1'),upper('1')]):-
		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(mm,Id,[name(Name)]):-element(ownedMember,_,Id),
		att('xmi:type','uml:Association',Id,_),
		att(name,Name,Id,_).

		

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% OWNEDEND
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

associationObjectsM(mm,ownedEnd,IdA,IdC):- element(ownedEnd,IdA,IdC).

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

associationObjectsM(mm,ownedAttribute,IdF,IdC):-element(ownedMember,_,IdF),
					element(ownedAttribute,IdF,IdC).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% NAVIGABLEOWNEDEND
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
							
associationObjectsM(mm,navigableOwnedEnd,IdF,IdC):-	associationObjectsM(mm,ownedEnd,IdF,IdC),
					att('isNavigable','true',IdC,_).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TYPE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

associationObjectsM(mm,type,IdP,IdC):-property(mm,IdP,[_,IdC,_,_,_,_]),class(mm,IdC,_).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% OF_TYPE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

associationObjectsM(mm,oftype,IdC,IdP):-property(mm,IdP,[_,IdC,_,_,_,_]),class(mm,IdC,_).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% QUALIFIER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

associationObjectsM(mm,qualifier,IdP,IdQ):-element(ownedEnd,_,IdP),
		att('xmi:type','uml:Property',IdP,_), 		 
		element(qualifier,IdP,IdQ).
