Showing posts with label Meta Programming. Show all posts
Showing posts with label Meta Programming. Show all posts

Tuesday, August 12, 2008

Meta-Programming as a Model Creation Technique

Model-Driven Programming and Meta-Programming together with Semantic Web and End-User Programming techniques are vital ingredients of the User Driven Programming/Modelling approach used in this thesis. Dmitriev (2006) explains the problem to be solved in order to improve model production as “limitations of programming which force the programmer to think like the computer rather than having the computer think more like the programmer.” Meta-programming (Dmitriev, 2006) is a useful way of allowing for language independent software development, and can aid in providing a high level front-end to programming languages. “Meta-programming is the writing of programs that write or manipulate other programs (or themselves) as their data” (Wikipedia, 2008).

The idea behind use of meta-programming in this thesis is that instead of writing programs to do a task a domain expert needs the program for, the meta program developer creates an environment which all domain experts, in this and similar fields can use to create their own solutions. The developer then only needs to maintain and improve this programming environment, and can concentrate on this task; the domain expert can concentrate on solving the problem at hand without having to ask the developer to create the code on his or her behalf. Dmitriev (2006) advocates reducing dependency on languages and environments by enabling programmers to develop their own specific languages for solving each domain problem:

"If we are going to make creating languages easy, we need to separate the representation and storage of the program from the program itself. We should store programs directly as a structured graph, since this allows us to make any extensions we like to the language. Sometimes, we wouldn't even need to consider text storage at all. A good example of this today is an Excel spreadsheet. Ninety-nine percent of people don't need to deal with the stored format at all, and there are always import and export features when the issue comes up. The only real reason we use text today is because we don't have any better editors than text editors. But we can change this... Text editors... don't know how to work with the underlying graph structure of programs. But with the right tools, the editor could work directly with the graph structure, and give us freedom to use any visual representation we like in the editor. We could render the program as text, tables, diagrams, trees, or anything else. We could even use different representations for different purposes, e.g. a graphical representation for viewing, and a textual representation for editing. We could use domain specific representations for different parts of the code, e.g. graphical math symbols for math formulas, graphic charts for charts, rows and columns for spreadsheets, etc. We could use the most appropriate representation for the problem domain, which might be text, but is not limited to text. The best representation depends on how we think about the problem domain. This flexibility of representation would also enable us to make our editors more powerful than ever, since different representations could have specialized ways to edit them."

This provides a way to create programs that create programs so enabling the 3 step translation process used in this thesis, and this enables translations between people, between systems, and between languages. This could enable those who are not currently programmers to create models at their domain level using domain specific systems created for them by programmers. The mechanisms for this are recursive translation of the tree/graph code representation to multiple models and languages, where necessary aided by user/modeller choices.

References

Dmitriev, S., 2007. Language Oriented Programming: The Next Programming Paradigm - http://www.onboard.jetbrains.com/is1/articles/04/10/lop/.

Fischer, G., 2007. 'Meta-Design: A Conceptual Framework for End-User Software Engineering' http://drops.dagstuhl.de/opus/frontdoor.php?source_opus=1087 - Dagstuhl Seminar Proceedings.

Wikipedia (2008) Metaprogramming - http://en.wikipedia.org/wiki/Metaprogramming.

More information is available at - http://www.cems.uwe.ac.uk/amrc/seeds/softwareengineering.htm#MetaProgramming.

Monday, May 07, 2007

Translation for Visual End User Programming

Research Theory influencing this Translation Mechanism


The use of the Semantic Web in my thesis is to be a means for open standard representation of information (built on XML), transformation into different representations as required, and for provision of a high level interface as a tool for model creation, and translation to program code. An 'elaborator', is used, this is a translator that converts the diagrammatic representation of the problem into software code. Translations can be performed into any programming or meta-programming language or open standard information representation language, the visualisation of the model created can be displayed on the web. This translation builds on research in program and model transformation. The translation software performs transformations as required between different programming languages and visual model views. This has been prototyped, but it is important to further this research in order to establish a user base, and make the translation generic. Figure 1 shows the process.



Figure 1 - Translation Process


Implementation


Translation Process


This research involves finding alternative ways of representing models, which do not require the user to write code. The intention is to make it easier to interact with and change the models, and to share information with colleagues. The information used in the models resides in an ontology, and from this ontology models can be automatically produced via a recursive translation tool that has been prototyped.



The research for my thesis uses a technique of interpreting information in order to create decision support programs automatically in response to user choices. This technique is then extended for use in the automatic creation of programs in other computer languages and systems. This can be achieved by automated translation of the Vanguard Studio information into other languages. The basis of this is that elaborators are nodes in the tree, which are automatically created and dynamically write objects. This allows the wing box definition to be translated to the decision support system for costing and then to other software such as web pages for further processing or visualization. An open standard semantic editor Protégé created by Stanford University (2007) was used to structure this information into related taxonomies. This ontology holds the definitions of nodes representing information, and calculations to be performed. Taxonomies are created in Protégé for 'Parts', 'Materials', 'Consumables', 'Processes', 'Rates', and 'Tooling' for a prototype costing system. 'Parts' is the core taxonomy. New categories can be produced as required. Domain experts would edit the taxonomies; these experts can specify the relationships of classes and the equations to be used via a visual user interface in Protégé. These relationships are evaluated and translated to produce computer code. Figure 2 illustrates how code is produced from the semantic relationships.



Figure 2 - Translation Process Implementation


This model can be used as it is, or be a template for the generation of a further model(s). An example interface, a section from a model produced automatically, is shown in figure 3. This information is saved using a generic structure based on keys that define all relationships, into a relational database. This enables storage of hierarchical data in a relational database and also allows for separation of information into tables according to category, and the use of SQL (Structured Query Language) to automatically query and structure the information as required. Vanguards' tree based decision support tool Vanguard Studio (2007) reads this information and represents it as colour-coded nodes. The code written for this thesis automatically queries the taxonomies that make up the ontology and links the information as required for the model. The code builds in all the links required for the equations and thus links up information from different taxonomies, the information is colour coded according to which taxonomy it is from. This same code can be reused for any modelling problem, it builds the equations and follows the links to build each equation tree, and attach this to the rest of the tree. The decision support tool can perform calculations and so output results. Figure 3 shows how the decision support tool can automatically construct and represent a branch in the tree, visualize an equation and calculate a result. Red nodes represent processes, green nodes represent the part definition and magenta nodes represent resources. This illustrates how 3 taxonomies have been automatically linked because they are needed in this calculation. In this prototype hundreds of calculations have been related to each other, this example illustrates that 'Area' was also calculated, and that this forms part of the tree for the 'Hand Layup Tool Cleaning Cost', which in turn is passed into other calculations. Hundreds of calculations using information from all the taxonomies are linked as required in this costing example. The time taken to perform the translation from the ontology and to perform all the calculations is a less than a second.




Figure 3 Ontology to Model Conversion



References


Stanford University, 2007. Welcome to protégé - http://protege.stanford.edu/.


Vanguard Studio, 2007. Global Knowledge Portal http://wiki.vanguardsw.com/.



My Research - http://www.cems.uwe.ac.uk/~phale/.


Modelling - http://www.cems.uwe.ac.uk/amrc/seeds/Modelling.htm


Semantic Web Modelling - http://www.cems.uwe.ac.uk/amrc/seeds/ModellingSemanticWeb.htm


Visualization - http://www.cems.uwe.ac.uk/amrc/seeds/Visualisation.htm

Wednesday, April 11, 2007

Future Developments Of Ontologies And Visualization

So far my taxonomies include the traditional object oriented relationships such as child, parent, sibling, attribute, and instance. There are other types of relationship that would need to be modelled in order to maximise the capabilities of software that would use the taxonomies. Basic key relationships used within the object oriented programming domain between objects are implemented. These key relationships depict families of objects that may share attributes and methods through inheritance. They also describe aggregations of objects that make (usually) some geometric sense.

Semantic descriptions with more relationship types than this allow a more expressive depiction of a problem domain, and can aid some forms of search within a model. One of the main advantages of a semantic net description, in terms of automated model generation, is that labelling relationships between objects allows the depiction of a number of aspects of a domain in one model, and with a consistent syntax. Ciocoiu et al (2000) explain how an engineering ontology can be made more rigorous in order to facilitate interoperability. This allows representation of, say, a product structure and its manufacturing processes together. A single node then is the only representation of that node within the model, with all its relationships depicted as arcs emanating/terminating at the node. More expressive semantic descriptions are possible through the use of one of the standard OWL dialects. Protégé has OWL plug-ins available that provide this functionality, together with links to reasoning tools for maintaining and analysing the logical constructs (Storey et al, 2004) and (Elenius, 2005). The University of Victoria Computer-Human Interaction and Software Engineering lab (CHISEL) (University of Victoria, 2006) has developed Jambalaya (Ernst et al, 2003) for visualization of knowledge and relationships. Cheung et al (2005) provide an ontology editor for knowledge sharing in manufacturing.

It is also important not to stay limited on one ontology development environment but instead explore how ontologies can be developed using a range of development tools and translated between each where necessary (Garcia-Castro and Gomez-Perez, 2006) are testing this. For this reason, a large range of ontology management tools have been investigated and meta languages. An interesting development is SWRL a Semantic Web Rule Language Combining OWL and RuleML and its use in modelling (Miller and Baramidze, 2005).

References

Cheung, W. M., Maropoulos, P. G., Gao, J. X., Aziz, H., 2005. Ontological Approach for Organisational Knowledge Re-use in Product Developing Environments. In: 11th International Conference on Concurrent Enterprising - ICE 2005, University BW Munich, Germany.

Ciocoiu, M., Gruninger, M., Nau, D. S., 2000. Ontologies for Integrating Engineering Applications. Journal of Computing and Information Science in Engineering, 1(1) pp 12-22.

Elenius, D., 2005. The OWL-S Editor - A Domain-Specific Extension to Protégé. In: 8th Intl. Protégé Conference - July 18-21, 2005 - Madrid, Spain.

Ernst, N. A., Storey, M., Allen, P., Musen, M., 2003. Addressing cognitive issues in knowledge engineering with Jambalaya http://www.neilernst.net/docs/pubs/ernst-kcap03.pdf.

Garcia-Castro R, Gomez-Perez A, 2006. Interoperability of Protégé using RDF(S) as interchange language. In: 9th Intl. Protégé Conference, July 23-26, 2006 - Stanford, California.

Storey, M., Lintern, R., Ernst, N., Perrin, D., 2004, Visualization and Protégé In: 7th International Protégé Conference - July 2004 - Bethesda, Maryland.

University of Victoria, 2006. Model Driven Visualization (MDV) http://www.thechiselgroup.org/?q=mdv.

I am developing a project to provide free online collaborative modelling tools.

My Research - http://www.cems.uwe.ac.uk/~phale/

Examples - http://www.cems.uwe.ac.uk/~phale/InteractiveSVGExamples.htm

Semantic Web Modelling - http://www.cems.uwe.ac.uk/amrc/seeds/ModellingSemanticWeb.htm

Tuesday, April 03, 2007

Translation And Pipelining Applied To End-User Programming

This research involves using Semantic Web technologies to enable end user programming. This technology is applicable to any problem that involves user interaction, so can be applied in industries and home use for any task or subject area.

The work involves allowing non-programmers to model complex problems visually and without having to use programming languages. Information is created in a visual tree using an Ontology editor, the information is then transformed, and all calculations performed. Further transformations can be performed into any programming language or open standard information representation language, and this can be displayed on the web. This approach can be described as 'pipelining', which is explained by Gropp (2003) using the example of a project to convert Geography Markup Language (GML) to Scalable Vector Graphics (SVG). SVG is explained by McKeown and Grimson (2000). Pipelining is also core to XML (eXtensible Markup Language) (w3C, 2006) and XForms technologies (Bruchez, 2006), which are explained in this thesis. Pipelines are important for translation and Meta Programming techniques I use as they apply one program to the results of another. Also transformations can be performed between a tree representation and other styles of representation e.g. an interactive CAD style representation, using SVG. A major theme of the research is that of prototyping solutions to the problems raised, using web and other software technologies. These are then referenced from the thesis document to illustrate the solutions discussed.

The additional advantage is that of displaying the expressions in the appropriate context. Crapo et al (2002) explain that visualization helps the modeller to maintain a hierarchy of submodels at different stages of development and to navigate effectively between them, this is my reason for breaking down the models into a tree structure.

Semantic Web research has been developed from the work of Tim Berners-Lee (1997). Uschold (2003) defines the Semantic Web as being machine usable and associated with more meaning. Semantic web technologies and the use of agents and ontologies are explained by Hendler (2001) and Uschold who explains that "In order to carry out their required tasks, intelligent agents must communicate and understand meaning".

Meta programming is the writing of programs that write or manipulate other programs (or themselves) as their data. The idea behind this technique is that instead of writing programs to do a task a person needs the program for, the meta program developer creates an environment which all domain experts, in this and similar fields, can use to create their own solutions. The developer then only needs to maintain and improve this programming environment, and can concentrate on this task; the domain expert can concentrate on solving the problem at hand without having to ask the developer to create the code on his or her behalf. This can prevent problems of misunderstanding, delay, and expense that often result from communication of difficult concepts between people who are experts in different areas (domain expert and programming expert).

This is another useful article on sharing RSS feeds via linked up pipes (Yahoo Pipes) -

Pipes and Filters for the Internet-http://radar.oreilly.com/archives/2007/02/pipes_and_filte.html.

This approach could make it easier for web developers to build interacive websites without needing to do in depth coding.

References

Berners-Lee, T., Fischetti, M., 1997. Weaving the Web. Harper San Francisco; Paperback: ISBN:006251587X

Bruchez, E, 2006. XForms: an Alternative to Ajax?. In: XTech 2006: Building Web 2.0 16-19 May 2006, Amsterdam, The Netherlands.

Crapo, A. W., Waisel, L. B., Wallace, W. A., Willemain, T. R., 2002. Visualization and Modelling for Intelligent Systems. In: C. T. Leondes, ed. Intelligent Systems: Technology and Applications, Volume I Implementation Techniques, 2002 pp 53-85.

Gropp, E., 2003. Accelerating SVG Transformations with Pipelines. In: SVG Open 2003 - Conference and Exhibition 2nd Annual Conference on Scalable Vector Graphics - Vancouver, Canada.

Hendler, J., 2001. Agents and the Semantic Web. IEEE Intelligent Systems Journal.

McKeown, J., Grimson, J., 2000. SVG: putting XML in the picture In: XML Europe 2000 Paris France.

Uschold, M., 2003. Where are the semantics in the semantic web? AI Magazine Vol 24 (3) pp 25-36.

W3C (World Wide Web Consortium), 2006. http://www.w3.org/TR/xproc/ XProc: An XML Pipeline Language W3C Working Draft 17 November 2006.

I am developing a project to provide free online collaborative modelling tools.

My Research - http://www.cems.uwe.ac.uk/~phale/

My Blog - http://userdrivenmodelling.blogspot.com/

My SVG Page - http://www.cems.uwe.ac.uk/amrc/seeds/PeterHale/SVG/SVG.htm