This is the home page for SimileXML: XML-based languages and tools for Simile-related modelling.
languages in the plural, since there are alternative Schema for Simile model-representation languages themselves, plus we want look at other XML-based languages, e.g. simplified notation for representing simple System Dynamics models.
tools, since it is not just the languages we are considering but the tools (e.g. XSLT or XSugar based) for processing models expressed in the language.
Simile-related, since the work will involve XML-based languages that are not directly readable by Simile (e.g. the simple System Dynamics notation referred to above; or an XML representation of Vensim's MDL), but can be transformed into or out of a Simile language.
This page links to other relevant technologies and initiatives.
This page links to other initiatives aimed at developing modelling- and simulation-related markup languages.
Coneference paper on ModelicaXML
http://www.modelica.org/events/Conference2003/papers/h39_Pop.pdf
Virtual Cellhome page: http://www.nrcam.uchc.edu/login/login.html
Unfortunately, although they claim to have a declarative model-representation language, it is not immediately obvious, when visiting their site, where this is defined.
This page contains links to XML and related technologies.
"XMI is a way to save UML models in XML"
Therefore, XMI can be a way to save the class-and-association structure of Simile models in XML.
Therefore, XMI can be leveraged (along with MathML, GraphML, Dublin Core...) to provide a standards-rich language for Simile models, and save a lot of work in the process.
Perdita Stevens: MOF and XMI - a mini-tutorial. http://homepages.inf.ed.ac.uk/perdita/XMI/tutslides2up.pdf
OMG XMI spec. http://www.omg.org/technology/documents/formal/xmi.htm
Wikipedia: XML Metadata Interchange. http://en.wikipedia.org/wiki/XMI
XSLT is used too transform XML documents into some other XML, HTML, or plain text.
XSugar enables one to define a single set of mapping rules between a non-XML and an XML format for the same information. The rule-set can then be used in either direction. This is a far superior approachh to requiring one to write two one-way transformations.
This is the main hub for conversion between different model-representation formats.
\ To |
Simile Prolog |
SimileXMLv1 | SimileXMLv2 | SimileXMLv3 | XMILE | Vensim | Stella | |
Simile Prolog |
XSugar | |||||||
SimileXMLv1 | ||||||||
SimileXMLv2 | ||||||||
SimileXMLv3 | XSugar | |||||||
XMILE | ||||||||
Vensim | ||||||||
Stella | ||||||||
So far three versions have been specified.
This page is the hub for SimileXMLv1, the first version of a Simile XML language. It is reasonably faithful to the original Prolog structure, but with some alterations.
This is the home page for SimileXMLv2.
SimileXMLv2 involves a major re-design of the data model for representing Simile models.
The basic idea is to enable a composite model to be built up by cut-and-pasting the XML for one (child) model into another (parent) model (or, equivalently, adding an XInclude element into the parent model).
This is the home page for SimileXMLv3.
SimileXMLv3 is intended as a bog-standard XML representation of Simile models, with a direct, one-to-one relationship between the parts of the Prolog clauses and the XML elements and attributes.
The aim is to provide a robust XML-based language which can provide guaranteed conversion in either direction (including round-tripping). This aim can be met with more profound changes to the syntax or underlying data model, but this would require more work to come up with the new design, and to ensure that it works under all circumstances.
The SimileXMLv3 Schema page is here.
The XSugar rule-set for converting between Simile Prolog and SimileXMLv3 is here.
Attachment | Size |
---|---|
SimileXMLv3.xsd | 23.58 KB |
SimileProlog_SimileXMLv3.xsg | 8.35 KB |
This page contains the XSugar rule-set for converting between Simile Prolog and SimileXMLv3, as well as notes on its development and use.
The following files are attached.
This is the XSugar rule-set.
This is the Prolog for the LINTUL model as exported from Simile.
This is the XML generated by XSugar when it appliesthe above rule set to the above Prolog file.
Install XSugar, then issue the following comamnd at the command line:
exec java -jar xsugar-all.jar SimileProlog_SimileXMLv3.xsg LINTUL.pl > LINTUL.xml
Attachment | Size |
---|---|
SimileProlog_SimileXMLv3.xsg | 20.25 KB |
LINTUL.pl | 30.37 KB |
LINTUL.xml | 65.97 KB |
Add content.
This page contains the actual XSugar stylesheet for parsing CF-metadata "standard names", and for inter-converting between the plain-text CF-metadata format and the corresponding XML format.
/* Robert Muetzelfeldt 16 Oct 2008 This is a direct re-casting of the rules given in http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines for CF-metadata Standard Names in XSugar. */ /* Notes: 'Substance' needs to be further analysed in terms of its constituent parts */ BaseName = amount|area|area_fraction|density|energy|energy_content|energy_density|frequency|frequency_of_occurence|heat_flux|heat_transport|horizontal_streamfunction|horizontal_velocity_potential|mass|mass_flux|mass_fraction|mass_mixing_ratio|mass_transport|mole_fraction|mole_flux|momentum_flux|partial_pressure|period|power|pressure|probability|radiative_flux|specific_eddy_kinetic_energy|speed|stress|temperature|thickness|velocity|volume|volume_flux|volume_fraction|volume_transport|vorticity Condition = clear_sky|deep_snow|no_snow Direction = upward|downward|northward|southward|eastward|westward|x|y Medium = air|atmosphere_boundary_layer|mesosphere|sea_ice|sea_water|soil|soil_water|stratosphere|thermosphere|troposphere Substance = condensed_water|oxygen|sulfate_aerosol|ammonium_dry_aerosol|black_carbon_dry_aerosol|cloud_condensed_water|cloud_ice|cloud_liquid_water|convective_cloud_condensed_water|convective_cloud_ice|convective_cloud_liquid_water|dimethyl_sulfide|dust_dry_aerosol|frozen_water|graupel|mercury_dry_aerosol|nitrate_dry_aerosol|ozone|particulate_organic_matter_dry_aerosol|pm1_aerosol|pm10_aerosol|pm2p5_aerosol|precipitation|primary_particulate_organic_matter_dry_aerosol|rain|seasalt_dry_aerosol|secondary_particulate_organic_matter_dry_aerosol|snow|stratiform_cloud_ice|stratiform_cloud_liquid_water|sulfate_dry_aerosol|sulfur_dioxide|unfrozen_water|water Surface = toa|tropopause|surface|adiabatic_condensation_level|cloud_top|convective_cloud_top|cloud_base|convective_cloud_base|freezing_level|ground_level|maximum_wind_speed_level|sea_floor|sea_ice_base|sea_level|top_of_atmosphere_boundary_layer|top_of_atmosphere_model|top_of_dry_convection Process = advection|convection|deep_convection|diabatic_processes|diffusion|dry_convection|gravity_wave_drag|gyre|isostatic_adjustment|large_scale_precipitation|longwave_heating|moist_convection|overturning|shallow_convection|shortwave_heating|thermodynamics WhereType = cloud|land|open_sea|sea|sea_ice|vegetation NL = \r\n|\r|\n Text = [a-z]+(_[a-z0-9]+)* file : [standard_names Ss] = <standard_names> [standard_names Ss] </> standard_names : [standard_name1 S] [NL] [standard_names Ss] = <standard_name> [standard_name1 S] </> [standard_names Ss] standard_names >: [Text T] [NL] [standard_names Ss] = <fail_to_parse> [Text T] </> [standard_names Ss] standard_names : =
/* The following is actually the "direction of the spatial component", so "component" is a bad name (but kept here for consistency with the original terminology). Note that the rules allow for two direction terms to be used for a tensor quantity. Clearly, only certain pairings are possible, but I have not built this restriction in as yet. */
standard_name1 : [surface S] [component C] [standard_name N] [at_surface AS] [in_medium M] [due_to_process P] [where_type T] [assuming_condition AC] = [surface S] [component C] [standard_name N] [at_surface AS] [in_medium M] [due_to_process P] [where_type T] [assuming_condition AC] surface : [Surface S] "_" = <surface> [Surface S] </> surface : =
component : [Direction D1] "_" [Direction D2] "_" = <direction> [Direction D1] </> <direction> [Direction D2] </> component : [Direction D] "_" = <direction> [Direction D] </> component : =
at_surface : "_at_" [Surface S] = <at_surface> [Surface S] </> at_surface : =
in_medium : "_in_" [Medium M] = <in_medium> [Medium M] </> in_medium : =
due_to_process : "_due_to_" [Process P] = <due_to_process> [Process P] </> due_to_process : = where_type : "_where_" [WhereType W] = <where_type> [WhereType W] </>
where_type : = assuming_condition : "_assuming_" [Condition C] = <assuming_condition> [Condition C] </> : =
substance : [Substance S] = <substance> [Substance S] </> standard_name : "change_over_time_in_" [standard_name X] = <change_over_time_in> [standard_name X] </>
standard_name : "convergence_of_" [standard_name X] = <convergence_of> [standard_name X] </> standard_name : "horizontal_convergence_of_" [standard_name X] = <horizontal_convergence_of> [standard_name X] </> standard_name : "correlation_of_" [standard_name X] "_and_" [standard_name Y] = <correlation_of> [standard_name X] [standard_name Y] </>
standard_name : "correlation_of_" [standard_name X] "_and_" [standard_name Y] "_over_" [standard_name Z] = <correlation_of> [standard_name X] [standard_name Y] [standard_name Z] </> standard_name : "covariance_of_" [standard_name X] "_and_" [standard_name Y] = <covariance_of_> [standard_name X] [standard_name Y] </> standard_name : "covariance_of_" [standard_name X] "_and_" [standard_name Y] "_over_" [standard_name Z] = <covariance_of_> [standard_name X] [standard_name Y] [standard_name Z] </> standard_name : [Direction D] "_derivative_of_" [standard_name X] = <derivative_of> [Direction D] [standard_name X] </>
standard_name : "derivative_of_" [standard_name X] "_wrt_" [standard_name Y] = <derivative_of> [standard_name X] [standard_name Y] </> standard_name : "direction_of_" [standard_name X] = <direction_of> [standard_name X] </> standard_name : "divergence_of_" [standard_name X] = <divergence_of> [standard_name X] </> standard_name : "horizontal_divergence_of_" [standard_name X] = <horizontal_divergence_of> [standard_name X] </>
standard_name : "histogram_of_" [standard_name X] = <histogram_of> [standard_name X] </> standard_name : "histogram_of_" [standard_name X] "_over_" [standard_name Y] = <histogram_of> [standard_name X] [standard_name Y]</> standard_name : "integral_of_" [standard_name X] "_wrt_" [standard_name Y] = <integral_of> [standard_name X] [standard_name Y]</> /* I'm really uncomfortable handling standard functions (integral, ln, log10) like this. Given that we are now moving into MathML territory, why not just include MathML? */
standard_name : "ln_" [standard_name X] = <ln> [standard_name X] </> standard_name : "log10_" [standard_name X] = <log10> [standard_name X] </> standard_name : "magnitude_of_" [standard_name X] = <magnitude_of> [standard_name X] </> standard_name : "probability_distribution_of_" [standard_name X] = <probability_distribution_of> [standard_name X] </>
standard_name : "probability_distribution_of_" [standard_name X] "_over_" [standard_name Z] = <probability_distribution_of> [standard_name X] [standard_name Z] </> standard_name : "probability_distribution_function_of_" [standard_name X] = <probability_distribution_function_of> [standard_name X] </> standard_name : "probability_distribution_function_of_" [standard_name X] "_over_" [standard_name Z] = <probability_distribution_function_of> [standard_name X] [standard_name Z] </> standard_name : "product_of_" [standard_name X] "_and_" [standard_name Y] = <product_of> [standard_name X] [standard_name Y] </>
standard_name : "ratio_of_" [standard_name X] "_to_" [standard_name Y] = <ratio_of> [standard_name X] [standard_name Y] </> standard_name : "square_of_" [standard_name X] = <square_of> [standard_name X] </> standard_name : "tendency_of_" [standard_name X] = <tendency_of> [standard_name X] </> /* Hand-crafted rules */ standard_name : "mass_concentration_of_" [substance S] [in_medium M] = <mass_concentration_of> [substance S] [in_medium M] </>
standard_name : "mass_fraction_of_" [substance S] [in_medium M] = <mass_fraction_of> [substance S] [in_medium M] </> /* This is a quick fix to get things up and running! */ standard_name : [BaseName BN] = <basename> [BaseName BN] </>
Add content