ModelicaXML A Modelica XML representation with Applications - - PowerPoint PPT Presentation

modelicaxml
SMART_READER_LITE
LIVE PREVIEW

ModelicaXML A Modelica XML representation with Applications - - PowerPoint PPT Presentation

ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linkping University Outline Introduction Why XML? XML, DTD ModelicaXML ModelicaXML Applications


slide-1
SLIDE 1

ModelicaXML

A Modelica XML representation with Applications

Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University

slide-2
SLIDE 2

2

November 04, 2003

Outline

Introduction Why XML? XML, DTD ModelicaXML ModelicaXML Applications Problems with XML S

emantic Web Languages

Conclusions and Future Work

slide-3
SLIDE 3

3

November 04, 2003

Introduction

Modelica has a fast growing code base Modelica adopters have to develop their own

tools for tasks like:

analysis of models (checkers and validators) pretty printing (un-parsing) interchange with other modeling languages query and transformation of models impose code style guidelines documentation

All these utilities

need easy access to the structure of the language should interoperate.

slide-4
SLIDE 4

4

November 04, 2003

Why XML?

S

tore the structure of the Modelica code using an alternative representation

Perform the tasks on this alternative

representation

The alternative representation should

be easy accessible from any programming language be easy to transform, query and manipulate support validation

XML has all these properties

slide-5
SLIDE 5

5

November 04, 2003

Extensible Markup Language (XML)

World Wide Web Consortium (W3C) standard XML represents information as trees using tags

<?xml version="1.0"?> <!DOCTYPE persons SYSTEM "persons.dtd"> <persons> <person job="programmer"> <name>John Doe</name> <email>email@none.ro</email> </person> … <person job="manager"> <comment>Classified</comment> </person> </persons>

slide-6
SLIDE 6

6

November 04, 2003

Document Type Definition (DTD)

DTDs specify the allowed content of the XML elements Are used for XML document validation <!ENTITY % person-job-attribute "job (programmer|manager) #REQUIRED"> <!ELEMENT persons (person*)> <!ELEMEN person((name+, email*)|comment+)> <!ATTLIST person project CDATA #IMPLIED &person-job-attribute;> <!ELEMENT name(#PCDATA)> <!ELEMENT email(#PCDATA)> <!ELEMENT comment (#PCDATA)>

slide-7
SLIDE 7

7

November 04, 2003

Modelica code Modelica XML Modelica Parser read

  • utput

class Test "comment" Real x; Real xdot; equation xdot = der(x); end Test; <modelicaxml> <definition ident= "Test" comment="comment"> <component ident="x" type="Real" visibility="public" /> <component ident="xdot" type="Real" visibility="public" /> <equation>...</equation> </definition> </modelicaxml> modelicaxml definition component component equation

ModelicaXML

slide-8
SLIDE 8

8

November 04, 2003

ModelicaXML Applications Interoperability and Transformation

Modelica code Modelica XML XML Tools HTML Documentation Other XML formats Modelica Parser Other modeling languages Parsers validate, read

  • utput

validate, read

  • utput
  • utput

read read

  • utput
  • utput
slide-9
SLIDE 9

9

November 04, 2003

ModelicaXML + XS LT

The S

tylesheet Language for Transformation (XS LT)

is a declarative language for transforming XML trees selects parts of the XML tree using the XPath language uses templates to transform the selected parts

  • utputs desired format

Modelica XML XSLT Other modeling languages HTML Documentation Other XML formats Modelica code

slide-10
SLIDE 10

10

November 04, 2003

ModelicaXML + XQuery

The Query Language for XML (XQuery)

is a declarative language for query of XML trees selects parts of the XML tree using the XPath language uses S

QL-like query language to further manipulate the results

Modelica XML XQuery Model Queries Style guidelines Answers

slide-11
SLIDE 11

11

November 04, 2003

ModelicaXML + DOM

Document Obj ect Model (DOM)

is a platform and language neutral interface for

access and update the content/ structure/ style of XML trees in

XML documents

implementation in almost all programming languages Modelica XML DOM Programming Languages Semantic Analysis Unparsing Code transformation Model instantiation Optimization

  • thers
slide-12
SLIDE 12

12

November 04, 2003

Problems with the XML Representation

XML can only express syntax No easy way to automatically handle semantics Possible solutions

use more expressive markup languages to

express Modelica semantics

use available tools for these languages

slide-13
SLIDE 13

13

November 04, 2003

S emantic Web Languages

Resource Description Framework (RDF)

represents graphs describes classes and relations

  • ut of the box tools for graph query

some type checking is available

Web Ontology Language (OWL)

adds a Description Logics layer on top of RDF

  • ut of the box tools for:

type checking model consistency making the implicit sub-typing and equivalence

relations explicit (inference)

slide-14
SLIDE 14

14

November 04, 2003

Conclusions and Future Work

ModelicaXML

  • ffers easy access to Modelica language structure

helps in providing more non-simulation applications

for Modelica

is not enough for handling Modelica semantics

Future Work

formal definition of all the intermediate steps from

Modelica to flat Modelica (static semantics, interoperability)

tools will act on these level independent of each other

further investigation of the use of the S

emantic Web Languages to express Modelica semantics is needed

slide-15
SLIDE 15

15

November 04, 2003

End

Thank you! Questions?

slide-16
SLIDE 16

16

November 04, 2003

ModelicaXML and ModelicaOWL

ModelicaXML

http:/ / www.ida.liu.se/ ~adrpo/ modelica/ xml

ModelicaOWL

http:/ / www.ida.liu.se/ ~adrpo/ modelica/ owl