Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to construct a metamodel in KM3 from a DTD
[ATL] How to construct a metamodel in KM3 from a DTD [message #39671] Mon, 21 May 2007 10:03
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

This is a multi-part message in MIME format.
--------------020700010605020106070305
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

I'm trying to transform a XML (an export from the BPM tool ARIS) to XPDL.
The exported XML is specified by an DTD (if interested see attachment).
I try to create a metamodel with KM3 for the XML export on basis of the
DTD, but I'm not sure if I'm doing right.
Maybe someone can help and correct me, if I give a little example who I
do this:

First a extract of the DTD:

<!ELEMENT Prefix (#PCDATA) >
<!ATTLIST Prefix
Default (YES | NO) "NO"
>

<!ELEMENT GUID (#PCDATA)>

<!ELEMENT MasterGUID (#PCDATA)>

<!ELEMENT SymbolGUID (#PCDATA)>

<!ELEMENT Size EMPTY>
<!ATTLIST Size
Size.dX NMTOKEN #REQUIRED
Size.dY NMTOKEN #REQUIRED
>

<!ELEMENT Position EMPTY>
<!ATTLIST Position
Pos.X NMTOKEN #REQUIRED
Pos.Y NMTOKEN #REQUIRED
>

<!ELEMENT ExtCxnDef (GUID?, AttrDef*, ExtCxnDef*)>
<!ATTLIST ExtCxnDef
ExtCxnDef.ID ID #REQUIRED
ExtCxnDef.Type NMTOKEN #REQUIRED
ToDef.IdRef IDREF #REQUIRED
Reorg (DELETE|NODELETE) "DELETE"
>

<!ELEMENT CxnDef (GUID?, AttrDef*, ExtCxnDef*)>
<!ATTLIST CxnDef
CxnDef.ID ID #REQUIRED
CxnDef.Type NMTOKEN #REQUIRED
ToObjDef.IdRef IDREF #REQUIRED
LinkedModels.IdRefs IDREFS #IMPLIED
Reorg (DELETE|NODELETE) "DELETE"
>

<!ELEMENT ObjDef (GUID?, MasterGUID?, SymbolGUID?, AttrDef*, CxnDef*,
ExtCxnDef*)>
<!ATTLIST ObjDef
ObjDef.ID ID #REQUIRED
TypeNum NMTOKEN #REQUIRED
LinkedModels.IdRefs IDREFS #IMPLIED
ToCxnDefs.IdRefs IDREFS #IMPLIED
Reorg (DELETE|NODELETE) "DELETE"
SubTypeNum NMTOKEN #IMPLIED
SymbolNum NMTOKEN #IMPLIED
>

<!ELEMENT AttrValue (#PCDATA)>
<!ATTLIST AttrValue
LocaleId NMTOKEN #REQUIRED
>
<!ELEMENT AttrDef (AttrValue+)>
<!ATTLIST AttrDef
AttrDef.ID ID #IMPLIED
AttrDef.Type NMTOKEN #REQUIRED
>

Now the corresponding KM3 - as I thougt it has to be:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class Prefix {
attribute Default : String;
}

class GUID {}
class MasterGUID {}
class SymbolGUID {}

class Size {
attribute sizedX : Integer;
attribute sizedY : Integer;
}

class Position {
attribute posX : Integer;
attribute posY : Integer;
}

class ExtCxnDef {
reference guid[0-1] container : GUID;
reference attrDef[0-*] container : AttrDef;
reference extCxnDef[0-*] container : ExtCxnDef;
attribute extCxnDefID : String;
attribute extCxnDefType : String;
attribute ToDefIdRef : String;
attribute reorg : String;
}

class CxnDef {
reference guid[0-1] container : GUID;
reference attrDef[0-*] container : AttrDef;
reference extCxnDef[0-*] container : ExtCxnDef;
attribute cxnDefID : String;
attribute CxnDefType : String;
attribute toObjDefIdRef : String;
attribute linkedModelsIdRefs : String;
attribute reorg : String;
}

class AttrValue {
attribute localeID : String;
}

class AttrDef {
reference attrValue[1-*] container : AttrValue;
attribute attrDefID : String;
attribute attrDefType : String;
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Is this correct? Is there a possibility to model defaults or selections
of possible values for attributes?

Thanks and Regards

Erik

--------------020700010605020106070305
Content-Type: text/xml;
name="ARIS-Export.dtd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ARIS-Export.dtd"

<?xml version="1.0" encoding="UTF-8"?>
<!--
Version 3.0

DO NOT EDIT THIS FILE!

(c) 2003 IDS Scheer AG

-->

<!ELEMENT AML (Header-Info, Language+, Prefix*, Database?, User*, UserGroup*, FontStyleSheet*, FFTextDef*, OLEDef*, Group, Delete*)>
<!ELEMENT Header-Info EMPTY>
<!ATTLIST Header-Info
CreateTime NMTOKEN #IMPLIED
CreateDate NMTOKEN #IMPLIED
DatabaseName CDATA #IMPLIED
UserName CDATA #IMPLIED
ArisExeVersion (61 | 62 | 70) #REQUIRED
>

<!--General elements, used by several other elements-->

<!ELEMENT Prefix (#PCDATA) >
<!ATTLIST Prefix
Default (YES | NO) "NO"
>

<!ELEMENT Blob (#PCDATA)> <!-- Base64 encoded binary data -->

<!ELEMENT Flag (#PCDATA)>

<!ELEMENT GUID (#PCDATA)>
<!ELEMENT FilterGUID (#PCDATA)>
<!ELEMENT MasterGUID (#PCDATA)>
<!ELEMENT TypeGUID (#PCDATA)>
<!ELEMENT TemplateGUID (#PCDATA)>


<!ELEMENT Pen EMPTY>
<!ATTLIST Pen
Color NMTOKEN #REQUIRED
Style NMTOKEN #REQUIRED
Width NMTOKEN #REQUIRED
>

<!ELEMENT Brush EMPTY>
<!ATTLIST Brush
Color NMTOKEN #REQUIRED
Style NMTOKEN #REQUIRED
Hatch NMTOKEN #REQUIRED
>

<!ELEMENT Size EMPTY>
<!ATTLIST Size
Size.dX NMTOKEN #REQUIRED
Size.dY NMTOKEN #REQUIRED
>

<!ELEMENT Position EMPTY>
<!ATTLIST Position
Pos.X NMTOKEN #REQUIRED
Pos.Y NMTOKEN #REQUIRED
>
<!--End: General elements-->

<!-- BEGIN: Database -->
<!ELEMENT Database (AttrDef+)>
<!-- END: Database -->

<!--Begin: Language-->

<!ELEMENT Language (LanguageName?, LogFont?)>
<!ATTLIST Language
Language.ID ID #IMPLIED
LocaleId NMTOKEN #REQUIRED
Codepage CDATA #REQUIRED
>

<!ELEMENT LanguageName (#PCDATA)>

<!ELEMENT LogFont EMPTY>
<!ATTLIST LogFont
FaceName CDATA #REQUIRED
Height NMTOKEN #REQUIRED
Width NMTOKEN #REQUIRED
Escapement NMTOKEN #REQUIRED
Orientation NMTOKEN #REQUIRED
Weight NMTOKEN #REQUIRED
Italic (YES | NO) "NO"
Underline (YES | NO) "NO"
StrikeOut (YES | NO) "NO"
CharSet NMTOKEN #REQUIRED
OutPrecision NMTOKEN #REQUIRED
ClipPrecision NMTOKEN #REQUIRED
Quality NMTOKEN #REQUIRED
PitchAndFamily NMTOKEN #REQUIRED
Color NMTOKEN #REQUIRED
>
<!--End: Languge-->





<!--Begin of User-Definition-->

<!ELEMENT User (GUID?, AttrDef+, FilterGUID*, Prefix?)>
<!ATTLIST User
User.ID ID #REQUIRED
isSystem (true | false) "false"
Passwd NMTOKEN #IMPLIED
>
<!--End: User-->

<!--Begin of UserGroup-Definition-->
<!ELEMENT UserGroup (GUID?, AttrDef+, FilterGUID*, Prefix?)>
<!ATTLIST UserGroup
UserGroup.ID ID #REQUIRED
User.IdRefs IDREFS #IMPLIED
>

<!--End: UserGroup-->

<!--Begin of Font-Definition-->

<!ELEMENT FontStyleSheet (GUID?, AttrDef*, FontNode+)>
<!ATTLIST FontStyleSheet
FontSS.ID ID #REQUIRED
>

<!ELEMENT FontNode EMPTY>
<!ATTLIST FontNode
LocaleId NMTOKEN #REQUIRED
FaceName CDATA #REQUIRED
Height NMTOKEN #REQUIRED
Width NMTOKEN #REQUIRED
Escapement NMTOKEN #REQUIRED
Orientation NMTOKEN #REQUIRED
Weight NMTOKEN #REQUIRED
Italic (YES | NO) "NO"
Underline (YES | NO) "NO"
StrikeOut (YES | NO) "NO"
CharSet NMTOKEN #REQUIRED
OutPrecision NMTOKEN #REQUIRED
ClipPrecision NMTOKEN #REQUIRED
Quality NMTOKEN #REQUIRED
PitchAndFamily NMTOKEN #REQUIRED
Color NMTOKEN #REQUIRED
>

<!--End: Font-Definition-->

<!ELEMENT ExtCxnDef (GUID?, AttrDef*, ExtCxnDef*)>
<!ATTLIST ExtCxnDef
ExtCxnDef.ID ID #REQUIRED
ExtCxnDef.Type NMTOKEN #REQUIRED
ToDef.IdRef IDREF #REQUIRED
Reorg (DELETE|NODELETE) "DELETE"
>


<!ELEMENT CxnDef (GUID?, AttrDef*, ExtCxnDef*)>
<!--Format for CxnDef.Type: CxnBaseType or FromObjType.CxnBaseType.ToObjType-->
<!ATTLIST CxnDef
CxnDef.ID ID #REQUIRED
CxnDef.Type NMTOKEN #REQUIRED
ToObjDef.IdRef IDREF #REQUIRED
LinkedModels.IdRefs IDREFS #IMPLIED
Reorg (DELETE|NODELETE) "DELETE"
>

<!ELEMENT ObjDef (GUID?, MasterGUID?, SymbolGUID?, AttrDef*, CxnDef*, ExtCxnDef*)>
<!ATTLIST ObjDef
ObjDef.ID ID #REQUIRED
TypeNum NMTOKEN #REQUIRED
LinkedModels.IdRefs IDREFS #IMPLIED
ToCxnDefs.IdRefs IDREFS #IMPLIED
Reorg (DELETE|NODELETE) "DELETE"
SubTypeNum NMTOKEN #IMPLIED
SymbolNum NMTOKEN #IMPLIED
>
<!--End: ObjDefs-Definition-->
<!--Begin: Attribute Definition-->
<!ELEMENT AttrValue (#PCDATA)>
<!ATTLIST AttrValue
LocaleId NMTOKEN #REQUIRED
>
<!ELEMENT AttrDef (AttrValue+)>
<!ATTLIST AttrDef
AttrDef.ID ID #IMPLIED
AttrDef.Type NMTOKEN #REQUIRED
>
<!--End: Attribute Definition-->



<!ELEMENT SymbolGUID (#PCDATA)>

<!--Begin: ObjOcc-Definition-->
<!ELEMENT ObjOcc (SymbolGUID?, Pen?, Brush?, Position?, Size?, CxnOcc*, AttrOcc*, ExtCxnOcc*)>
<!ATTLIST ObjOcc
ObjOcc.ID ID #REQUIRED
ObjDef.IdRef IDREF #REQUIRED
ToCxnOccs.IdRefs IDREFS #IMPLIED
Zorder NMTOKEN #IMPLIED
SymbolNum NMTOKEN #REQUIRED
Active (YES | NO) "YES"
Shadow (YES | NO) "NO"
Visible (YES | NO) "YES"
Hints NMTOKEN #IMPLIED
>
<!--End: ObjOcc-Definition-->

<!--Begin: FFText-Definition-->
<!ELEMENT FFTextOcc (Position?)>
<!ATTLIST FFTextOcc
FFTextOcc.ID ID #IMPLIED
FFTextDef.IdRef IDREF #REQUIRED
FontSS.IdRef IDREF #IMPLIED
SymbolFlag (TEXT | SYMBOL | ATTRNAME | ATTRNAME_AND_SYMBOL | POSTIT | SYMBOL_AND_POSTIT | ATTRNAME_AND_POSTIT | ATTRNAME_AND_SYMBOL_AND_POSTIT) #REQUIRED
Alignment (LEFT | CENTER | RIGHT) "LEFT"
Zorder NMTOKEN #IMPLIED
>
<!--End: FFText-Definition-->

<!ELEMENT AttrOcc EMPTY>
<!ATTLIST AttrOcc
AttrOcc.ID ID #IMPLIED
AttrTypeNum NMTOKEN #REQUIRED
Port (CENTER | N | NE | E | SE | S | SW | W | NW | NONE | UPPER_MIDDLE | LOWER_MIDDLE | PORT_FREE) #REQUIRED
OrderNum NMTOKEN #REQUIRED
Alignment (LEFT | CENTER | RIGHT) "LEFT"
SymbolFlag (TEXT | SYMBOL | WIDTH_ATTR_NAME | ATTR_NAME_AND_SYMBOL) #REQUIRED
FontSS.IdRef IDREF #IMPLIED
OffsetX NMTOKEN #IMPLIED
OffsetY NMTOKEN #IMPLIED
>


<!ELEMENT ExtCxnOcc (Pen?, Position*, AttrOcc*, ExtCxnOcc*)>
<!ATTLIST ExtCxnOcc
ExtCxnOcc.ID ID #REQUIRED
ExtCxnDef.IdRef IDREF #REQUIRED
ToOcc.IdRef IDREF #REQUIRED
Zorder NMTOKEN #IMPLIED
Active (YES | NO) "YES"
Diagonal (NO | YES) "NO"
Visible (YES | NO) "YES"
Hints NMTOKEN #IMPLIED
>


<!--Begin: CxnOcc-Definition-->
<!ELEMENT CxnOcc (Pen?, Position*, AttrOcc*, ExtCxnOcc*)>
<!ATTLIST CxnOcc
CxnOcc.ID ID #REQUIRED
CxnDef.IdRef IDREF #REQUIRED
ToObjOcc.IdRef IDREF #REQUIRED
Zorder NMTOKEN #IMPLIED
Active (YES | NO) "YES"
Diagonal (NO | YES) "NO"
Visible (YES | NO) "YES"
Embedding (YES | NO) "NO"
Hints NMTOKEN #IMPLIED
SrcArrow NMTOKEN #IMPLIED
TgtArrow NMTOKEN #IMPLIED
>
<!--End: CxnOcc-Definition-->
<!--Begin: Lane-Definition-->
<!ELEMENT Lane (GUID?, Pen?, Brush?, AttrDef*)>
<!ATTLIST Lane
Lane.ID ID #IMPLIED
Lane.Type NMTOKEN #REQUIRED
Orientation (VERTICAL | HORIZONTAL) #REQUIRED
StartBorder NMTOKEN #REQUIRED
EndBorder NMTOKEN #REQUIRED
>
<!--End: Lane-Definition-->


<!ELEMENT OLEDef (GUID?, Blob, Blob)> <!-- first blob is Metafile-BLOB; second blob is Data-BLOB -->
<!ATTLIST OLEDef
OLEDef.ID ID #REQUIRED
Link CDATA #IMPLIED
>

<!ELEMENT OLEOcc (Position?, Size?)>
<!ATTLIST OLEOcc
OLEOcc.ID ID #IMPLIED
OLEDef.IdRef IDREF #REQUIRED
Zorder NMTOKEN #IMPLIED

>

<!ELEMENT FFTextDef (GUID?, AttrDef+)>
<!ATTLIST FFTextDef
FFTextDef.ID ID #REQUIRED
IsModelAttr (TEXT | MODELATTR) "TEXT"
>
<!ELEMENT Group (GUID?, AttrDef*, Group*, (ObjDef | Model)*)>
<!ATTLIST Group
Group.ID ID #REQUIRED
>

<!ELEMENT Polygon (Position*)>
<!ATTLIST Polygon
FillStatus (FILLED | TRANSPARENT) "TRANSPARENT"
>

<!ELEMENT RoundedRectangle (Position)>
<!ATTLIST RoundedRectangle
Shaded (YES | NO) "NO"
>

<!ELEMENT GfxObj (Pen?, Brush?, Position?, Size?, (Polygon | RoundedRectangle))>
<!ATTLIST GfxObj
GfxObj.ID ID #IMPLIED
Zorder NMTOKEN #IMPLIED
>

<!ELEMENT Union (Union*)>
<!ATTLIST Union
OLEObjOccs.IdRefs IDREFS #IMPLIED
ObjOccs.IdRefs IDREFS #IMPLIED
Gfxs.IdRefs IDREFS #IMPLIED
TextOccs.IdRefs IDREFS #IMPLIED
Zorder NMTOKEN #IMPLIED
Flags NMTOKEN #IMPLIED
>

<!--Begin: Model definition-->
<!ELEMENT Model (Flag?, GUID?, MasterGUID?, TypeGUID?, TemplateGUID?, Lane*, AttrDef*, ObjOcc*, FFTextOcc*, GfxObj*, OLEOcc*, Union*)>
<!ATTLIST Model
Model.ID ID #REQUIRED
Model.Type NMTOKEN #REQUIRED
AttrHandling (OVERLAP | RESIZESYM | BREAKATTR | SHORTENATTR) #IMPLIED
CxnMode (ONLYVERTICAL | ANGULAR) #IMPLIED
GridUse (NO | YES) #IMPLIED
GridSize NMTOKEN #IMPLIED
Scale NMTOKEN #IMPLIED
PrintScale NMTOKEN #IMPLIED
BackColor NMTOKEN #IMPLIED
CurveRadius NMTOKEN #IMPLIED
ArcRadius NMTOKEN #IMPLIED
>
<!--end of Modeldefinition-->

<!-- PCDATA is GUID of object that should be deleted -->
<!ELEMENT Delete (#PCDATA)>
<!ATTLIST Delete
Type (GROUP|MODEL|OBJDEF|USER|USERGROUP|CXNDEF) #REQUIRED
>
--------------020700010605020106070305--
Previous Topic:[ATL] : problem with Sequence in Sequence
Next Topic:getting EMF model handler
Goto Forum:
  


Current Time: Thu Jan 21 05:10:07 GMT 2021

Powered by FUDForum. Page generated in 0.01893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top