Using Mind Maps to Model Semistructured Documents - Springer Link

46 downloads 9512 Views 232KB Size Report
signing and modeling semistructured data, and as teaching aids or think- ... makes it so attractive for representing semistructured document structures. User.
Using Mind Maps to Model Semistructured Documents Alejandro Bia1 , Rafael Mu˜ noz2 , and Jaime G´ omez3 1

CIO/DEMI, Miguel Hern´ andez University, Spain [email protected] 2 DLSI, University of Alicante, Spain [email protected] 3 DLSI, University of Alicante, Spain [email protected]

Abstract. We often use UML diagrams for our software development projects, and also for modeling XML DTDs and Schemas (1), finding that although UML diagrams can effectively be made to represent DTDs and Schemas (either using Class or Component diagrams), in real practice, complex DTDs and Schemas produce unreadable, unmanageable, complex UML diagrams. Recently we started exploring other types of diagrams and unconventional methods which can be both useful for designing and modeling semistructured data, and as teaching aids or thinking tools. This experience also served to open our minds to tools and methods other than the recognized mainstream practices. In this paper, we describe how we managed to use Mind Maps and a modified Freemind tool to successfully model, design, modify, import and export XML DTDs, XML Schemas (XSD and RNG) and also XML document instances, getting very manageable, easily comprehensible, folding diagrams. In this way, we converted a general purpose mind-mapping tool, into a very powerful tool for XML vocabulary design and simplification (and also for teaching XML markup, or for presentation purposes). Keywords: Visual Modeling, Mind Maps, XML, DTD, Schema.

1

Introduction

A Mind Map is a tree that develops from a central node, or to say it differently, a set of trees (subtrees) hanging from a central node. A DTD or Schema can be drawn as a graph, with complex interconnections, but if we consider each element and its content model separately, we can draw an element’s definition as a tree. Then we can link the contained elements (leaves) to the roots of their corresponding definition trees. This crossed-links will turn the whole diagram into a graph, but with interesting visualization and folding properties. In this way, we can represent a DTD or Schema structure as a set of parallel trees, which closely resemble DTD/Schema syntax, with links connecting some leaves with some roots, in a graph-like manner. The advantage is that trees can be folded and unfolded, allowing us to hide or show different parts of the diagram. This allows for better visualization and comprehension. M. Lalmas et al. (Eds.): ECDL 2010, LNCS 6273, pp. 421–424, 2010. c Springer-Verlag Berlin Heidelberg 2010 

422

1.1

A. Bia, R. Mu˜ noz, and J. G´ omez

Tool Features

Sometimes, apart from the benefit of using a given type of diagram, tool features are key to a successful visual model. Mind mapping software can be used efficiently to organize large amounts of information, combining spatial organization, dynamic hierarchical structuring and node folding. These features are essential to a good DTD or Schema visual representation. A good model must be capable of hiding unnecessary detail. This is precisely one of the problems that we had when we used available UML tools with Class diagrams: whole DTD/Schema diagrams were too complex to handle and display, and there was no way to selectively fold parts of them. This, added to the lack of efficient automatic arranging of visual objects while importing a DTD/Schema, made our attempts impractical for real-life purposes. The ability of Freemind to interactively hide/unhide branches of a Mind Map diagram, and the automatic allocation of nodes around a central point is what makes it so attractive for representing semistructured document structures. User friendly features for copying, pasting, moving, dragging-and-dropping subtrees make it ideal for structure design and editing. For this we needed a way to import and export several types of schemes. So we implemented XSLT transformations for the most popular notations: DTDs, W3C XML Schema and RelaxNG.

Fig. 1. A simple example of XML Schema represented as a Mind Map, with all the nodes unfolded. The root node ‘BOOK’ is the only node not pointed from any other content model. Note the small map on the top left, which allows seeing the whole picture of a big diagram when it does not fit in the screen.

Mind Maps to Model Semistructured Documents

1.2

423

Our Implementation

Freemind uses an XML file format to store the diagrams, which is very simple to understand and generate. We have written several XSLT scripts to translate DTDs, XSD and Relax NG Schemas to and from Fremind file format. In the case of DTDs, whose syntax looks quite like, but is not actually XML, we used DTDinst, a program for converting XML DTDs into an XML format. DTDs expressed in this XML format can be easily transformed to any other XML format, and particularly to Freemind Mind Maps. On the opposite direction, we used just an XSLT script in text output mode to write back a DTD. These XSLT scripts actually build the Mind Map, defining how DTD or Schema elements are rendered. Although the Freemind file format allows assigning an explicit location to graphical elements, it is better not to do so since the program does a very fine job of automatically arranging everything into a nice readable diagram, avoiding overlaps. What we do specify is that nodes be rendered to the left of the initial node. We can also specify whether subtrees should appear folded or unfolded on opening the diagram.

Fig. 2. Partial view of a Mind Map of a TEI XML Schema with the ‘body’ element unfolded, and the rest of the elements folded

The DTD or Schema is presented as a Mind Map beginning in a central oval node, and from it each element definition is a subtree (root in green). Each subtree describes a content model (see figs. 1 and 2), and can be folded and

424

A. Bia, R. Mu˜ noz, and J. G´ omez

unfolded by clicking on its green root node. Sequence or choice operators that conform to the rules of the content model are represented in the middle nodes of the subtree (in yellow). Leaf nodes (in red) are the elements referred by the content model, and point (both graphically with curved arrows and by hyperlink) to the subtree definition of the corresponding element (elsewhere in the diagram). This allows for easy navigation and comprehension of the global graph structure. In fig.2, the content model of the element ‘body’ can be clearly seen. The elements referred from this content model (leaf nodes) can be traced by following the curved links, or more easily by clicking on the leaf nodes themselves, which cause the cursor to jump directly to the root of the referred element. In this way, a user can analyze the content model on a unfolded element, and then click on any contained element to directly jump to its root. In the case of TEI DTDs and Schemas, we have also added external links from each element of the Mind Map to the corresponding TEI documentation page of the element on the Web (see fig. 2). This is very useful for training purposes. It allows the user to immediately see the documentation of any chosen element, just by clicking on it. 1.3

Conclusions and Future Work

We have found many advantages in the use of Mind Maps and the Freemind tool for modeling XML DTDs and Schemas: (1) Automatic organization of graphic elements: key to successful easy import of schemas into a readable diagram. (2) Hierarchical tree structure in an overall graph structure: ideal for representing content models. (3) Information hiding/unhiding by folding tree branches. (4) Powerful visual editing features: copying, pasting, moving, dragging-anddropping subtrees. There are several tools that can display schemas, but not to edit them in graphical form. (5) Hyperlinking to external files: which we used to automatically link to external documentation pages. (6) Easy XML file format: allowed us to automatically convert DTDs and Schemas to Mind Maps and the other way around, converting the adapted Freemind tool into a document structure design or editing tool. We have also automated the generation of Mind Map models of XML document instances, and are now working both on DTD/Schema visual comparison, and XML document instance structure visual comparison, to make evident the differences of two of these files by using cross-links and colors on diagrams aligned side by side.

Reference 1. Bia, A., G´ omez, J.: UML for Document Modeling: Designing Document Structures for Massive and Systematic Production of XML-based Web Contents. In: Briand, L.C., Williams, C. (eds.) MoDELS 2005. LNCS, vol. 3713, pp. 648–660. Springer, Heidelberg (2005), http://www.cs.colostate.edu/models05/