Generating models from XML files

I would like to import XML data files into MPS environment and turn them into arbitrary models.
How should I go about this?
0
9 comments
Hi,
If you want just importing, the simplest way is to write your custom "action" in plugin aspect of some language, which will parse your XML and turn them into models. To access model structure, use the jetbrains.mps.smodel language. Add this action to any of the existing "groups" and you'll see it in the corresponding context/main menu.

More info on plugin aspect, actions and action groups:
http://confluence.jetbrains.net/display/MPSD2/Plugin#Plugin-Actionsandactiongroups
More info on smodel language:
http://confluence.jetbrains.net/display/MPSD2/SModel+language
If you experience any problems, please feel free to ask.

You can also import your models in read-only mode on-demand. See how the "stubs" models can be provided here:
http://confluence.jetbrains.net/display/MPSD2/Stubs
and search this forum also. In the next versions of MPS we plan to introduce a fully-custom persistence with read/write operations. For now, only the read-only models can be provided.

Regards,
Mihail
0
May be I should be implemented as custom persistence for XML models in nearly future? ;)
0
Alexey,
I've heard about your project from Ilya Lintsbah, and we've decided to discuss it with the team. Maybe we could try implementing this functionality in 2.1
0
How does one go about creating new actions?

The page http://confluence.jetbrains.net/display/MPSD2/Plugin#Plugin-Actionsandactiongroups and tutorial referenced therein do not help.

The tutorial is recent, but already seems outdated:
http://www.federico-tomassetti.it/tutorial-how-to-add-an-action-to-the-jetbrains-metaprogramming-system/
I am unable to complete the step "Now we have to create a Group." because the menu that appears when right clicking on plugins does not provide the choices listed in the snapshot associated with the step. I only see New "Facet" under the plugin menu in version 2.5 of MPS (build 117-9351), where I am supposed to be able to select a New "Group".
0
You can find the Group in the language jetbrains.mps.lang.plugin. In the Model Properties of the plugin aspect add it to the Used Languages and you will be able to create a Group.


image1
0
Thanks, that worked. To continue the tutorial, I also had to include the swing stubs in the plugin imported models (i.e., under module properties of the Language plugin aspect, added JDK/javax.swing@java_stub). It then became possible to use JOptionPane (adding to Accessory Models of the Language as per the tutorial was not sufficient).
0
Thanks for your help. I was able to complete the tutorial, unfortunately,
no new menu is displayed under Tools nor is there any error report. Not
sure where to go from there.

On Wed, Dec 12, 2012 at 1:31 PM, Sascha Lißon - Meta Programming System <
jetforum@jetbrains.com> wrote:

* Meta Programming System<http://forum.jetbrains.com/forum/Meta-Programming-System>
* > * Generating models from XML files<http://forum.jetbrains.com/thread/Meta-Programming-System-666>
* [ * xml <http://forum.jetbrains.com/tag/Meta-Programming-System--xml> *] 1:31
pm<http://forum.jetbrains.com/thread/Meta-Programming-System-666?message=Meta-Programming-System-666-5>
* updated 1:31 pm * Sascha Lißon <http://forum.jetbrains.com/user/slisson>

You can find the Group in the language *jetbrains.mps.lang.plugin*. In
the Model Properties of the plugin aspect add it to the *Used
Languages* and you will be able to create as *Group*.


[image: image1]</_persistent/image1?file=29-2333&v=0&c=true>

   Fabien Campagne<http://forum.jetbrains.com/user/fac2003@campagnelab.org>@ 12:57
pm<http://forum.jetbrains.com/thread/Meta-Programming-System-666?message=Meta-Programming-System-666-4>

How does one go about creating new actions?

The page
http://confluence.jetbrains.net/display/MPSD2/Plugin#Plugin-Actionsandactiongroupsand tutorial referenced therein do not help.

--
Fabien Campagne, PhD – http://campagnelab.org

Assistant Professor,    Dept. of Physiology and Biophysics
          Institute for Computational Biomedicine
Associate Director,      Biomedical Informatics Core,
       Clinical Translational Science Center

Weill Medical College of Cornell University
phone:  (646)-962-5613  1305 York Avenue
fax:    (646)-962-0383  Box 140
New York, NY 10021

Do you speak next-gen?

See how GobyWeb can help simplify your NGS projects at
http://gobyweb.campagnelab.org
0
  1. Add the language jetbrains.mps.lang.plugin.standalone to the Used Languages of the plugin aspect.
  2. Add a StandalonePluginDescriptor to your plugin aspect.
0
On Fri, Dec 14, 2012 at 10:51 AM, Sascha Lißon - Meta Programming System <
0

Please sign in to leave a comment.