Hi,
if you work with UML, modeling tools or model data exchange often you might know XMI - the XML Metadata Interchange format. I wrote a little package that makes it easier to work and browse data based on this format within Pharo. For instance you can open an XMI object either from a given stream or URL: (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect You can also open a file XMIFile importFile Code is available on https://github.com/astares/Pharo-XMI The package includes a small GT extension allowing you to walk and dive through the XMI structure (see attached screenshot) and as the XMI nodes are unified it is easy to code some code generators or transformers in Pharo afterwards. For instance I used this package for a simple Pharo code generator based on Eclipse EMF models/diagrams. Within the code you will find some examples to browse through prominent XMI models like: - UML Spec => (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect - VISUAL PARADIGM => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi') inspect - ENTERPRISE ARCHITECT => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi') inspect - ARCHIMATE => (XMIFile fromURL: 'https://www.reflektis.com/repos/archimate-3.0.xmi) inspect Once the inspector opens you have to select the "rootNode" and then the "Hierarchy" tab. In Pharo 6 you can load "XMI" right from catalog. Hope the package is useful for others too. Bye T. xmi_gt.png (123K) Download Attachment |
Hi torsten
do you know the work of peter to generate classes out of XMI and populate models? Because it complements your approach. stef On Wed, 01 Mar 2017 22:26:05 +0100, Torsten Bergmann <[hidden email]> wrote: > Hi, > if you work with UML, modeling tools or model data exchange often you > might know XMI - > the XML Metadata Interchange format. > I wrote a little package that makes it easier to work and browse data > based on this > format within Pharo. > For instance you can open an XMI object either from a given stream > or URL: > (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') > inspect > You can also open a file > XMIFile importFile > Code is available on https://github.com/astares/Pharo-XMI > The package includes a small GT extension allowing you to walk and dive > through the XMI > structure (see attached screenshot) and as the XMI nodes are unified it > is easy to > code some code generators or transformers in Pharo afterwards. > For instance I used this package for a simple Pharo code generator based > on Eclipse EMF models/diagrams. > Within the code you will find some examples to browse through prominent > XMI models like: > - UML Spec > => (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') > inspect > - VISUAL PARADIGM > => (XMIFile fromURL: > 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi') > inspect > - ENTERPRISE ARCHITECT > => (XMIFile fromURL: > 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi') > inspect > - ARCHIMATE > => (XMIFile fromURL: > 'https://www.reflektis.com/repos/archimate-3.0.xmi) inspect > Once the inspector opens you have to select the "rootNode" and then the > "Hierarchy" tab. > In Pharo 6 you can load "XMI" right from catalog. Hope the package is > useful for others too. > Bye > T. -- Using Opera's mail client: http://www.opera.com/mail/ |
In reply to this post by Torsten Bergmann
Is this based on Peter's work? Also:
"anXMLElement name xmlPrefixBeforeLocalName" -> "anXMLElement prefix" "anXMLElement elements collect:" -> "anXMLElement elementsCollect:" "^self fromXMLElement: (XMLDOMParser parse: aStringOrStream usingNamespaces: false) root"...why are you disabling namespaces? If it's for performance, also look at #optimizeForLargeDocuments. In fact it would good to browse the entire "configuring" category of XMLDOMParser and its superclass to see what you need. > Sent: Wednesday, March 01, 2017 at 4:26 PM > From: "Torsten Bergmann" <[hidden email]> > To: "Pharo Development List" <[hidden email]>, "Any question about pharo is welcome" <[hidden email]> > Subject: [Pharo-users] [ANN] XML Metadata Interchange (XMI) for Pharo > > Hi, > > if you work with UML, modeling tools or model data exchange often you might know XMI - > the XML Metadata Interchange format. > > I wrote a little package that makes it easier to work and browse data based on this > format within Pharo. > > For instance you can open an XMI object either from a given stream > or URL: > > (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect > > You can also open a file > > XMIFile importFile > > Code is available on https://github.com/astares/Pharo-XMI > > The package includes a small GT extension allowing you to walk and dive through the XMI > structure (see attached screenshot) and as the XMI nodes are unified it is easy to > code some code generators or transformers in Pharo afterwards. > > For instance I used this package for a simple Pharo code generator based on Eclipse EMF models/diagrams. > > Within the code you will find some examples to browse through prominent XMI models like: > > - UML Spec > => (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect > > - VISUAL PARADIGM > => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi') inspect > > - ENTERPRISE ARCHITECT > => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi') inspect > > - ARCHIMATE > => (XMIFile fromURL: 'https://www.reflektis.com/repos/archimate-3.0.xmi) inspect > > Once the inspector opens you have to select the "rootNode" and then the "Hierarchy" tab. > > In Pharo 6 you can load "XMI" right from catalog. Hope the package is useful for others too. > > Bye > T. |
In reply to this post by stepharong
We spoke briefly on Tuesday. I need to take a look (also at his EMF generator) and see how the tools could benefit from each other. I think it could simplify some of my code or streamline the use of it.
(Also I have about a billion code generators at the moment with small differences... so I will merge that at some point too...) Peter On Wed, Mar 01, 2017 at 10:29:38PM +0100, stepharong wrote: > Hi torsten > > do you know the work of peter to generate classes out of XMI and > populate models? > Because it complements your approach. > > stef > > > On Wed, 01 Mar 2017 22:26:05 +0100, Torsten Bergmann > <[hidden email]> wrote: > > >Hi, > >if you work with UML, modeling tools or model data exchange often > >you might know XMI - > >the XML Metadata Interchange format. > >I wrote a little package that makes it easier to work and browse > >data based on this > >format within Pharo. > >For instance you can open an XMI object either from a given stream > >or URL: > > (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') > >inspect > >You can also open a file > > XMIFile importFile > >Code is available on https://github.com/astares/Pharo-XMI > >The package includes a small GT extension allowing you to walk and > >dive through the XMI > >structure (see attached screenshot) and as the XMI nodes are > >unified it is easy to > >code some code generators or transformers in Pharo afterwards. > >For instance I used this package for a simple Pharo code generator > >based on Eclipse EMF models/diagrams. > >Within the code you will find some examples to browse through > >prominent XMI models like: > >- UML Spec > > => (XMIFile fromURL: > >'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect > >- VISUAL PARADIGM > > => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi') > >inspect > >- ENTERPRISE ARCHITECT > > => (XMIFile fromURL: 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi') > >inspect > >- ARCHIMATE > > => (XMIFile fromURL: > >'https://www.reflektis.com/repos/archimate-3.0.xmi) inspect > >Once the inspector opens you have to select the "rootNode" and > >then the "Hierarchy" tab. > >In Pharo 6 you can load "XMI" right from catalog. Hope the package > >is useful for others too. > >Bye > >T. > > > -- > Using Opera's mail client: http://www.opera.com/mail/ > |
On Thu, 02 Mar 2017 10:02:04 +0100, Peter Uhnak <[hidden email]> wrote:
> We spoke briefly on Tuesday. I need to take a look (also at his EMF > generator) and see how the tools could benefit from each other. I think > it could simplify some of my code or streamline the use of it. super cool :) > > (Also I have about a billion code generators at the moment with small > differences... so I will merge that at some point too...) > > Peter > > > On Wed, Mar 01, 2017 at 10:29:38PM +0100, stepharong wrote: >> Hi torsten >> >> do you know the work of peter to generate classes out of XMI and >> populate models? >> Because it complements your approach. >> >> stef >> >> >> On Wed, 01 Mar 2017 22:26:05 +0100, Torsten Bergmann >> <[hidden email]> wrote: >> >> >Hi, >> >if you work with UML, modeling tools or model data exchange often >> >you might know XMI - >> >the XML Metadata Interchange format. >> >I wrote a little package that makes it easier to work and browse >> >data based on this >> >format within Pharo. >> >For instance you can open an XMI object either from a given stream >> >or URL: >> > (XMIFile fromURL: 'http://www.omg.org/spec/UML/20131001/UML.xmi') >> >inspect >> >You can also open a file >> > XMIFile importFile >> >Code is available on https://github.com/astares/Pharo-XMI >> >The package includes a small GT extension allowing you to walk and >> >dive through the XMI >> >structure (see attached screenshot) and as the XMI nodes are >> >unified it is easy to >> >code some code generators or transformers in Pharo afterwards. >> >For instance I used this package for a simple Pharo code generator >> >based on Eclipse EMF models/diagrams. >> >Within the code you will find some examples to browse through >> >prominent XMI models like: >> >- UML Spec >> > => (XMIFile fromURL: >> >'http://www.omg.org/spec/UML/20131001/UML.xmi') inspect >> >- VISUAL PARADIGM >> > => (XMIFile fromURL: >> 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/VP_XMI21.xmi') >> >inspect >> >- ENTERPRISE ARCHITECT >> > => (XMIFile fromURL: >> 'https://raw.githubusercontent.com/staruml/XMI/master/unittest-files/EA_XMI21.xmi') >> >inspect >> >- ARCHIMATE >> > => (XMIFile fromURL: >> >'https://www.reflektis.com/repos/archimate-3.0.xmi) inspect >> >Once the inspector opens you have to select the "rootNode" and >> >then the "Hierarchy" tab. >> >In Pharo 6 you can load "XMI" right from catalog. Hope the package >> >is useful for others too. >> >Bye >> >T. >> >> >> -- >> Using Opera's mail client: http://www.opera.com/mail/ >> > -- Using Opera's mail client: http://www.opera.com/mail/ |
Free forum by Nabble | Edit this page |