5.4 Textual Weaving Model
5.4.2 Textual Weaving Model Example
An example of a weaving model which weaves text representing the company structure modeling language example to its abstract syntax representation is displayed in Figure 5.7. The lower left side of the picture shows theDatawhich underlies the edited text. A tree-based visualization is chosen to represent the model which is edited by the textual projection on the right-hand side of the figure. In theText-based, user-defined representation a company is represented by its name followed by its departments in curly brackets. Departments are represented in the same way as companies but display their employees in curly brackets. Each employee is represented on a new line starting with its name, followed by the salary in brackets and terminated with a semicolon. The
Weaving Model in the top center of the figure connects the data model in the bottom left with its textual representation in the bottom right.
5.4. Textual Weaving Model
Quality Toys Inc.{ Online Marketing{ Allen (32k); Tim (36k); } Toy Research{ Jim (42k); Bob (48k); } } WeavingLink (target=QualityToys)
TraitWeavingLink (target=name; trait=value)
TextElement(text='Quality Toys Inc.{'; offset=0; length=18) WeavingLink(target=OnlineMarketing)
TraitWeavingLink(target=name; trait=value)
TextElement(text='Online Marketing'; offset=19; length=16) TextElement(text='{'; offset=36; length=1)
WeavingLink (target=Allen)
TraitWeavingLink (target=name; trait=value) TextElement(text='Allen'; offset=38; length=5) TextElement(text=' ('; offset=44; length=2) TraitWeavingLink (target=salary; trait=value) TextElement (text='32k'; offset=47; length=3) WeavingLink (target=Tim) ... Weaving Model Text Data Entity(name='QualityToys')
Attribute(name='Quality Toys Inc.') Entity(name='OnlineMarketing') Attribute(name='Online Marketing') Entity(name='Allen')
Attribute (name='name'; value='Allen') Attribute(name='salary'; value='32k') Entity(name='Tim') Attribute(name='name'; value='Tim') Attribute(salary='36k') Entity(name='ToyResearch') ...
Figure 5.7: Textual weaving model for the company structure modeling lan- guage example.
created to the corresponding element in the abstract syntax representation of the model. The weaving model shows only a fewWeavingLinksfor space reasons. Where aWeavingLinkpoints to is indicated by thetargetattribute value specified in the brackets of theWeavingLink’stextual representation in theWeaving Model
tree. Here, WeavingLinks are shown for the clabjects Quality Toys Inc., Online Marketing,Allen andTim. Also,TraitWeavingLinksare shown for the value trait (trait=value) of the name (target=name) and salary (target=salary) attributes of
Allen. Each WeavingLink containsTextElements as children indicating the text representing theWeavingLink. TheseTextElements indicate first the text which they represent, followed by theoffsetat which the element starts in the textual visualization and thelength. Hence, this model establishes a link for each piece of text in the textual model to its representation in the abstract syntax model. Two of these links are shown in Figure 5.7 by solid black lines. These lines connect thenameandsalaryof Allenwith their representations in the abstract syntax representation and their textual visualization.
Chapter 6
The Tabular Format
The tabular visualization format organizes model content in rows and columns. The information belonging to a model element is contained in a row and is orga- nized into columns based on the model element’s properties. Compared to the two previously introduced formats it is clear that the tabular format is neither a spatial format like diagrams nor a sequential format like text. It therefore shares neither the advantages nor disadvantages of these formats. The tabular format is most suitable for showing huge amounts of data in a condensed way with sophisticated filtering, grouping, ordering and sorting mechanisms. This makes the format a perfect fit for data analysis and simulation tasks.
6.1
Tabular Predefined Language
When applying the tabular editing paradigm to linguistic modeling, the en- tities contained in a model element (e.g. clabjects contained in a level) are visualized as rows and their linguistic attributes (e.g. name, potency) and connections (e.g. list of an entity’s ontological attributes connected via con- tainment references) as columns. A problem of this mapping of abstract syntax elements to columns is that the content of a table can be of different linguis- tic types characterized by different linguistic traits. A level for example can contain amongst others inheritance relationships, connections and entities, all featuring a different set of traits. To combine all these model elements of
different linguistic types featuring different sets of traits in one single table, content sensitive filtering and displaying algorithms have to be employed on the table content.
To determine what is viewed in a table a context and viewpoint are set. The context is the model element whose content is to be displayed in a table. For a level, all clabjects, connections and inheritance relationships are shown. For a clabject all attributes, methods, contained clabjects, connections, and inheritance relationships are displayed. The viewpoint determines the columns and content displayed in a table. If for example the viewpoint is set to clab- ject only instances of the linguistic clabject type are displayed showing the linguistic traits of clabject.
Data: modelElements
Result: Find the smallest common linguistic type. 1 viewpoint ← plm::Element;
2 apply ← true; 3 while apply do
4 for subtype ∈ subTypes(viewpoint) do 5 apply ← true;
6 for modelElement ∈ modelElements do
7 if ¬conforms(modelElement, subtype) then
8 apply ← false; 9 break; 10 end 11 end 12 if applies then 13 viewpoint ← subtype; 14 break; 15 end 16 end
17 if subTypes(viewpoint) = ∅ then break;
18 end
19 return viewpoint;
6.1. Tabular Predefined Language
When a table is opened the initial viewpoint is the most concrete common linguistic type of the content of the table’s context. The algorithm determin- ing the most concrete common linguistic type of a set of instances is shown in Algorithm 6.1. The input to the algorithm are all modelElements to be visualized in the table. The algorithm starts with the element at the root of the linguistic metamodel inheritance hierarchy,Element, as initialviewpoint
(line 1). From this metaclass it traverses down the inheritance tree (line 4) un- til a viewpoint is found which has only subtypes to which not allmodelElements
conform (line 3). Conformance of modelElementsto thesubtypeof theviewpoint
currently under investigation is checked in line 6 and 7. If one modelElement
does not conform to the currently investigated subtype, the apply variable is set to false indicating that currently no subtype suitable asviewpoint is found and the search is continued with the next subtype of the current viewpoint
(lines 8 and 9). If asubtype is found to which allmodelElements conform, it is used as the new viewpoint (line 13) and the subclasses of this viewpoint are searched for a most concrete common type (line 14) for themodelElements to be visualized. The algorithm terminates if the newly discoveredviewpointdoes not have any subtypes (lines 17). Alternatively, the algorithm also terminates when the first viewpoint is discovered which does not have any subtype to which allmodelElementsconform.
While working with the table the user can change this preselected view- point. So for example it can be switched fromClabjecttoEntity. After changing the filter toEntitythe table shows Entitiesonly but with all linguistic traits of
Entity. Also the context of a table can be changed, by double clicking a row in the table. After changing the context of a table the viewpoint is reset to the most concrete common linguistic type of the new context’s content.
Displaying and filtering content based on a viewpoint and context is demon- strated in Figure 6.1 which shows the company structure modeling language modeled in the predefined diagrammatic LML notation on the left-hand side (Figure 6.1(a)) and three corresponding predefined tabular visualizations on the right-hand side (Firgue 6.1(b)). The first of the three tables shows the
O0-level set as context. The content of this table is equal to the content of the
Company Structuremodel’s L1 level shown in Figure 6.1(a), which is limited to
the horizontally aligned arrow signs above the table, also referred to as bread- crumbs [114]. Here location breadcrumbs are used to indicate the location at which the current context of the table is located within the edited deep model. Each row in the table corresponds to one model element residing in level O0.
The initial viewpoint is the most concrete common type of allO0content which
is Element as indicated by the brackets in the breadcrumb. The first column shows the linguistic type of the model element represented by the row and the second column shows the ontological type of the model element. Here, model elements of the linguistic typeEntityandInheritanceare displayed in the table. Since O0 is the highest level, no ontological types are displayed for the O0
content. The rectangle pointing down next to the column heading of Linguistic TypeandOntological Typeindicate that the column values can be used to filter the viewed model elements. The list available for filtering elements contains all the values present in a column. In case of theLinguistic TypecolumnEntityand
Inheritance can be selected. Additional columns can be included in the table but are no shown in Figure 6.1(a) for space reasons. These include a possible third and fourth column displaying the supertypes and subtypes of the model elements and a possible fifth column showing model elements connected to the model element via connections. All these cells can display multiple values since multiple inheritance, multiple connections and multiple linguistic/ontological classification relationships are supported. Clicking on the arrow button in one of these columns opens a table displaying the cell content in its own table.
The following columns separated by a vertically double lined border show the linguistic trait values of the model elements. The displayed columns de- pend on the viewpoint which is the most concrete common type of the con- text’s content, —Element, in this example. Hence, the linguisticnametrait is displayed for editing because this is the only linguistic trait of Element.
The table in the middle of Figure 6.1(b) shows the content of theO0 level
with the viewpoint set to the linguistic type Clabject as indicated by the last segment of the middle table’s breadcrumb (O0(Clabject)). Three Clabjects,Em-
ployeeType, TechnicalEmployeeType and BusinessEmployeeType conforming to the linguistic type Clabject are displayed. In addition to thenametrait the traits
potency andfeaturecommon to allClabjectsare included in the table.
6.2. Tabular User-defined Language