|
|
PyEmofUCXMI textual format for model serializationJ.M. Drake, P. López Martínez and C. CuevasSoftware Engineering and Real-Time (ISTR) - University of Cantabria |
The XMI
specification has been proposed by the OMG in order to
standardize the interchange of models among heterogeneous
environments and for storage in persistent files.
An XMI document is an XML document formalized through the
W3C-Schema XMI.xsd.
Key aspects specified by the XMI specification are:
<?xml
version="1.0" encoding="UTF-8"?> <emof:METAMODEL date="2015-03-06"
uri="http://unican.es/istr/PyEmofUC/CountyCity/County"
mmUrl="http://unican.es/istr/PyEmofUC/EmofUC.xmi"
importedUrls="platform:CountyCity/City.xmi"
nsPrefix="cnty"
rootType="cnty.County"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:emof="http://unican.es/istr/PyEmofUC/EmofUC"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://unican.es/istr/PyEmofUC/EmofUC
..\EMOF.xsd">
<rootPackage name="rootPackage" . . . .
. . . . .
</rootPackage> |
<?xml
version="1.0" encoding="UTF-8"?> <cty:MODEL
date="2013-03-07T20:34:18"
uri="http://unican.es/istr/PyEmofUC/CountyCity/EagleCity"
mmUrl="platform:CountyCity/City.xmi"
importedUrls="platform:CountyCity/EagleCounty.xmi"
nsPrefix="ecty"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:cty="http://unican.es/istr/PyEmofUC/CountyCity/City"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://unican.es/istr/PyEmofUC/CountyCity/City
City.xsd">
<rootPackage . . . .
.
. . .
</rootPackage> </cty:MODEL> |
<company xmi:id="ecty.AbbyBank" xsi:type="cty:Company" . . .
>
<employ . . . />
. . . . |
The goal of the generated schema is to
provide assistance to the operator when he uses a smart XML editor for creating or editing models compliant to it.
Its formulation is lax, using the following criteria:
<?xml version="1.0"
encoding="UTF-8"?> <emof:METAMODEL date="2015-03-06"
uri="http://unican.es/istr/PyEmofUC/CountyCity/City"
mmUrl="http://unican.es/istr/PyEmofUC/EmofUC.xmi"
importedUrls="platform:CountyCity/County.xmi"
nsPrefix="cty"
rootType="#cty.CompanyDirectory"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:emof="http://unican.es/istr/PyEmofUC/EmofUC"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://unican.es/.../EmofUC ..\EMOF.xsd">
<rootPackage name="rootPackage"
xmi:id="cty.rootPacage"
xsi:type="emof:Package">
<ownedType name="CompanyDirectory"
xmi:id="cty.CompanyDirectory"
xsi:type="emof:Class"
superclass="emof#emof.Object">
<ownedAttribute name="company"
xmi:id="cty.CompanyDirectory.company"
xsi:type="emof:Property"
theType="#cty.Company"
isComposite="True"
upper="*"/>
</ownedType>
<ownedType name="Company"
xmi:id="cty.Company"
xsi:type="emof:Class"
superclass="emof#emof.Object">
<ownedAttribute name="name"
xmi:id="cty.Company.name"
xsi:type="emof:Property"
theType="emof#emof.PyString"/>
<ownedAttribute name="employ"
xmi:id="cty.Company.employ"
xsi:type="emof:Property"
theType="#cty.Employ"
isComposite="True"
lower='0'
upper="*"
opposite="#cty.Employ.employer"/>
</ownedType>
<ownedType name="Employ"
xmi:id="cty.Employ"
xsi:type="emof:Class"
superclass="emof#emof.Object">
<ownedAttribute name="name"
xmi:id="cty.Employ.name"
xsi:type="emof:Property"
theType="emof#emof.PyString"/>
<ownedAttribute name="salary"
xmi:id="cty.Employ.salary"
xsi:type="emof:Property"
theType="emof#emof.PyReal"
default="0.0"/>
<ownedAttribute name="employer"
xmi:id="cty.Employ.employer"
xsi:type="emof:Property"
theType="#cty.Company"
opposite="#cty.Company.employ"/>
<ownedAttribute name="worker"
xmi:id="cty.Employ.worker"
xsi:type="emof:Property"
theType="cnty#cnty.Adult"
opposite="cnty#cnty.Adult.job"/>
</ownedType>
</rootPackage> |
<?xml version="1.0"
encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cty="http://unican.es/istr/PyEmofUC/CountyCity/City"
xmlns:xmi=http://www.omg.org/XMI
xmlns:emof=http://unican.es/istr/PyEmofUC/EmofUC
targetNamespace="http://unican.es/istr/PyEmofUC/CountyCity/City">
<xsd:import namespace=http://www.omg.org/XMI
schemaLocation="../XMI.xsd"/>
<xsd:import namespace=http://unican.es/istr/PyEmofUC/EmofUC
schemaLocation="../EMOF.xsd"/>
<xsd:complexType name="CompanyDirectory">
<xsd:complexContent>
<xsd:extension base="emof:PyEmofObject">
<xsd:sequence>
<xsd:element name="company"
type="cty:Company"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Company">
<xsd:complexContent>
<xsd:extension base="emof:PyEmofObject">
<xsd:sequence>
<xsd:element name="employ"
type="cty:Employ"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name"
type="xsd:string"
use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Employ">
<xsd:complexContent>
<xsd:extension base="emof:PyEmofObject">
<xsd:attribute name="name"
type="xsd:string"
use="required"/>
<xsd:attribute name="salary"
type="xsd:float"
use="optional"
default="0.0"/>
<xsd:attribute name="employer"
type="xsd:anyURI"
use="optional"/>
<xsd:attribute name="worker"
type="xsd:anyURI"
use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!-- ROOT ELEMENT -->
<xsd:element name="MODEL">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="emof:Model">
<xsd:sequence>
<xsd:element name="rootPackage"
type="cty:CompanyDirectory"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element> </xsd:schema> |