# UCLAONT: Ontology-Based UML Class Models Verification Tool updates
## 4 UCLAONT Architecture
### Transformation Component
#### 4.1.2 Class and Attributes  
In the proposed tool, UML classes are transformed into ontology classes. In XMI, we filter xmi:type uml:Class for classes and transformed it to _rdf:type owl:Class_. The attributes of a class are declared as datatype properties of OWL and make the respected class a _domain_ of the property and datatype set as a _rang_.  
Figure 4: Architecture of UCLAONT.  
Figure 5: Model Transformation Process of UCLAONT.  
Rules (XSLT) <xsl:iftest=\"./@xmi:type='uml:Class'> :<xsl:value-ofselect=\"@name\"/>rdf:typeowl:Class. </xsl:if> Example (XMI) <packagedElementxmi:type=\"uml:Class\" xmi:id=\"_0 bvU1 IwReEeHl8 ZOY9 KM8g\"name=\"Player\"/> Output (OWL) :Playerrdf:typeowl:Class.  
4.1.3. Generalization Relationship  
The generalization relation of the UML class diagram transformed into the subClass constraints of OWL. In XMI, we filter generalization keywords for generalization relationships. Then the key function is used for searching parent class.  
Rules (XSLT) <xsl:for-eachselect=\"./generalization\"> :<xsl:value-ofselect=\"../@name\"/>rdfs:subClassOf :<xsl:value-ofselect=\"key('Classid',@general)/@name\"/>. </xsl:for-each> Example (XMI) <packagedElementxmi:type=\"uml:Class\"xmi:id=\"_LxECG\"name=\"A\"/> :packagedElementxmi:type=\"uml:Class\"xmi:id=\"_LxECH\"name=\"B\"> :<generalizationxmi:type=\"uml:Generalization\"xmi:id=\"_LxEC\" general=\"_LxECg\"/> :</packagedElement> Output (OWL) :A rdf:typeowl:Class. :B rdf:typeowl:Class ; rdfs:subClassOf :A  
4.1.4. Association  
The association relationship is transformed into the object property of OWL, and respected classes appear as _domain_ and _range_. In XMI, we filter the _UML: Association_ keyword for the association. We defined a customized function in XSLT for the identification of class positions in the association. If the class appeared in position one, it appeared as _domain_, and the other class appeared as a _range_. Additionally, another object property is added as an inverse of the declared property due to maintained two-way navigation between classes.  
Rules (XSLT) <xsl:iftest=\"./@xmi:type='uml:Association'> <xsl:choose> <xsl:whentest=\"mf:check(./ownedEnd/@xmi:id,../ownedRule/ @constrainedElement)\"> </xsl:when> <xsl:otherwise> :<xsl:value-ofselect=\"@name\"/>rdf:typeowl:ObjectProperty; <xsl:for-eachselect=\"./ownedEnd\"> <xsl:iftest=\"position()=1\"> rdfs:domain:<xsl:value-ofselect=\"key('Classid',@type)/@name\"/>; </xsl:if> <xsl:iftest=\"position()!=1\"> rdfs:range:<xsl:value-ofselect=\"key('Classid',@type)/@name\"/>. </xsl:if> </xsl:for-each>:inv-<xsl:value-offsetelect=\"@name\"/>rdf:typeowl:ObjectProperty; owl:inverseOf:<xsl:value-offsetelect=\"@name\"/>. Example (XMI) <packagedElement xml:type=\"uml:Class\" xml:id=\"_C\" name=\"Player\"/> <packagedElement xml:type=\"uml:Association\" xml:id=\"_D\" name=\"Plays\" memberEnd=\"_CE\"> <ownedEnd xml:type=\"uml:Property\" xml:id=\"_CE\" type=\"_C]\" association=\"_D\"/> <ownedEnd xml:type=\"uml:Property\" xml:id=\"_C\" type=\"_Cf\" association=\"_D\"/> <packagedElement> <packagedElement xml:type=\"uml:Class\" xml:id=\"_E\" name=\"Monopoly Game\"/> Output (OML) :Playsrdf:typeowl:ObjectProperty; rdfs:domain:Player; rdfs:range:Monopoly Game; :inv-Playsrdf:typeowl:ObjectProperty; rdfs:domain:Monopoly Game; rdfs:range:Player; :Playsowl:inverseOf:inv-Plays